Skip to content
Snippets Groups Projects
Commit fa66ef19 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

RED

refs 2490
parent 2b1b2989
No related branches found
No related tags found
No related merge requests found
......@@ -110,11 +110,15 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl
ILibraryElementReference parent =
getParentElement(eobj, ILibraryElementReference.class, true);
// TODO(VA) Comment not clear
// with "eobj.eContainer() != parent" we assume that the model elements are not directly
// contained in the reference
if(parent != null && parent != eobj) { // && eobj.eContainer() != parent) {
// TODO(VA) commented code above
return true;
}
// TODO(VA) if the above is clarified, could be simply turned into
// "return parent != null && parent != eobj";
return false;
}
......@@ -288,6 +292,8 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl
List<ILibraryElementHandler<EObject>> handlers = getRegisteredHandlers(clazz);
assert handlers.size() == 1;
// TODO(VA) get(0)
// BTW did you install the new ide.dev_tools? Cause they detect this automatically
ILibraryElementHandler<EObject> handler = handlers.get(0);
ILibraryElement libElem = handler.createLibraryElement(copy);
pack.getLibraryElements().add(libElem);
......
......@@ -101,6 +101,8 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel
public String getIntrospectionDescription() {
return getIntrospectionLabel() +
"\n\nThis service manages the model element prototypes." +
// TODO(VA) Would be nice to define "prototype": I know it's a problem of most
// newcomers that they have no idea what is meant by that, when it intervenes, etc.
"\nUsually model elements are composed of a couple of EObjects and have their attributes set to some predefined values." +
"\nEach part of the modeling language(s) can register prototype provider classes, which then provide the model elements." +
"\n\nThe service extension point is '" + EXTENSION_POINT_NAME + "'.";
......
......@@ -79,6 +79,8 @@ public class TransformationService extends ObjectAware2ServiceBase<ITransformati
"\n\nThis service manages registration and execution of transformations." +
"\nThis service can be asked to provide a transformation or a chain of transformations, which " +
"\ntransform an object of arbitrary class A into an object of another arbitrary class B." +
// TODO(VA) Would be nice to explain a little bit more about the way it put
// transformations together and about why a service is used for this
"\nTherefore transformations are not restricted to EObject instances, but extend to all Java classes." +
"\n\nThe service extension point is '" + EXTENSION_POINT_NAME + "'.";
}
......
......@@ -69,23 +69,29 @@ public final class TutorialService implements ITutorialService, CommandStackList
/** The collection of all defined tutorials. */
private Map<String, Map<String, Class<? extends ITutorialProvider>>> allTutorials =
new HashMap<>();
/** The collection of listeners. */
private Collection<ITutorialServiceListener> listeners =
new LinkedList<ITutorialServiceListener>();
/** The list of atomic steps. */
private List<TutorialAtomicStep> atomicStepList = new ArrayList<TutorialAtomicStep>();
/** The last element of the atomic step list, i.e., the final step. */
private TutorialAtomicStep finalAtomicStep;
/** The active tutorial. */
private ITutorialProvider activeTutorial = null;
/** The active tutorial step. */
private TutorialAtomicStep activeStep = null;
/** The active top-level element. */
private ITopLevelElement activeTopElement = null;
/** The persistency service. */
private IPersistencyService persistencyService;
/** The command stack service. */
private ICommandStackService commandStackService;
......@@ -112,6 +118,9 @@ public final class TutorialService implements ITutorialService, CommandStackList
"\n\nThis service manages tutorials, which can be registered via it." +
"\nThis service can be asked to start and to stop tutorials. It also provides information " +
"\nabout the currently active tutorial and the current tutorial step." +
// TODO(VA) Would be worth explaining more: what does it provide as a benefit for
// somebody developing a tutorial? (hiding information and so on) Why having a
// service for this?
"\nIt notifies interested listeners about progress and changes to the current step." +
"\nThis service provides access to prototypes constrained by the current step.";
}
......@@ -175,6 +184,7 @@ public final class TutorialService implements ITutorialService, CommandStackList
for(TutorialStepBase step : rootSteps) {
collectAtomicSteps(step);
}
// TODO(VA) get(0)
activeStep = atomicStepList.get(0);
finalAtomicStep = atomicStepList.get(atomicStepList.size() - 1);
EObject root = activeTutorial.getRootElement();
......@@ -252,6 +262,9 @@ public final class TutorialService implements ITutorialService, CommandStackList
TutorialStepBase inner = cmp.getSteps().get(cmp.getSteps().size() - 1);
return isCompletedStep(inner);
}
// TODO(VA) I guess the comment below means that this branch can only be about an atomic
// step. Would be nice to make it more explicit. Maybe just "Here the step can only be of
// type TutorialStepAtomic?
// TutorialStepAtomic
if(step == activeStep) {
return activeStep.getCompletionChecker().isTutorialStepComplete(
......@@ -270,6 +283,7 @@ public final class TutorialService implements ITutorialService, CommandStackList
TutorialStepBase inner = cmp.getSteps().get(cmp.getSteps().size() - 1);
return isEarlierThanActiveStep(inner);
}
// TODO(VA) Same as above
// TutorialStepAtomic
int current = atomicStepList.indexOf(activeStep);
int test = atomicStepList.indexOf(step);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment