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
ac713054
Commit
ac713054
authored
7 years ago
by
Johannes Eder
Browse files
Options
Downloads
Patches
Plain Diff
NullPointer problem in build version
parent
cfff2af3
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
+38
-46
38 additions, 46 deletions
...fortiss/tooling/kernel/ui/internal/TutorialUIService.java
with
38 additions
and
46 deletions
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java
+
38
−
46
View file @
ac713054
...
...
@@ -17,8 +17,6 @@ $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
;
...
...
@@ -26,25 +24,17 @@ 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
;
...
...
@@ -146,43 +136,45 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW
}
// start tutorial immediately if command line arguments have been given
UIJob
uiJob
=
new
UIJob
(
Display
.
getCurrent
(),
"TutorialJob"
)
{
// TODO(JE): commented out due to problems in the build version -> Display.getCurrent() ==
// null
// 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;
// }
// };
@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
;
}
};
// commented out due to problems in the build version
// uiJob.schedule();
}
...
...
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