Commit 8bed289e authored by Johannes Eder's avatar Johannes Eder
Browse files

YELLOW

parent 61269198
AbstractIntegerSpinnerEditingSupport.java a67466d39ebb90b73a5f245120e4db51f8b4eca9 YELLOW
AbstractIntegerSpinnerEditingSupport.java 78492c72af2f63c6edc1fc9addd1ef2f750ffe72 YELLOW
CheckBoxEditingSupport.java 9abe8e0d0f16193dc512a67d9f2c95643335c68a GREEN
CheckBoxLabelProvider.java 89b9104de4cae67b646ad75c4ee3382e4f8bd401 GREEN
IconNameLabelProvider.java 04e0fbbfd41f33295ae83744df6af52c11fda167 GREEN
......@@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Spinner;
/**
* Base class for {@link EditingSupport}s that provide a integer {@link Spinner}.
* Base class for {@link EditingSupport}s that provides a integer {@link Spinner}.
*
* @author eder
*/
......
......@@ -9,4 +9,4 @@ ModelEditorBindingService.java 67cb577e2b89a9c0479698a3f45cef681885227e YELLOW
ModelElementHandlerService.java 6a15bf65b8bf7879293556125e3d2224e58e24f0 GREEN
NavigatorService.java 9a042a0ff9a21a45d98d14fe39b66e90ab974269 GREEN
ToolingKernelUIInternal.java aefc9a6a7ebcd6ff689558ffc4300992cca89ad6 GREEN
TutorialUIService.java 0f7124393b900ca8e1a87e7f985c0b440f2716fe RED
TutorialUIService.java d0f6ae47d6405bb2ac1407b377c86cf7772be353 YELLOW
......@@ -22,17 +22,26 @@ 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.core.runtime.Status;
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;
......@@ -131,46 +140,48 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW
}
// start tutorial immediately if command line arguments have been given
// 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;
// }
// };
// uiJob.schedule();
Display display = Display.getCurrent();
if(display == null) {
// Stop here if display is still null
// Then no tutorial is started on startup of AF3
return;
}
UIJob uiJob = new UIJob(display, "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 Status.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.asyncExec(() -> ITutorialService.getInstance().startTutorial(clazz));
return Status.OK_STATUS;
}
};
uiJob.schedule();
}
/** Tests for existence of META-INF sub-directory. */
......@@ -218,11 +229,6 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW
}
/** {@inheritDoc} */
// TODO(VA) So I understand only now why composite steps are necessary.
// There is the idea that every element which is displayed in a parent step is going to be
// displayed in the children-steps. I guess that's to prevent tedious redundancies? In any case
// that would be worth explaining somewhere, maybe in TutorialCompositeStep?
// TODO(VA) Methods below could be factorized by using lambdas
@Override
public boolean elementVisibleInNavigator(EObject element) {
TutorialStepBase step = ITutorialService.getInstance().getActiveTutorialStep();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment