Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-01-23 11:34:45 -0500
committerGerrit Code Review @ Eclipse.org2015-01-23 11:34:45 -0500
commit4671c0502e943fae700d7fe791513d1b4de0b607 (patch)
tree0422c1a9a02e2a027e56edb9d170fc21836cf2f3 /plugins
parent7090c04ef174d67b2c46379bd28e3ec5e07fb0f1 (diff)
parent152f0e113a6cb047d8fe8807639aa2ed20424c08 (diff)
downloadorg.eclipse.papyrus-4671c0502e943fae700d7fe791513d1b4de0b607.tar.gz
org.eclipse.papyrus-4671c0502e943fae700d7fe791513d1b4de0b607.tar.xz
org.eclipse.papyrus-4671c0502e943fae700d7fe791513d1b4de0b607.zip
Merge "455305: [Performances] Copy/Cut/Paste commands show severe performance degradation https://bugs.eclipse.org/bugs/show_bug.cgi?id=455305"last/org.eclipse.papyrus.efacet
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java15
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CutInDiagramHandler.java15
2 files changed, 10 insertions, 20 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java
index 122c3928ce9..29a66c53b01 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java
@@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISources;
/**
@@ -55,16 +56,10 @@ import org.eclipse.swt.widgets.Text;
public class CopyInDiagramHandler extends AbstractGraphicalCommandHandler {
/** The Constant COPY_COMMAND_LABEL. */
- private static final String COPY_COMMAND_LABEL = "Copy In Diagram"; //$NON-NLS-1$
-
- /** The Constant ACTIVE_SHELL_VARIABLE_KEY. */
- private static final String ACTIVE_SHELL_VARIABLE_KEY = "activeShell"; //$NON-NLS-1$
-
- /** The Constant ACTIVE_FOCUS_VARIABLE_KEY. */
- private static final String ACTIVE_FOCUS_VARIABLE_KEY = "activeFocusControl"; //$NON-NLS-1$
+ private static final String COPY_COMMAND_LABEL = "Copy In Diagram";
/** The Constant COPY_IMAGE_COMMAND_LABEL. */
- private static final String COPY_IMAGE_COMMAND_LABEL = "Create image to allow paste on system"; //$NON-NLS-1$
+ private static final String COPY_IMAGE_COMMAND_LABEL = "Create image to allow paste on system";
/** The active focus control. */
private Object activeFocusControl = null;
@@ -142,8 +137,8 @@ public class CopyInDiagramHandler extends AbstractGraphicalCommandHandler {
// Local handling
if (evaluationContext instanceof IEvaluationContext) {
IEvaluationContext iEvaluationContext = (IEvaluationContext) evaluationContext;
- activeFocusControl = iEvaluationContext.getVariable(ACTIVE_FOCUS_VARIABLE_KEY);
- activeShell = iEvaluationContext.getVariable(ACTIVE_SHELL_VARIABLE_KEY);
+ activeFocusControl = iEvaluationContext.getVariable(ISources.ACTIVE_FOCUS_CONTROL_NAME);
+ activeShell = iEvaluationContext.getVariable(ISources.ACTIVE_SHELL_NAME);
}
// Parent handling
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CutInDiagramHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CutInDiagramHandler.java
index 492bee3b170..402595a293c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CutInDiagramHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/CutInDiagramHandler.java
@@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISources;
/**
* Handler for the Cut Action in Diagram : it's a copy followed by a delete
@@ -42,16 +43,10 @@ import org.eclipse.swt.widgets.Text;
public class CutInDiagramHandler extends AbstractGraphicalCommandHandler {
/** The Constant DELETE_COMMAND_LABEL. */
- private static final String DELETE_COMMAND_LABEL = "Delete From Model"; //$NON-NLS-1$
+ private static final String DELETE_COMMAND_LABEL = "Delete From Model";
/** The Constant CUT_COMMAND_LABEL. */
- private static final String CUT_COMMAND_LABEL = "Cut In Diagram Command"; //$NON-NLS-1$
-
- /** The Constant ACTIVE_SHELL. */
- private static final String ACTIVE_SHELL = "activeShell"; //$NON-NLS-1$
-
- /** The Constant ACTIVE_FOCUS_CONTROL. */
- private static final String ACTIVE_FOCUS_CONTROL = "activeFocusControl"; //$NON-NLS-1$
+ private static final String CUT_COMMAND_LABEL = "Cut In Diagram Command";
/** The active focus control. */
private Object activeFocusControl;
@@ -123,8 +118,8 @@ public class CutInDiagramHandler extends AbstractGraphicalCommandHandler {
public void setEnabled(Object evaluationContext) {
if (evaluationContext instanceof IEvaluationContext) {
IEvaluationContext iEvaluationContext = (IEvaluationContext) evaluationContext;
- activeFocusControl = iEvaluationContext.getVariable(ACTIVE_FOCUS_CONTROL);
- activeShell = iEvaluationContext.getVariable(ACTIVE_SHELL);
+ activeFocusControl = iEvaluationContext.getVariable(ISources.ACTIVE_FOCUS_CONTROL_NAME);
+ activeShell = iEvaluationContext.getVariable(ISources.ACTIVE_SHELL_NAME);
}

Back to the top