diff options
author | Christian W. Damus | 2015-12-02 14:45:38 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2015-12-04 12:59:05 +0000 |
commit | f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438 (patch) | |
tree | 0e03fa04aaa10fd1c0c48028dec5a61b64bd06c9 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src | |
parent | 1f171bd0213d10d1d791f622e7ebf0b6484c40c5 (diff) | |
download | org.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.tar.gz org.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.tar.xz org.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.zip |
Bug 477384: [Canonical] Should not use drop requests to create views
https://bugs.eclipse.org/bugs/show_bug.cgi?id=477384
Changes to core APIs to remove PapyrusCanonicalEditPolicy's dependence
on the generated diagram drag-and-drop behavior:
* extract the CommonDiagramDragDropEditPolicy's abstract API for
information about diagram-specific view types into a new service
* update the canonical edit-policy and diagram-to-diagram
synchronization infrastructure to use the new VisualTypeService to
obtain information about the diagram's specific view types to then
let the view service create views without resorting to drop commands
* update extensions of various canonical strategies in the UML diagrams
to adapt to the new drop-free synchronization mechanism
Update the Papyrus Diagram GMFGen extensions and code generation
templates to add generation of the IVisualTypeProvider that plugs into
the new VisualTypeService to support canonical synchronization and
drag-and-drop.
Includes regeneration of the GMFGen extension model using EMF's most
recent templates, which result in minor changes to most model source
files.
Regenerate all UML diagrams to create and register the visual type
provider extensions. Also update the BREE for diagrams to 1.8 because
at least one of them requires Java 8 to compile properly.
* Note that the interaction overview diagram uses a code generator that
is not published on Eclipse.org, so I had to emulate the code
generation step for this one
* Note also that the SysML 1.1 diagrams likewise cannot be re-generated
but, moreover, they do not implement the common pattern for Visual ID
Registry, so they are also updated "by hand" for parity with the
Mars implementation of drag-and-drop (which had gaps)
Deprecate the ICreationTargetStrategy extension API which was only
needed to redirect drag-and-drop requests, but these are no longer
employed in the canonical synchronization.
Also some fixes for region layout problems in the State Machine Diagram:
* update custom creation edit policies to re-use the commands used by
drag-and-drop and untargeted creation that perform initial placement
of new regions
* fix the GMFGen to register the custom creation edit policy for the
state machine compartment
Change-Id: I3afc68d6f0f1bfe05e336c9138a7f1acbc8f643b
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/util/CommandTreeIterator.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/util/CommandTreeIterator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/util/CommandTreeIterator.java index 3e2637de3bd..9285142a88a 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/util/CommandTreeIterator.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/util/CommandTreeIterator.java @@ -44,7 +44,6 @@ public class CommandTreeIterator<C> implements Iterator<C> { private List<Iterator<?>> iterators = new ArrayList<Iterator<?>>(); private C preparedNext; - private boolean done; private CommandTreeIterator(Object root, Class<C> type) { super(); @@ -56,7 +55,7 @@ public class CommandTreeIterator<C> implements Iterator<C> { if (isCompound(root)) { pushIterator(root); } else { - done = !prepareNext(root); + prepareNext(root); } } @@ -99,7 +98,6 @@ public class CommandTreeIterator<C> implements Iterator<C> { private Iterator<?> popIterator() { if (iterators.isEmpty()) { current = null; - done = true; } else { current = iterators.remove(iterators.size() - 1); } @@ -128,8 +126,12 @@ public class CommandTreeIterator<C> implements Iterator<C> { return result; } + boolean isDone() { + return (current == null) && iterators.isEmpty(); + } + public boolean hasNext() { - while (!done && (preparedNext == null)) { + while (!isDone() && (preparedNext == null)) { Object next = internalNext(); if (type.isInstance(next)) { preparedNext = type.cast(next); |