Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/editor/actions/ToggleDataContextAction.java')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/editor/actions/ToggleDataContextAction.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/editor/actions/ToggleDataContextAction.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/editor/actions/ToggleDataContextAction.java
new file mode 100644
index 00000000000..d61dfeb6f5b
--- /dev/null
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/editor/actions/ToggleDataContextAction.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.views.properties.toolsmiths.editor.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.views.properties.toolsmiths.editor.UIEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * An action to toggle the display of the DataContextElements in the UIEditor
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class ToggleDataContextAction extends AbstractHandler {
+
+ /**
+ * Indicates if the DataContextElements should be displayed
+ */
+ public static boolean showDataContext = false;
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ showDataContext = !showDataContext;
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (editor instanceof UIEditor) {
+ UIEditor uiEditor = (UIEditor) editor;
+ uiEditor.getViewer().refresh();
+ }
+
+ // State state = event.getCommand().getState("org.eclipse.papyrus.customization.properties.displayContextState"); //$NON-NLS-1$
+ // state.setValue(showDataContext);
+ return null;
+ }
+
+}

Back to the top