Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/qompass/designer/debug/handlers/ResetAcceleoHandler.java')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/qompass/designer/debug/handlers/ResetAcceleoHandler.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/qompass/designer/debug/handlers/ResetAcceleoHandler.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/qompass/designer/debug/handlers/ResetAcceleoHandler.java
new file mode 100644
index 00000000000..f11260ead65
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/qompass/designer/debug/handlers/ResetAcceleoHandler.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.qompass.designer.debug.handlers;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.acceleo.AcceleoDriver;
+import org.eclipse.papyrus.acceleo.ui.handlers.CmdHandler;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+
+public class ResetAcceleoHandler extends CmdHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isEnabled() {
+ updateSelectedEObject();
+ if(selectedEObject instanceof Element) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ if(selectedEObject instanceof NamedElement) {
+ AcceleoDriver.init();
+ }
+ return null;
+ }
+}

Back to the top