Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java45
6 files changed, 206 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java
new file mode 100644
index 00000000000..3cdd66195d7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetAttribute}
+ */
+public class EditFacetAttributeHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetAttribute.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetAttributeDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java
new file mode 100644
index 00000000000..b32023cf797
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link Facet}
+ */
+public class EditFacetHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return Facet.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java
new file mode 100644
index 00000000000..7478fe4a700
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetOperation}
+ */
+public class EditFacetOperationHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetOperation.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetOperationDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java
new file mode 100644
index 00000000000..319b18e038b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link EParameter}
+ */
+public class EditFacetOperationParameterHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return EParameter.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE
+ .openEditFacetOperationParameterDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java
new file mode 100644
index 00000000000..f1556e0009d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetReference}
+ */
+public class EditFacetReferenceHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetReference.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetReferenceDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java
new file mode 100644
index 00000000000..c0b6bd5028f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.handler.HandlerUtils;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+public class EditFacetSetHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ public boolean isEnabled() {
+ boolean isEnabled = false;
+ final IStructuredSelection selection = HandlerUtils
+ .getStructuredSelection();
+ if (selection != null) {
+ final FacetSet facetSet = (FacetSet) HandlerUtils
+ .getStructuredSelection().getFirstElement();
+ isEnabled = facetSet.eContainer() != null;
+ }
+ return isEnabled && super.isEnabled();
+ }
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetSet.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetSetDialog();
+ }
+}

Back to the top