Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-02-11 02:48:20 +0000
committerGerrit Code Review @ Eclipse.org2016-02-12 15:31:41 +0000
commitecd4928b327f5561364c5068c9ff5f1668e92d13 (patch)
tree7c34f46cf82a1d65ac753fa92c2a5d55371b8dba /plugins/developer/org.eclipse.papyrus.infra.emf.commandstack
parent751a204d74e15eb2db6b41c937691fc56dcc1252 (diff)
downloadorg.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.tar.gz
org.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.tar.xz
org.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.zip
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220 Factor UI dependencies out of the UML Element Types bundle. This includes moving some advices that interact with the user into a new org.eclipse.papyrus.uml.service.types.ui bundle. Pull up the PasteCommandService and IPasteCommandProvider API into the Infra Diagram layer where the extension point is defined. Deprecate the old API in the UML layer. Introduce a service for participation of languages in CSS styling: * styling reset actions in the Reset Style command * access to semantic model classes and properties to make available to CSS Factor PapyrusObservableValue and cohorts out of the UML Tools bundle into the Infra Layer for more general reuse and to relieve the Diagram Infrastructure layer of UML dependencies. The old API remains as deprecated. Remove the Infra Diagram Layer dependency on UML Layer for property testers governing deletion in the diagram. Includes introduction of a new IGraphicalDeletionHelper OSGi service for delegation of the determination of whether an element can be deleted from the diagram and replacement of the XML expression properties * org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion * org.eclipse.papyrus.uml.diagram.common.isReadOnly by * org.eclipse.papyrus.infra.gmfdiag.common.isSemanticDeletion * org.eclipse.papyrus.infra.gmfdiag.common.canDelete (where the latter is the negation of the property that it supersedes) Extract UML dependencies from the Diagram Outline and CSS Editor bundles. Remove unused MDTUtil APIs that referenced a UML-specific annotation. Move the Diagram Infrastructure CSS Palette bundle into the UML layer because it serves to provide extensions on the Palette Service, which is an overtly UML-specific capability. All client APIs for the Properties View are moved from org.eclipse.papyrus.views.properties bundle to a new org.eclipse.papyrus.infra.properties.ui bundle. This includes renaming of: * extension points * label-provider contexts * XWT namespaces Add an "all UI tests" suite. Define a componentized hierarchical build layout of the main plug-ins Change-Id: I43f8f3644857a18b69715f5a2f1da9b1cf286d67
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.infra.emf.commandstack')
-rw-r--r--plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.classpath2
-rw-r--r--plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/META-INF/MANIFEST.MF40
-rw-r--r--plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/src/org/eclipse/papyrus/infra/emf/commandstack/view/CommandStackView.java80
4 files changed, 64 insertions, 64 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.classpath b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.classpath
index 64c5e31b7a2..eca7bdba8f0 100644
--- a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.classpath
+++ b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.settings/org.eclipse.jdt.core.prefs b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.settings/org.eclipse.jdt.core.prefs
index c585cc455ae..b3aa6d60f94 100644
--- a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/META-INF/MANIFEST.MF
index d0b8fcc5d6c..069e7c13fcc 100644
--- a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/META-INF/MANIFEST.MF
+++ b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/META-INF/MANIFEST.MF
@@ -1,20 +1,20 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.emf.edit;bundle-version="2.7.1",
- org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1",
- org.eclipse.emf.workspace;bundle-version="1.4.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0",
- org.eclipse.papyrus.emf.facet.common.ui;bundle-version="1.2.0"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.infra.emf.commandstack.Activator
-Bundle-Description: This plugin allows to show the command owned by the emf command stack
-Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.commandstack;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.edit;bundle-version="2.7.1",
+ org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
+ org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1",
+ org.eclipse.emf.workspace;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.emf.gmf;bundle-version="1.2.0",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.emf.facet.common.ui;bundle-version="1.2.0"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.2.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.emf.commandstack.Activator
+Bundle-Description: This plugin allows to show the command owned by the emf command stack
+Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.commandstack;singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/src/org/eclipse/papyrus/infra/emf/commandstack/view/CommandStackView.java b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/src/org/eclipse/papyrus/infra/emf/commandstack/view/CommandStackView.java
index 093c1a345a9..1a7c7c2c46a 100644
--- a/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/src/org/eclipse/papyrus/infra/emf/commandstack/view/CommandStackView.java
+++ b/plugins/developer/org.eclipse.papyrus.infra.emf.commandstack/src/org/eclipse/papyrus/infra/emf/commandstack/view/CommandStackView.java
@@ -23,7 +23,6 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
-import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.commands.operations.IOperationHistoryListener;
import org.eclipse.core.commands.operations.IUndoContext;
@@ -35,7 +34,6 @@ import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.workspace.EMFCommandOperation;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
import org.eclipse.gmf.runtime.emf.commands.core.command.EditingDomainUndoContext;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
@@ -43,9 +41,9 @@ import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.emf.facet.common.ui.internal.views.AbstractTreeView;
+import org.eclipse.papyrus.infra.emf.gmf.command.ICommandWrapper;
+import org.eclipse.papyrus.infra.emf.gmf.util.CommandUtils;
public class CommandStackView extends AbstractTreeView {
@@ -63,9 +61,10 @@ public class CommandStackView extends AbstractTreeView {
this.history = OperationHistoryFactory.getOperationHistory();
this.history.addOperationHistoryListener(historyListener = new IOperationHistoryListener() {
+ @Override
public void historyNotification(final OperationHistoryEvent event) {
- if(!CommandStackView.this.commandList.contains(event.getOperation())) {
- if(CommandStackView.this.commandList.size() == CommandStackView.this.maxSize) {
+ if (!CommandStackView.this.commandList.contains(event.getOperation())) {
+ if (CommandStackView.this.commandList.size() == CommandStackView.this.maxSize) {
IUndoableOperation removedOperation = CommandStackView.this.commandList.remove(CommandStackView.this.maxSize - 1);
dates.remove(removedOperation);
}
@@ -80,8 +79,8 @@ public class CommandStackView extends AbstractTreeView {
}
private boolean isValidUndoContext(IUndoableOperation operation) {
- for(IUndoContext undoContext : operation.getContexts()) {
- if(undoContext instanceof EditingDomainUndoContext) {
+ for (IUndoContext undoContext : operation.getContexts()) {
+ if (undoContext instanceof EditingDomainUndoContext) {
return true;
}
}
@@ -142,14 +141,7 @@ public class CommandStackView extends AbstractTreeView {
@Override
public String getText(final Object element) {
- if(element instanceof AbstractOperation) {
- return ((AbstractOperation)element).getLabel();
- } else if(element instanceof AbstractCommand) {
- return ((AbstractCommand)element).getLabel();
- } else if(element instanceof org.eclipse.gef.commands.Command) {
- return ((org.eclipse.gef.commands.Command)element).getLabel();
- }
- return "no managed";
+ return CommandUtils.getLabel(element);
}
};
createColumn("Name", "NAME_COLUMN_ID", 200, columnLabelProvider);
@@ -160,8 +152,8 @@ public class CommandStackView extends AbstractTreeView {
@Override
public String getText(final Object element) {
- if(element instanceof IUndoableOperation) {
- return Boolean.toString(isValidUndoContext((IUndoableOperation)element));
+ if (element instanceof IUndoableOperation) {
+ return Boolean.toString(isValidUndoContext((IUndoableOperation) element));
}
return "?";
}
@@ -174,8 +166,8 @@ public class CommandStackView extends AbstractTreeView {
@Override
public String getText(final Object element) {
- if(element instanceof AbstractCommand) {
- return ((AbstractCommand)element).getDescription();
+ if (element instanceof AbstractCommand) {
+ return ((AbstractCommand) element).getDescription();
}
return "no description";
}
@@ -188,7 +180,7 @@ public class CommandStackView extends AbstractTreeView {
@Override
public String getText(final Object element) {
- if(CommandStackView.this.dates.containsKey(element)) {
+ if (CommandStackView.this.dates.containsKey(element)) {
return CommandStackView.this.dates.get(element);
}
return "";
@@ -201,53 +193,61 @@ public class CommandStackView extends AbstractTreeView {
protected IContentProvider getContentProvider() {
return new ITreeContentProvider() {
+ @Override
public Object[] getElements(final Object inputElement) {
- if(inputElement instanceof Command) {
- return new Object[]{ inputElement };
- } else if(inputElement instanceof Collection<?>) {
- return ((Collection<?>)inputElement).toArray();
+ if (inputElement instanceof Command) {
+ return new Object[] { inputElement };
+ } else if (inputElement instanceof Collection<?>) {
+ return ((Collection<?>) inputElement).toArray();
}
return new Object[0];
}
+ @Override
public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
// nothing
}
+ @Override
public void dispose() {
// nothing
}
+ @Override
public boolean hasChildren(final Object element) {
return getChildren(element).length != 0;
}
+ @Override
public Object getParent(final Object element) {
return null;
}
+ @Override
public Object[] getChildren(final Object parentElement) {
- if(parentElement instanceof CompoundCommand) {
- return ((CompoundCommand)parentElement).getCommandList().toArray();
- } else if(parentElement instanceof CompositeCommand) {
+ if (parentElement instanceof CompoundCommand) {
+ return ((CompoundCommand) parentElement).getCommandList().toArray();
+ } else if (parentElement instanceof CompositeCommand) {
final List<Object> children = new ArrayList<Object>();
- final ListIterator<Object> iter = ((CompositeCommand)parentElement).listIterator();
- while(iter.hasNext()) {
+ final ListIterator<Object> iter = ((CompositeCommand) parentElement).listIterator();
+ while (iter.hasNext()) {
children.add(iter.next());
}
return children.toArray();
- } else if(parentElement instanceof EMFCommandOperation) {
+ } else if (parentElement instanceof EMFCommandOperation) {
final List<Object> children = new ArrayList<Object>();
- children.add(((EMFCommandOperation)parentElement).getCommand());
+ children.add(((EMFCommandOperation) parentElement).getCommand());
+ return children.toArray();
+ } else if (parentElement instanceof ICommandWrapper<?>) {
+ return new Object[] { ((ICommandWrapper<?>) parentElement).getWrappedCommand() };
+ } else if (CommandUtils.isCompound(parentElement)) {
+ final List<Object> children = new ArrayList<Object>();
+ for (Object next : CommandUtils.getChildren(parentElement)) {
+ children.add(next);
+ }
return children.toArray();
- } else if(parentElement instanceof GMFtoEMFCommandWrapper) {
- return new Object[]{ ((GMFtoEMFCommandWrapper)parentElement).getGMFCommand() };
- } else if(parentElement instanceof GEFtoEMFCommandWrapper) {
- return new Object[]{ ((GEFtoEMFCommandWrapper)parentElement).getGEFCommand() };
- } else if(parentElement instanceof CommandProxy) {
- return new Object[]{ ((CommandProxy)parentElement).getCommand() };
- } else if(parentElement instanceof org.eclipse.gef.commands.CompoundCommand) {
- return ((org.eclipse.gef.commands.CompoundCommand)parentElement).getChildren();
+ } else if (ICommandWrapper.isWrapper(parentElement, Object.class)) {
+ return new Object[] { ICommandWrapper.unwrap(parentElement, Object.class) };
}
return new Object[0];
}

Back to the top