Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-04-13 08:24:39 +0000
committercletavernie2012-04-13 08:24:39 +0000
commit569f8205f13309150b82d0bdb02d628f376b5185 (patch)
tree0b157851e11d2d358e939b4585a244e2d298195d /sandbox
parent527594d23b82b82c48766ef4db9ac57c25097285 (diff)
downloadorg.eclipse.papyrus-569f8205f13309150b82d0bdb02d628f376b5185.tar.gz
org.eclipse.papyrus-569f8205f13309150b82d0bdb02d628f376b5185.tar.xz
org.eclipse.papyrus-569f8205f13309150b82d0bdb02d628f376b5185.zip
Upgrade sandbox plug-in to 0.9
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.emf.commandstack/META-INF/MANIFEST.MF7
-rw-r--r--sandbox/org.eclipse.papyrus.emf.commandstack/src/org/eclipse/papyrus/emf/commandstack/view/CommandStackView.java88
2 files changed, 40 insertions, 55 deletions
diff --git a/sandbox/org.eclipse.papyrus.emf.commandstack/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.emf.commandstack/META-INF/MANIFEST.MF
index 03e6b741cc6..9abb32bee4c 100644
--- a/sandbox/org.eclipse.papyrus.emf.commandstack/META-INF/MANIFEST.MF
+++ b/sandbox/org.eclipse.papyrus.emf.commandstack/META-INF/MANIFEST.MF
@@ -9,10 +9,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.emf.facet.common.ui,
org.eclipse.emf.edit;bundle-version="2.7.1",
- org.eclipse.papyrus.sasheditor;bundle-version="0.8.2",
- org.eclipse.papyrus.core;bundle-version="0.8.2"
+ org.eclipse.papyrus.infra.core;bundle-version="0.9.0",
+ org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1",
+ org.eclipse.emf.workspace;bundle-version="1.4.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.papyrus.core,
- org.eclipse.papyrus.core.editor
Bundle-Localization: plugin
diff --git a/sandbox/org.eclipse.papyrus.emf.commandstack/src/org/eclipse/papyrus/emf/commandstack/view/CommandStackView.java b/sandbox/org.eclipse.papyrus.emf.commandstack/src/org/eclipse/papyrus/emf/commandstack/view/CommandStackView.java
index aab36f2c6ad..99c67dd73a8 100644
--- a/sandbox/org.eclipse.papyrus.emf.commandstack/src/org/eclipse/papyrus/emf/commandstack/view/CommandStackView.java
+++ b/sandbox/org.eclipse.papyrus.emf.commandstack/src/org/eclipse/papyrus/emf/commandstack/view/CommandStackView.java
@@ -32,7 +32,6 @@ import org.eclipse.core.commands.operations.OperationHistoryFactory;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.facet.common.ui.internal.views.AbstractTreeView;
import org.eclipse.emf.workspace.EMFCommandOperation;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
@@ -55,30 +54,22 @@ public class CommandStackView extends AbstractTreeView {
public CommandStackView() {
this.history = OperationHistoryFactory.getOperationHistory();
- this.history
- .addOperationHistoryListener(new IOperationHistoryListener() {
-
- public void historyNotification(
- final OperationHistoryEvent event) {
- if (!CommandStackView.this.commandList.contains(event
- .getOperation())) {
- if (CommandStackView.this.commandList.size() == CommandStackView.this.maxSize) {
- CommandStackView.this.commandList
- .remove(CommandStackView.this.maxSize - 1);
- }
- CommandStackView.this.commandList.add(0,
- event.getOperation());
- final DateFormat dateFormat = new SimpleDateFormat(
- "HH:mm:ss");
- final Calendar cal = Calendar.getInstance();
- CommandStackView.this.dates.put(
- event.getOperation(),
- dateFormat.format(cal.getTime()));
- refresh(true);
- }
+ this.history.addOperationHistoryListener(new IOperationHistoryListener() {
+ public void historyNotification(final OperationHistoryEvent event) {
+ if(!CommandStackView.this.commandList.contains(event.getOperation())) {
+ if(CommandStackView.this.commandList.size() == CommandStackView.this.maxSize) {
+ CommandStackView.this.commandList.remove(CommandStackView.this.maxSize - 1);
}
- });
+ CommandStackView.this.commandList.add(0, event.getOperation());
+ final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
+ final Calendar cal = Calendar.getInstance();
+ CommandStackView.this.dates.put(event.getOperation(), dateFormat.format(cal.getTime()));
+ refresh(true);
+ }
+
+ }
+ });
};
@Override
@@ -87,14 +78,13 @@ public class CommandStackView extends AbstractTreeView {
createDescriptionColumn();
createCommandTypeColumn();
createTimeColumn();
-
+
}
@Override
public void createPartControl(final org.eclipse.swt.widgets.Composite parent) {
super.createPartControl(parent);
- final IToolBarManager tbm = getViewSite().getActionBars()
- .getToolBarManager();
+ final IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
tbm.add(new Action() {
@Override
@@ -137,10 +127,10 @@ 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();
+ if(element instanceof AbstractOperation) {
+ return ((AbstractOperation)element).getLabel();
+ } else if(element instanceof AbstractCommand) {
+ return ((AbstractCommand)element).getLabel();
}
return "no managed";
}
@@ -148,27 +138,27 @@ public class CommandStackView extends AbstractTreeView {
createColumn("Name", "NAME_COLUMN_ID", 200, columnLabelProvider);
}
-
+
protected void createDescriptionColumn() {
final ColumnLabelProvider columnLabelProvider = new ColumnLabelProvider() {
@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";
}
};
createColumn("Description", "DESCRIPTION_COLUMN_ID", 200, columnLabelProvider);
}
-
+
protected void createTimeColumn() {
final ColumnLabelProvider columnLabelProvider = new ColumnLabelProvider() {
@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 "";
@@ -182,17 +172,16 @@ public class CommandStackView extends AbstractTreeView {
return new ITreeContentProvider() {
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];
}
- public void inputChanged(final Viewer viewer,
- final Object oldInput, final Object newInput) {
+ public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
// nothing
}
@@ -209,21 +198,18 @@ public class CommandStackView extends AbstractTreeView {
}
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();
}
return new Object[0];

Back to the top