Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
8db52c85
Commit
8db52c85
authored
8 years ago
by
Johannes Eder
Browse files
Options
Downloads
Patches
Plain Diff
Tutorial Mode auto start impl via thread
refs 2869
parent
95d80fd3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java
+50
-1
50 additions, 1 deletion
...fortiss/tooling/kernel/ui/internal/TutorialUIService.java
with
50 additions
and
1 deletion
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java
+
50
−
1
View file @
8db52c85
...
...
@@ -17,6 +17,8 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+--------------------------------------------------------------------------*/
package
org.fortiss.tooling.kernel.ui.internal
;
import
static
org
.
eclipse
.
core
.
runtime
.
Status
.
CANCEL_STATUS
;
import
static
org
.
eclipse
.
core
.
runtime
.
Status
.
OK_STATUS
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
LoggingUtils
.
error
;
import
java.io.File
;
...
...
@@ -24,17 +26,25 @@ import java.net.MalformedURLException;
import
java.net.URI
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Optional
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.core.runtime.IStatus
;
import
org.eclipse.core.runtime.Platform
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.jface.action.IContributionItem
;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.ui.IEditorInput
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.PartInitException
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.progress.UIJob
;
import
org.fortiss.tooling.kernel.extension.ITutorialProvider
;
import
org.fortiss.tooling.kernel.extension.data.TutorialStepBase
;
import
org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem
;
...
...
@@ -59,7 +69,7 @@ import org.osgi.framework.BundleException;
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating
YELLOW
Hash:
3D55FF9743BBA332783A37E078A1465E
* @ConQAT.Rating
RED
Hash:
86CD841209EB95BE385D3201B5137A06
*/
public
final
class
TutorialUIService
implements
ITutorialUIService
,
ITutorialUIWhitelistProvider
,
IIntrospectiveKernelService
{
...
...
@@ -134,6 +144,45 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW
}
catch
(
MalformedURLException
urlEx
)
{
System
.
err
.
println
(
"[TUIS] "
+
urlEx
.
getMessage
());
}
// start tutorial immediately if command line arguments have been given
UIJob
uiJob
=
new
UIJob
(
Display
.
getCurrent
(),
"TutorialJob"
)
{
@Override
public
IStatus
runInUIThread
(
IProgressMonitor
monitor
)
{
final
String
getenv
=
System
.
getProperty
(
"sun.java.command"
);
List
<
String
>
split
=
Arrays
.
asList
(
getenv
.
split
(
" "
));
// search for Tutorial
Optional
<
String
>
cmdLineArgument
=
split
.
stream
().
filter
(
s
->
s
.
contains
(
"tutorial"
)).
findFirst
();
if
(!
cmdLineArgument
.
isPresent
())
{
return
CANCEL_STATUS
;
}
// 'tutorial = <Class name of tutorial root provider>'
String
cmdLineString
=
cmdLineArgument
.
get
();
String
[]
split2
=
cmdLineString
.
split
(
"="
);
String
className
=
split2
[
split2
.
length
-
1
];
Optional
<
Entry
<
Class
<?
extends
ITutorialProvider
>,
Class
<?
extends
ITutorialUIProvider
>>>
tutorialProvider
=
providerMap
.
entrySet
().
stream
()
.
filter
(
c
->
c
.
getKey
().
toString
().
contains
(
className
)).
findFirst
();
if
(!
tutorialProvider
.
isPresent
())
{
return
null
;
}
Class
<?
extends
ITutorialProvider
>
clazz
=
tutorialProvider
.
get
().
getKey
();
Display
.
getCurrent
().
asyncExec
(
()
->
ITutorialService
.
getInstance
().
startTutorial
(
clazz
));
return
OK_STATUS
;
}
};
uiJob
.
schedule
();
}
/** Tests for existence of META-INF sub-directory. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment