Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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