From 152f0e113a6cb047d8fe8807639aa2ed20424c08 Mon Sep 17 00:00:00 2001 From: Gabriel Pascual Date: Wed, 17 Dec 2014 18:22:33 +0100 Subject: 455305: [Performances] Copy/Cut/Paste commands show severe performance degradation https://bugs.eclipse.org/bugs/show_bug.cgi?id=455305 - Fix minor issues Change-Id: I13a9714492ab42fe9361bffb128cec4f180ffc7f Signed-off-by: Gabriel Pascual --- .../infra/gmfdiag/menu/handlers/CopyInDiagramHandler.java | 15 +++++---------- .../infra/gmfdiag/menu/handlers/CutInDiagramHandler.java | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) (limited to 'plugins') 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); } -- cgit v1.2.3