Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDefineRequirementsLanguageHandler.java')
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDefineRequirementsLanguageHandler.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDefineRequirementsLanguageHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDefineRequirementsLanguageHandler.java
new file mode 100644
index 00000000000..38fa675e289
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDefineRequirementsLanguageHandler.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2015 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:
+ * Mauricio Alférez (mauricio.alferez@cea.fr) CEA LIST. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.req.sysml.assistant.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.InitDefineDomainSpecificRequirementsConceptsCommand;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Executes the creation of a requirements specific language
+ *
+ */
+public class InitDefineRequirementsLanguageHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ InitDefineDomainSpecificRequirementsConceptsCommand initDefineDomainSpecificRequirementsConceptsCommand = new InitDefineDomainSpecificRequirementsConceptsCommand(
+ transactionalEditingDomain, selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(initDefineDomainSpecificRequirementsConceptsCommand);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file

Back to the top