diff options
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet')
108 files changed, 8738 insertions, 8738 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java index d6466f8e94a..a59014f17d8 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java @@ -1,129 +1,129 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.dialog;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.FacetDialogFactoryImpl;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.SynchronizedFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Interface for the dialogs creation factory.
- *
- * @see FacetDialogFactoryImpl
- *
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IFacetDialogFactory {
-
- /**
- * Return a new instance of the concrete implementation of this interface.
- */
- IFacetDialogFactory INSTANCE = new SynchronizedFacetDialogFactory(
- new FacetDialogFactoryImpl(), Display.getDefault());
-
- /**
- * Create an new Dialog for the creation of a FacetSet in a FacetSet.
- *
- * @return the dialog.
- */
- IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog();
-
- /**
- * Create an new Dialog for the creation of a Facet in a FacetSet.
- *
- * @return the dialog.
- */
- IDialog<IFacetWidget> openCreateFacetInFacetSetDialog();
-
- /**
- * Create an new Dialog for the creation of an Attribute in a Facet.
- *
- * @return the dialog.
- */
- IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog();
-
- /**
- * Create an new Dialog for the creation of an Reference in a Facet.
- *
- * @return the dialog.
- */
- IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog();
-
- /**
- * Create an new Dialog for the creation of an Operation in a Facet.
- *
- * @return the dialog.
- */
- IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog();
-
- /**
- * Create an new Dialog for the creation of a Parameter in an Operation.
- *
- * @return the dialog.
- */
- IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog();
-
- /**
- * Create an new Dialog for the edition of a FacetSet.
- *
- * @return the dialog.
- */
- IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog();
-
- /**
- * Create an new Dialog for the edition of a Facet.
- *
- * @return the dialog.
- */
- IDialog<IFacetWidget> openEditFacetDialog();
-
- /**
- * Create an new Dialog for the edition of an Attribute.
- *
- * @return the dialog.
- */
- IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog();
-
- /**
- * Create an new Dialog for the edition of an Reference.
- *
- * @return the dialog.
- */
- IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog();
-
- /**
- * Create an new Dialog for the edition of an Operation.
- *
- * @return the dialog.
- */
- IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog();
-
- /**
- * Create an new Dialog for the edition of a Parameter.
- *
- * @return the dialog.
- */
- IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog();
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.dialog; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.FacetDialogFactoryImpl; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.SynchronizedFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.swt.widgets.Display; + +/** + * Interface for the dialogs creation factory. + * + * @see FacetDialogFactoryImpl + * + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IFacetDialogFactory { + + /** + * Return a new instance of the concrete implementation of this interface. + */ + IFacetDialogFactory INSTANCE = new SynchronizedFacetDialogFactory( + new FacetDialogFactoryImpl(), Display.getDefault()); + + /** + * Create an new Dialog for the creation of a FacetSet in a FacetSet. + * + * @return the dialog. + */ + IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog(); + + /** + * Create an new Dialog for the creation of a Facet in a FacetSet. + * + * @return the dialog. + */ + IDialog<IFacetWidget> openCreateFacetInFacetSetDialog(); + + /** + * Create an new Dialog for the creation of an Attribute in a Facet. + * + * @return the dialog. + */ + IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog(); + + /** + * Create an new Dialog for the creation of an Reference in a Facet. + * + * @return the dialog. + */ + IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog(); + + /** + * Create an new Dialog for the creation of an Operation in a Facet. + * + * @return the dialog. + */ + IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog(); + + /** + * Create an new Dialog for the creation of a Parameter in an Operation. + * + * @return the dialog. + */ + IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog(); + + /** + * Create an new Dialog for the edition of a FacetSet. + * + * @return the dialog. + */ + IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog(); + + /** + * Create an new Dialog for the edition of a Facet. + * + * @return the dialog. + */ + IDialog<IFacetWidget> openEditFacetDialog(); + + /** + * Create an new Dialog for the edition of an Attribute. + * + * @return the dialog. + */ + IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog(); + + /** + * Create an new Dialog for the edition of an Reference. + * + * @return the dialog. + */ + IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog(); + + /** + * Create an new Dialog for the edition of an Operation. + * + * @return the dialog. + */ + IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog(); + + /** + * Create an new Dialog for the edition of a Parameter. + * + * @return the dialog. + */ + IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog(); + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java index fd78563c4fe..c2e975018cb 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java @@ -1,51 +1,51 @@ -/**
- * Copyright (c) 2012 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:
- * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-// Copied from org.eclipse.papyrus.emf.facet.aggregate.metamodel.notgenerated.internal.Activator
-@SuppressWarnings("PMD.UseSingleton")
-// @SuppressWarnings("PMD.UseSingleton") We cannot conforms to this rule because
-// this class is an Eclipse plug-in activator which will be instantiated by the
-// Eclipse framework.
-public class Activator extends Plugin {
-
- private static Activator plugin;
-
- @Override
- @SuppressWarnings("PMD.SignatureDeclareThrowsException")
- // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use
- // this signature because this is an override of an Eclipse framework's
- // method.
- public void start(final BundleContext bundleContext) throws Exception {
- super.start(bundleContext);
- Activator.plugin = this;
- }
-
- @Override
- @SuppressWarnings("PMD.SignatureDeclareThrowsException")
- // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use
- // this signature because this is an override of an Eclipse framework's
- // method.
- public void stop(final BundleContext bundleContext) throws Exception {
- // NOPMD: PMD say "Assigning an Object to null is a code smell."
- // No choice to right it in another way : this is an Eclipse pattern.
- Activator.plugin = null; // NOPMD by gdupe on 30/03/12 10:19
- super.stop(bundleContext);
- }
-
- public static Plugin getDefault() {
- return Activator.plugin;
- }
-
-}
+/** + * Copyright (c) 2012 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: + * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal; + +import org.eclipse.core.runtime.Plugin; +import org.osgi.framework.BundleContext; + +// Copied from org.eclipse.papyrus.emf.facet.aggregate.metamodel.notgenerated.internal.Activator +@SuppressWarnings("PMD.UseSingleton") +// @SuppressWarnings("PMD.UseSingleton") We cannot conforms to this rule because +// this class is an Eclipse plug-in activator which will be instantiated by the +// Eclipse framework. +public class Activator extends Plugin { + + private static Activator plugin; + + @Override + @SuppressWarnings("PMD.SignatureDeclareThrowsException") + // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use + // this signature because this is an override of an Eclipse framework's + // method. + public void start(final BundleContext bundleContext) throws Exception { + super.start(bundleContext); + Activator.plugin = this; + } + + @Override + @SuppressWarnings("PMD.SignatureDeclareThrowsException") + // @SuppressWarnings("PMD.SignatureDeclareThrowsException") We have to use + // this signature because this is an override of an Eclipse framework's + // method. + public void stop(final BundleContext bundleContext) throws Exception { + // NOPMD: PMD say "Assigning an Object to null is a code smell." + // No choice to right it in another way : this is an Eclipse pattern. + Activator.plugin = null; // NOPMD by gdupe on 30/03/12 10:19 + super.stop(bundleContext); + } + + public static Plugin getDefault() { + return Activator.plugin; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java index 0d9c696f63f..1c8e37c8a22 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java @@ -1,224 +1,224 @@ -/**
- * Copyright (c) 2011, 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:
- * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
- * Nicolas Bros (Mia-Software) - Bug 370442 - rewrite the Facet loading dialog for v0.2
- * Grégoire Dupé (Mia-Software) - copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages
- * Nicolas Bros (Mia-Software) - copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages
- * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- * Nicolas Bros (Mia-Software) - Bug 372865 - FacetSet selection dialog
- * Vincent Lorenzo (CEA-LIST) - Bug 357621 - Improve the label displayed for Customization and Facets
- * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.messages"; //$NON-NLS-1$
-
- public static String New;
-
- public static String Enter_a_nsUri;
- public static String Please_enter_nsUri;
-
- public static String Enter_a_prefix;
- public static String ETypedElementSelectionControl_ClassicView;
-
- public static String ETypedElementSelectionControl_invalidSelectionAtLeastOneElement;
- public static String ETypedElementSelectionControl_invalidSelection;
- public static String ETypedElementSelectionControl_invalidSelectionAtMostXElements;
- public static String ETypedElementSelectionControl_invalidSelectionETypedElementsOnly;
- public static String ETypedElementSelectionDialog_dialogTitle;
- public static String ETypedElementSelectionDialog_dialogTitleMultiSelection;
- public static String ETypedElementSelectionDialog_radioButtonMultiSelection;
- public static String ETypedElementSelectionDialog_radioButtonNoSelection;
- public static String ETypedElementSelectionDialog_radioButtonSingleSelection;
-
- public static String ETypedElementSelectionSortedControl_metamodelView;
-
- public static String ETypedElementSelectionSortedControl_toolTip;
-
- public static String Please_enter_prefix;
-
- public static String Please_select_EPackage;
- public static String Select_EPackage;
-
- public static String Select_ETypedElement;
-
- public static String Select_query_type;
-
- public static String Operation;
- public static String Parameter_name;
- public static String Operation_name;
- public static String Reference_name;
- public static String Attribute_name;
-
- public static String Add_an_Attribute;
- public static String Add_an_Attribute_desc;
- public static String Add_a_Reference;
- public static String Add_a_Reference_desc;
- public static String Add_an_Operation;
- public static String Add_an_Operation_desc;
- public static String Add_an_Operation_Parameter;
- public static String Add_an_Operation_Parameter_desc;
-
- public static String FacetSet;
- public static String FacetSet_mustSelectFacetSet;
- public static String FacetSet_mustGiveFacetSetName;
- public static String FacetSetsCatalogView_categoriesColumn;
- public static String FacetSetsCatalogView_documentationColumn;
- public static String FacetSetsCatalogView_extendsColumn;
- public static String FacetSetsCatalogView_nameColumn;
- public static String FacetSetsCatalogView_viewTitle;
- public static String FacetSetSelectionControl_mustSelectAtLeastOneElement;
- public static String FacetSetSelectionControl_mustSelectAtMostNElements;
- public static String FacetSetSelectionControl_onlyFacetSetsAllowedInSelection;
- public static String FacetSetSelectionControl_selectionContainsInvalidElements;
- public static String FacetSetSelectionDialog_deselectAll;
- public static String FacetSetSelectionDialog_selectAll;
- public static String FacetSetSelectionDialog_titleSelectFacetSet;
- public static String FacetSetSelectionDialog_titleSelectFacetSets;
- public static String Facet;
- public static String Facet_mustGiveFacetName;
- public static String Facet_mustGiveReferenceName;
- public static String Facet_mustGiveOperationName;
- public static String Facet_mustGivePrameterName;
- public static String Facet_mustSelectQuery;
- public static String Facet_mustSelectConformanceType;
-
- public static String GetOrCreate_FacetSet_message;
- public static String GetOrCreate_Facet_message;
- public static String Select_FacetSet;
- public static String Select_Facet;
- public static String GetOrCreate_Operation_message;
- public static String Select_Operation;
- public static String Facet_mustSelectFacet;
- public static String Facet_mustGiveAttributeName;
- public static String Type_mustSelectType;
- public static String Operation_mustSelectOperation;
-
- public static String Changeable;
- public static String Derived;
- public static String Ordered;
- public static String Transient;
- public static String Unique;
- public static String Volatile;
-
- public static String Lower_bound;
- public static String Upper_bound;
-
- public static String Select_EClass;
- public static String Select_EClassifier;
- public static String Select_EDataType;
-
- public static String No_result_found;
-
- public static String Select;
- public static String Type;
-
- public static String Create_FacetSet_Model;
-
- public static String CreateFacetInFacetSetWidget_FacetSetName;
-
- public static String CreateFacetInFacetSetWizardPage_could_not_find_wizard_page;
- public static String Please_enter_value_for;
- public static String Create_facet_in_facetSet;
- public static String Create_facetSet_in_facetSet;
-
- public static String Create;
- public static String CreateFacetInFacetSetWizardPage_Please_fill_extendedMetaClass;
- public static String CreateFacetInFacetSetWizardPage_Sub_Typing_Facet;
- public static String CreateFacetInFacetSetWizardPage_wizard_description;
- public static String CreateFacetSetWizardImpl_Create_new_facet_Set;
- public static String CreateFacetSetWizardImpl_FacetModel;
- public static String CreateFacetSetWizardImpl_File_extension_restriction;
-
- public static String CreateFacetSetWizardPage_Not_a_Plugin_project;
- public static String Create_Query;
- public static String FilteredElementSelectionControl_type_filter_text;
- public static String Load_MetaModel_Resource;
- public static String FacetSetSelectionDialog_selectFacetSetsMessage;
- public static String FacetSetSelectionDialog_selectFacetSetsTitle;
- public static String Package_Selection;
- public static String Select_Registered_URI;
-
- public static String SelectQueryTypeWizardPage_No_wizard_found;
- public static String SelectQueryTypeWizardPage_Query_Type;
- public static String JavaQueryWizardPage_Can_be_cached;
- public static String JavaQueryWizardPage_has_side_effect;
- public static String JavaQueryWizardPage_Query_name;
- public static String Query_Select_Name_And_Type;
-
- // Begin copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages
- public static String Query_name;
- public static String QueryExecutionView_0;
- public static String QueryExecutionView_1;
- public static String QueryExecutionView_classpathWarning;
- public static String QueryExecutionView_errorInBundleClasspath;
- public static String QueryExecutionView_execEnvNotAvailable;
- public static String QueryExecutionView_execEnvError;
- public static String QueryExecutionView_Context;
- public static String QueryExecutionView_DisplayResultIn;
- public static String QueryExecutionView_dragAndDropHint;
- public static String QueryExecutionView_ErrorExecutingQuery;
-
- public static String QueryExecutionView_ETypeElementsGroup;
- public static String QueryExecutionView_ExecuteButton;
- public static String QueryExecutionView_ExecuteGroup;
- public static String QueryExecutionView_NoQueryDisplayer;
- public static String QueryExecutionView_NoQuerySelected;
- public static String QueryExecutionView_NullQueryResult;
- public static String QueryExecutionView_notImplementedYet;
- public static String QueryExecutionView_Parameters;
- public static String QueryExecutionView_Query;
- public static String QueryExecutionView_QueryException;
- public static String QueryExecutionView_QueryReturnedNull;
- public static String QueryExecutionView_SelectQueryToExecute;
- public static String QuerySelectionDialog_createQuery;
- public static String QuerySelectionDialog_enableQuery;
- public static String QuerySelectionDialog_refreshQuerySetsJob;
- public static String QuerySelectionDialog_selectQuery;
-
- public static String Query_Query_Name;
- public static String Query_has_side_effect;
- public static String Query_Can_be_cached;
-
- public static String Metaclass_mustSelectMetaclass;
- public static String ExtendedMetaClass;
-
- // End copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages
-
- // Edition
- public static String Edit_FacetSet;
- public static String Edit_Facet;
- public static String Edit_FacetAttribute;
- public static String Edit_FacetReference;
- public static String Edit_FacetOperation;
- public static String Edit_FacetOperationParameter;
-
- public static String EditFacetSetWidget_FacetSetName;
-
- public static String EditFacetWidget_FacetName;
-
- public static String GetSubTypingType_message;
- public static String GetSubTypingType_title;
-
- public static String FacetSetPropertyWizardPage_facet_properties;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+/** + * Copyright (c) 2011, 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: + * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor + * Nicolas Bros (Mia-Software) - Bug 370442 - rewrite the Facet loading dialog for v0.2 + * Grégoire Dupé (Mia-Software) - copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages + * Nicolas Bros (Mia-Software) - copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages + * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet. + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + * Nicolas Bros (Mia-Software) - Bug 372865 - FacetSet selection dialog + * Vincent Lorenzo (CEA-LIST) - Bug 357621 - Improve the label displayed for Customization and Facets + * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.messages"; //$NON-NLS-1$ + + public static String New; + + public static String Enter_a_nsUri; + public static String Please_enter_nsUri; + + public static String Enter_a_prefix; + public static String ETypedElementSelectionControl_ClassicView; + + public static String ETypedElementSelectionControl_invalidSelectionAtLeastOneElement; + public static String ETypedElementSelectionControl_invalidSelection; + public static String ETypedElementSelectionControl_invalidSelectionAtMostXElements; + public static String ETypedElementSelectionControl_invalidSelectionETypedElementsOnly; + public static String ETypedElementSelectionDialog_dialogTitle; + public static String ETypedElementSelectionDialog_dialogTitleMultiSelection; + public static String ETypedElementSelectionDialog_radioButtonMultiSelection; + public static String ETypedElementSelectionDialog_radioButtonNoSelection; + public static String ETypedElementSelectionDialog_radioButtonSingleSelection; + + public static String ETypedElementSelectionSortedControl_metamodelView; + + public static String ETypedElementSelectionSortedControl_toolTip; + + public static String Please_enter_prefix; + + public static String Please_select_EPackage; + public static String Select_EPackage; + + public static String Select_ETypedElement; + + public static String Select_query_type; + + public static String Operation; + public static String Parameter_name; + public static String Operation_name; + public static String Reference_name; + public static String Attribute_name; + + public static String Add_an_Attribute; + public static String Add_an_Attribute_desc; + public static String Add_a_Reference; + public static String Add_a_Reference_desc; + public static String Add_an_Operation; + public static String Add_an_Operation_desc; + public static String Add_an_Operation_Parameter; + public static String Add_an_Operation_Parameter_desc; + + public static String FacetSet; + public static String FacetSet_mustSelectFacetSet; + public static String FacetSet_mustGiveFacetSetName; + public static String FacetSetsCatalogView_categoriesColumn; + public static String FacetSetsCatalogView_documentationColumn; + public static String FacetSetsCatalogView_extendsColumn; + public static String FacetSetsCatalogView_nameColumn; + public static String FacetSetsCatalogView_viewTitle; + public static String FacetSetSelectionControl_mustSelectAtLeastOneElement; + public static String FacetSetSelectionControl_mustSelectAtMostNElements; + public static String FacetSetSelectionControl_onlyFacetSetsAllowedInSelection; + public static String FacetSetSelectionControl_selectionContainsInvalidElements; + public static String FacetSetSelectionDialog_deselectAll; + public static String FacetSetSelectionDialog_selectAll; + public static String FacetSetSelectionDialog_titleSelectFacetSet; + public static String FacetSetSelectionDialog_titleSelectFacetSets; + public static String Facet; + public static String Facet_mustGiveFacetName; + public static String Facet_mustGiveReferenceName; + public static String Facet_mustGiveOperationName; + public static String Facet_mustGivePrameterName; + public static String Facet_mustSelectQuery; + public static String Facet_mustSelectConformanceType; + + public static String GetOrCreate_FacetSet_message; + public static String GetOrCreate_Facet_message; + public static String Select_FacetSet; + public static String Select_Facet; + public static String GetOrCreate_Operation_message; + public static String Select_Operation; + public static String Facet_mustSelectFacet; + public static String Facet_mustGiveAttributeName; + public static String Type_mustSelectType; + public static String Operation_mustSelectOperation; + + public static String Changeable; + public static String Derived; + public static String Ordered; + public static String Transient; + public static String Unique; + public static String Volatile; + + public static String Lower_bound; + public static String Upper_bound; + + public static String Select_EClass; + public static String Select_EClassifier; + public static String Select_EDataType; + + public static String No_result_found; + + public static String Select; + public static String Type; + + public static String Create_FacetSet_Model; + + public static String CreateFacetInFacetSetWidget_FacetSetName; + + public static String CreateFacetInFacetSetWizardPage_could_not_find_wizard_page; + public static String Please_enter_value_for; + public static String Create_facet_in_facetSet; + public static String Create_facetSet_in_facetSet; + + public static String Create; + public static String CreateFacetInFacetSetWizardPage_Please_fill_extendedMetaClass; + public static String CreateFacetInFacetSetWizardPage_Sub_Typing_Facet; + public static String CreateFacetInFacetSetWizardPage_wizard_description; + public static String CreateFacetSetWizardImpl_Create_new_facet_Set; + public static String CreateFacetSetWizardImpl_FacetModel; + public static String CreateFacetSetWizardImpl_File_extension_restriction; + + public static String CreateFacetSetWizardPage_Not_a_Plugin_project; + public static String Create_Query; + public static String FilteredElementSelectionControl_type_filter_text; + public static String Load_MetaModel_Resource; + public static String FacetSetSelectionDialog_selectFacetSetsMessage; + public static String FacetSetSelectionDialog_selectFacetSetsTitle; + public static String Package_Selection; + public static String Select_Registered_URI; + + public static String SelectQueryTypeWizardPage_No_wizard_found; + public static String SelectQueryTypeWizardPage_Query_Type; + public static String JavaQueryWizardPage_Can_be_cached; + public static String JavaQueryWizardPage_has_side_effect; + public static String JavaQueryWizardPage_Query_name; + public static String Query_Select_Name_And_Type; + + // Begin copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages + public static String Query_name; + public static String QueryExecutionView_0; + public static String QueryExecutionView_1; + public static String QueryExecutionView_classpathWarning; + public static String QueryExecutionView_errorInBundleClasspath; + public static String QueryExecutionView_execEnvNotAvailable; + public static String QueryExecutionView_execEnvError; + public static String QueryExecutionView_Context; + public static String QueryExecutionView_DisplayResultIn; + public static String QueryExecutionView_dragAndDropHint; + public static String QueryExecutionView_ErrorExecutingQuery; + + public static String QueryExecutionView_ETypeElementsGroup; + public static String QueryExecutionView_ExecuteButton; + public static String QueryExecutionView_ExecuteGroup; + public static String QueryExecutionView_NoQueryDisplayer; + public static String QueryExecutionView_NoQuerySelected; + public static String QueryExecutionView_NullQueryResult; + public static String QueryExecutionView_notImplementedYet; + public static String QueryExecutionView_Parameters; + public static String QueryExecutionView_Query; + public static String QueryExecutionView_QueryException; + public static String QueryExecutionView_QueryReturnedNull; + public static String QueryExecutionView_SelectQueryToExecute; + public static String QuerySelectionDialog_createQuery; + public static String QuerySelectionDialog_enableQuery; + public static String QuerySelectionDialog_refreshQuerySetsJob; + public static String QuerySelectionDialog_selectQuery; + + public static String Query_Query_Name; + public static String Query_has_side_effect; + public static String Query_Can_be_cached; + + public static String Metaclass_mustSelectMetaclass; + public static String ExtendedMetaClass; + + // End copied from org.eclipse.papyrus.emf.facet.infra.query.ui.Messages + + // Edition + public static String Edit_FacetSet; + public static String Edit_Facet; + public static String Edit_FacetAttribute; + public static String Edit_FacetReference; + public static String Edit_FacetOperation; + public static String Edit_FacetOperationParameter; + + public static String EditFacetSetWidget_FacetSetName; + + public static String EditFacetWidget_FacetName; + + public static String GetSubTypingType_message; + public static String GetSubTypingType_title; + + public static String FacetSetPropertyWizardPage_facet_properties; + + static { + // initialize resource bundle + NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java index 0aad5373bdc..0d10cfa75fc 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java @@ -1,70 +1,70 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-
-/**
- * Utils methods for using the workbench.
- *
- * @since 0.3
- */
-public final class WorkbenchUtils {
-
- private WorkbenchUtils() {
- // Private constructor.
- }
-
- public static void openNewFile(final IFile modelFile,
- final IWorkbench currentWorkbench,
- final IWorkbenchWindow workbenchWindow, final IWorkbenchPage page) {
- // Open an editor on the new file.
- try {
- page.openEditor(
- new FileEditorInput(modelFile),
- currentWorkbench
- .getEditorRegistry()
- .getDefaultEditor(
- modelFile.getFullPath().toString()).getId());
- } catch (final PartInitException exception) {
- MessageDialog.openError(workbenchWindow.getShell(), "Open Editor", exception.getMessage()); //$NON-NLS-1$
- }
- }
-
- public static IWorkbenchPage selectNewFile(final IFile modelFile,
- final IWorkbenchWindow workbenchWindow) {
- final IWorkbenchPage page = workbenchWindow.getActivePage();
- final IWorkbenchPart activePart = page.getActivePart();
- if (activePart instanceof ISetSelectionTarget) {
- final ISelection targetSelection = new StructuredSelection(
- modelFile);
- workbenchWindow.getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- ((ISetSelectionTarget) activePart)
- .selectReveal(targetSelection);
- }
- });
- }
- return page;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal; + +import org.eclipse.core.resources.IFile; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +/** + * Utils methods for using the workbench. + * + * @since 0.3 + */ +public final class WorkbenchUtils { + + private WorkbenchUtils() { + // Private constructor. + } + + public static void openNewFile(final IFile modelFile, + final IWorkbench currentWorkbench, + final IWorkbenchWindow workbenchWindow, final IWorkbenchPage page) { + // Open an editor on the new file. + try { + page.openEditor( + new FileEditorInput(modelFile), + currentWorkbench + .getEditorRegistry() + .getDefaultEditor( + modelFile.getFullPath().toString()).getId()); + } catch (final PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), "Open Editor", exception.getMessage()); //$NON-NLS-1$ + } + } + + public static IWorkbenchPage selectNewFile(final IFile modelFile, + final IWorkbenchWindow workbenchWindow) { + final IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection( + modelFile); + workbenchWindow.getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + ((ISetSelectionTarget) activePart) + .selectReveal(targetSelection); + } + }); + } + return page; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java index 8abcb8a8147..f79c2926be5 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java @@ -1,67 +1,67 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exception.SdkUiRuntimeException;
-import org.eclipse.papyrus.emf.facet.util.core.DebugUtils;
-import org.eclipse.papyrus.emf.facet.util.emf.core.EmfDebugUtils;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractMainDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
-
-public abstract class AbstractComandMainDialog<W extends ICommandWidget>
- extends AbstractMainDialog<W> {
-
- private final EditingDomain editingDomain;
-
- /**
- * Constructor.
- *
- * @param editedElement
- * the selection in the model (ecore file).
- * @param editingDomain
- */
- public AbstractComandMainDialog(final Object editedElement,
- final EditingDomain editingDomain) {
- super(editedElement);
- this.editingDomain = editingDomain;
- }
-
- @Override
- protected void execute() {
- final Object result = getWidget().getCommand();
- if (result instanceof Command) {
- final Command command = (Command) result;
- DebugUtils.debug(EmfDebugUtils.debugCommand(command));
- if (command.canExecute()) {
- this.editingDomain.getCommandStack().execute(command);
- } else {
- Object widget = getWidget();
- if (widget instanceof SynchronizedObject<?>) {
- final SynchronizedObject<?> syncObject = (SynchronizedObject<?>) widget;
- widget = syncObject.getSynchronizedObject();
- }
- throw new SdkUiRuntimeException(NLS.bind("The command created by {0} is not executable: {1}", //$NON-NLS-1$
- widget.getClass().getName(),
- EmfDebugUtils.debugCommand(command)));
- }
- }
- }
-
- protected final EditingDomain getEditingDomain() {
- return this.editingDomain;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exception.SdkUiRuntimeException; +import org.eclipse.papyrus.emf.facet.util.core.DebugUtils; +import org.eclipse.papyrus.emf.facet.util.emf.core.EmfDebugUtils; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractMainDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget; + +public abstract class AbstractComandMainDialog<W extends ICommandWidget> + extends AbstractMainDialog<W> { + + private final EditingDomain editingDomain; + + /** + * Constructor. + * + * @param editedElement + * the selection in the model (ecore file). + * @param editingDomain + */ + public AbstractComandMainDialog(final Object editedElement, + final EditingDomain editingDomain) { + super(editedElement); + this.editingDomain = editingDomain; + } + + @Override + protected void execute() { + final Object result = getWidget().getCommand(); + if (result instanceof Command) { + final Command command = (Command) result; + DebugUtils.debug(EmfDebugUtils.debugCommand(command)); + if (command.canExecute()) { + this.editingDomain.getCommandStack().execute(command); + } else { + Object widget = getWidget(); + if (widget instanceof SynchronizedObject<?>) { + final SynchronizedObject<?> syncObject = (SynchronizedObject<?>) widget; + widget = syncObject.getSynchronizedObject(); + } + throw new SdkUiRuntimeException(NLS.bind("The command created by {0} is not executable: {1}", //$NON-NLS-1$ + widget.getClass().getName(), + EmfDebugUtils.debugCommand(command))); + } + } + } + + protected final EditingDomain getEditingDomain() { + return this.editingDomain; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java index 4ae28c9b9d2..a60d2bf7d56 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java @@ -1,41 +1,41 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.util.EditingUtil;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
-
-public abstract class AbstractCommandDialog<T extends Object, W extends ICommandWidget>
- extends AbstractDialog<T, W> {
-
- /**
- * Constructor.
- *
- * @param properties
- * properties that parent widget had.
- */
- public AbstractCommandDialog(final T callback) {
- super(callback);
- }
-
- @Override
- protected void execute() {
- final Object result = getWidget().getCommand();
- if (result instanceof Command) {
- final Command command = (Command) result;
- EditingUtil.getEditingDomain().getCommandStack().execute(command);
- }
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.emf.facet.util.emf.ui.util.EditingUtil; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget; + +public abstract class AbstractCommandDialog<T extends Object, W extends ICommandWidget> + extends AbstractDialog<T, W> { + + /** + * Constructor. + * + * @param properties + * properties that parent widget had. + */ + public AbstractCommandDialog(final T callback) { + super(callback); + } + + @Override + protected void execute() { + final Object result = getWidget().getCommand(); + if (result instanceof Command) { + final Command command = (Command) result; + EditingUtil.getEditingDomain().getCommandStack().execute(command); + } + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java index ff6b4fe78a9..1a5ffbc4af0 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java @@ -1,179 +1,179 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog;
-
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddAttributeInFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddParameterInOperationDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddReferenceInFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetAttributeDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationParameterDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetReferenceDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.util.EditingUtil;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.handler.HandlerUtils;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A factory for the dialogs creation.
- */
-public class FacetDialogFactoryImpl implements IFacetDialogFactory {
-
- protected static void openDialog(final IDialog<?> dialog) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- dialog.open();
- }
- });
- }
-
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> dialog = new CreateFacetSetInFacetSetDialog(
- (FacetSet) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IFacetWidget> openCreateFacetInFacetSetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IFacetWidget> dialog = new CreateFacetInFacetSetDialog(
- (FacetSet) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IFacetWidget>(dialog,
- Display.getDefault());
- }
-
- public IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final Facet facet = (Facet) HandlerUtils.getSelection();
- final IDialog<IEStructuralFeatureWidget> dialog = new AddAttributeInFacetDialog(
- facet, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final Facet facet = (Facet) HandlerUtils.getSelection();
- final IDialog<IEStructuralFeatureWidget> dialog = new AddReferenceInFacetDialog(
- facet, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final Facet facet = (Facet) HandlerUtils.getSelection();
- final IDialog<IDerivedTypedElementWidget> dialog = new AddOperationInFacetDialog(
- facet, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> dialog = new AddParameterInOperationDialog(
- (FacetOperation) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> dialog = new EditFacetSetDialog(
- (FacetSet) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>(
- dialog,
- Display.getDefault());
- }
-
- public IDialog<IFacetWidget> openEditFacetDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IFacetWidget> dialog = new EditFacetDialog(
- (Facet) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IFacetWidget>(
- dialog,
- Display.getDefault());
- }
-
- public IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final FacetAttribute fAttribute = (FacetAttribute) HandlerUtils
- .getSelection();
- final IDialog<IEStructuralFeatureWidget> dialog = new EditFacetAttributeDialog(
- fAttribute, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final FacetReference facetReference = (FacetReference) HandlerUtils
- .getSelection();
- final IDialog<IEStructuralFeatureWidget> dialog = new EditFacetReferenceDialog(
- facetReference, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final FacetOperation facetOperation = (FacetOperation) HandlerUtils
- .getSelection();
- final IDialog<IDerivedTypedElementWidget> dialog = new EditFacetOperationDialog(
- facetOperation, editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>(
- dialog, Display.getDefault());
- }
-
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog() {
- final EditingDomain editingDomain = EditingUtil.getEditingDomain();
- final IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> dialog = new EditFacetOperationParameterDialog(
- (EParameter) HandlerUtils.getSelection(), editingDomain);
- openDialog(dialog);
- return new SynchronizedAbstractDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>(
- dialog, Display.getDefault());
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog; + +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddAttributeInFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddParameterInOperationDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddReferenceInFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetAttributeDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationParameterDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetReferenceDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.emf.ui.util.EditingUtil; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.handler.HandlerUtils; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.swt.widgets.Display; + +/** + * A factory for the dialogs creation. + */ +public class FacetDialogFactoryImpl implements IFacetDialogFactory { + + protected static void openDialog(final IDialog<?> dialog) { + Display.getDefault().asyncExec(new Runnable() { + public void run() { + dialog.open(); + } + }); + } + + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> dialog = new CreateFacetSetInFacetSetDialog( + (FacetSet) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>( + dialog, Display.getDefault()); + } + + public IDialog<IFacetWidget> openCreateFacetInFacetSetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IFacetWidget> dialog = new CreateFacetInFacetSetDialog( + (FacetSet) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IFacetWidget>(dialog, + Display.getDefault()); + } + + public IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final Facet facet = (Facet) HandlerUtils.getSelection(); + final IDialog<IEStructuralFeatureWidget> dialog = new AddAttributeInFacetDialog( + facet, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final Facet facet = (Facet) HandlerUtils.getSelection(); + final IDialog<IEStructuralFeatureWidget> dialog = new AddReferenceInFacetDialog( + facet, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final Facet facet = (Facet) HandlerUtils.getSelection(); + final IDialog<IDerivedTypedElementWidget> dialog = new AddOperationInFacetDialog( + facet, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> dialog = new AddParameterInOperationDialog( + (FacetOperation) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>( + dialog, Display.getDefault()); + } + + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> dialog = new EditFacetSetDialog( + (FacetSet) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>( + dialog, + Display.getDefault()); + } + + public IDialog<IFacetWidget> openEditFacetDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IFacetWidget> dialog = new EditFacetDialog( + (Facet) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IFacetWidget>( + dialog, + Display.getDefault()); + } + + public IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final FacetAttribute fAttribute = (FacetAttribute) HandlerUtils + .getSelection(); + final IDialog<IEStructuralFeatureWidget> dialog = new EditFacetAttributeDialog( + fAttribute, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final FacetReference facetReference = (FacetReference) HandlerUtils + .getSelection(); + final IDialog<IEStructuralFeatureWidget> dialog = new EditFacetReferenceDialog( + facetReference, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IEStructuralFeatureWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final FacetOperation facetOperation = (FacetOperation) HandlerUtils + .getSelection(); + final IDialog<IDerivedTypedElementWidget> dialog = new EditFacetOperationDialog( + facetOperation, editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>( + dialog, Display.getDefault()); + } + + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog() { + final EditingDomain editingDomain = EditingUtil.getEditingDomain(); + final IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> dialog = new EditFacetOperationParameterDialog( + (EParameter) HandlerUtils.getSelection(), editingDomain); + openDialog(dialog); + return new SynchronizedAbstractDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>( + dialog, Display.getDefault()); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java index af0336d2ed2..d85f96c5b88 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java @@ -1,184 +1,184 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Synchronized class for {@link FacetDialogFactoryImpl}.
- */
-public class SynchronizedFacetDialogFactory extends
- SynchronizedObject<IFacetDialogFactory> implements IFacetDialogFactory {
-
- public SynchronizedFacetDialogFactory(final IFacetDialogFactory object,
- final Display display) {
- super(object, display);
- }
-
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>>() {
- @Override
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openCreateFacetSetInFacetSetDialog();
- }
- });
- }
-
- public IDialog<IFacetWidget> openCreateFacetInFacetSetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IFacetWidget>>() {
- @Override
- public IDialog<IFacetWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openCreateFacetInFacetSetDialog();
- }
- });
- }
-
- public IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() {
- @Override
- public IDialog<IEStructuralFeatureWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openAddAttributeInFacetDialog();
- }
- });
- }
-
- public IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() {
- @Override
- public IDialog<IEStructuralFeatureWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openAddReferenceInFacetDialog();
- }
- });
- }
-
- public IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IDerivedTypedElementWidget>>() {
- @Override
- public IDialog<IDerivedTypedElementWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openAddOperationInFacetDialog();
- }
- });
- }
-
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>>() {
- @Override
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openAddParameterInOperationDialog();
- }
- });
- }
-
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>>() {
- @Override
- public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openEditFacetSetDialog();
- }
- });
- }
-
- public IDialog<IFacetWidget> openEditFacetDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IFacetWidget>>() {
- @Override
- public IDialog<IFacetWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject().openEditFacetDialog();
- }
- });
- }
-
- public IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() {
- @Override
- public IDialog<IEStructuralFeatureWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openEditFacetAttributeDialog();
- }
- });
- }
-
- public IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() {
- @Override
- public IDialog<IEStructuralFeatureWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openEditFacetReferenceDialog();
- }
- });
- }
-
- public IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IDerivedTypedElementWidget>>() {
- @Override
- public IDialog<IDerivedTypedElementWidget> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openEditFacetOperationDialog();
- }
- });
- }
-
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog() {
- return this
- .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>>() {
- @Override
- public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> safeRun() {
- return SynchronizedFacetDialogFactory.this
- .getSynchronizedObject()
- .openEditFacetOperationParameterDialog();
- }
- });
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.swt.widgets.Display; + +/** + * Synchronized class for {@link FacetDialogFactoryImpl}. + */ +public class SynchronizedFacetDialogFactory extends + SynchronizedObject<IFacetDialogFactory> implements IFacetDialogFactory { + + public SynchronizedFacetDialogFactory(final IFacetDialogFactory object, + final Display display) { + super(object, display); + } + + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openCreateFacetSetInFacetSetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>>() { + @Override + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openCreateFacetSetInFacetSetDialog(); + } + }); + } + + public IDialog<IFacetWidget> openCreateFacetInFacetSetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IFacetWidget>>() { + @Override + public IDialog<IFacetWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openCreateFacetInFacetSetDialog(); + } + }); + } + + public IDialog<IEStructuralFeatureWidget> openAddAttributeInFacetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() { + @Override + public IDialog<IEStructuralFeatureWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openAddAttributeInFacetDialog(); + } + }); + } + + public IDialog<IEStructuralFeatureWidget> openAddReferenceInFacetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() { + @Override + public IDialog<IEStructuralFeatureWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openAddReferenceInFacetDialog(); + } + }); + } + + public IDialog<IDerivedTypedElementWidget> openAddOperationInFacetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IDerivedTypedElementWidget>>() { + @Override + public IDialog<IDerivedTypedElementWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openAddOperationInFacetDialog(); + } + }); + } + + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openAddParameterInOperationDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>>() { + @Override + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openAddParameterInOperationDialog(); + } + }); + } + + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> openEditFacetSetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>>>() { + @Override + public IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openEditFacetSetDialog(); + } + }); + } + + public IDialog<IFacetWidget> openEditFacetDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IFacetWidget>>() { + @Override + public IDialog<IFacetWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject().openEditFacetDialog(); + } + }); + } + + public IDialog<IEStructuralFeatureWidget> openEditFacetAttributeDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() { + @Override + public IDialog<IEStructuralFeatureWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openEditFacetAttributeDialog(); + } + }); + } + + public IDialog<IEStructuralFeatureWidget> openEditFacetReferenceDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IEStructuralFeatureWidget>>() { + @Override + public IDialog<IEStructuralFeatureWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openEditFacetReferenceDialog(); + } + }); + } + + public IDialog<IDerivedTypedElementWidget> openEditFacetOperationDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IDerivedTypedElementWidget>>() { + @Override + public IDialog<IDerivedTypedElementWidget> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openEditFacetOperationDialog(); + } + }); + } + + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> openEditFacetOperationParameterDialog() { + return this + .safeSyncExec(new AbstractExceptionFreeRunnable<IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>>>() { + @Override + public IDialog<IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> safeRun() { + return SynchronizedFacetDialogFactory.this + .getSynchronizedObject() + .openEditFacetOperationParameterDialog(); + } + }); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/AbstractComandExecDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/AbstractComandExecDialog.java index e4a2d382efb..76536172c5a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/AbstractComandExecDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/AbstractComandExecDialog.java @@ -1,49 +1,49 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialogWithCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
-
-public abstract class AbstractComandExecDialog<T extends Object, W extends ICommandWidget>
- extends AbstractDialogWithCallback<T, W> {
-
- private final EditingDomain editingDomain;
-
- /**
- * Constructor.
- *
- * @param editingDomain
- * the current editing domain
- * @param properties
- * the properties that the widget needs
- */
- protected AbstractComandExecDialog(
- final IWithResultDialogCallback<T> callback,
- final EditingDomain editingDomain) {
- super(callback);
- this.editingDomain = editingDomain;
- }
-
- @Override
- protected void execute() {
- final Object result = getWidget().getCommand();
- if (result instanceof Command) {
- final Command command = (Command) result;
- this.editingDomain.getCommandStack().execute(command);
- }
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialogWithCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget; + +public abstract class AbstractComandExecDialog<T extends Object, W extends ICommandWidget> + extends AbstractDialogWithCallback<T, W> { + + private final EditingDomain editingDomain; + + /** + * Constructor. + * + * @param editingDomain + * the current editing domain + * @param properties + * the properties that the widget needs + */ + protected AbstractComandExecDialog( + final IWithResultDialogCallback<T> callback, + final EditingDomain editingDomain) { + super(callback); + this.editingDomain = editingDomain; + } + + @Override + protected void execute() { + final Object result = getWidget().getCommand(); + if (result instanceof Command) { + final Command command = (Command) result; + this.editingDomain.getCommandStack().execute(command); + } + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetDialog.java index d844c45ba5b..fc9d8420d72 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetDialog.java @@ -1,107 +1,107 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Provide a dialog where the user can select a facet in the existing facetSet
- * list or create a new one. This class use the specific widget {@link GetOrCreateFiltredFacetWidget} and return the selected element with
- * the method {@link #getFacetSelected()}.</p>
- *
- * When the "ok" button is pressed, the parent property is set with the selected
- * element.
- *
- * @see GetOrCreateFiltredFacetWidget
- */
-public class GetOrCreateFacetDialog extends
- AbstractComandExecDialog<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> {
-
- private GetOrCreateFiltredFacetWidget gOCFacet; // gOC=getOrCreate
- private final EditingDomain editingDomain;
- private final FacetSet container;
-
- /**
- * The constructor.
- *
- * @param callback
- * the callback.
- * @param container
- * @param properties
- * properties that parent widget had.
- */
- public GetOrCreateFacetDialog(
- final IWithResultDialogCallback<Facet> callback,
- final EditingDomain editingDomain, final FacetSet container) {
- super(callback, editingDomain);
- this.editingDomain = editingDomain;
- this.container = container;
- }
-
- /**
- * Return the facet selected by the user.
- *
- * @return the facet selected.
- */
- public Facet getFacet() {
- return this.gOCFacet.getFacetSelected();
- }
-
- @Override
- protected IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget> createWidget() {
- this.gOCFacet = new GetOrCreateFiltredFacetWidget(
- this.getDialogComposite(), this.editingDomain, this.container);
- return new SynchronizedGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>(
- this.gOCFacet, this.gOCFacet.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.GetOrCreate_Facet_message;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Select_Facet;
- }
-
- @Override
- protected void okPressed() {
- // TODO Use of an instance of PropetyElement2
- this.getCallback().canceled(this.gOCFacet.getFacetSelected());
- super.okPressed();
- }
-
- public IDialog<IFacetWidget> createElement() {
- final IDialog<IFacetWidget> pressNewButton = this.gOCFacet
- .pressNewButton();
- return new SynchronizedAbstractDialog<IFacetWidget>(pressNewButton,
- Display.getDefault());
- }
-
- @Override
- protected Facet getResult() {
- return this.gOCFacet.getFacetSelected();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.swt.widgets.Display; + +/** + * Provide a dialog where the user can select a facet in the existing facetSet + * list or create a new one. This class use the specific widget {@link GetOrCreateFiltredFacetWidget} and return the selected element with + * the method {@link #getFacetSelected()}.</p> + * + * When the "ok" button is pressed, the parent property is set with the selected + * element. + * + * @see GetOrCreateFiltredFacetWidget + */ +public class GetOrCreateFacetDialog extends + AbstractComandExecDialog<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> { + + private GetOrCreateFiltredFacetWidget gOCFacet; // gOC=getOrCreate + private final EditingDomain editingDomain; + private final FacetSet container; + + /** + * The constructor. + * + * @param callback + * the callback. + * @param container + * @param properties + * properties that parent widget had. + */ + public GetOrCreateFacetDialog( + final IWithResultDialogCallback<Facet> callback, + final EditingDomain editingDomain, final FacetSet container) { + super(callback, editingDomain); + this.editingDomain = editingDomain; + this.container = container; + } + + /** + * Return the facet selected by the user. + * + * @return the facet selected. + */ + public Facet getFacet() { + return this.gOCFacet.getFacetSelected(); + } + + @Override + protected IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget> createWidget() { + this.gOCFacet = new GetOrCreateFiltredFacetWidget( + this.getDialogComposite(), this.editingDomain, this.container); + return new SynchronizedGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>( + this.gOCFacet, this.gOCFacet.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.GetOrCreate_Facet_message; + } + + @Override + protected String getDialogTitle() { + return Messages.Select_Facet; + } + + @Override + protected void okPressed() { + // TODO Use of an instance of PropetyElement2 + this.getCallback().canceled(this.gOCFacet.getFacetSelected()); + super.okPressed(); + } + + public IDialog<IFacetWidget> createElement() { + final IDialog<IFacetWidget> pressNewButton = this.gOCFacet + .pressNewButton(); + return new SynchronizedAbstractDialog<IFacetWidget>(pressNewButton, + Display.getDefault()); + } + + @Override + protected Facet getResult() { + return this.gOCFacet.getFacetSelected(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetSetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetSetDialog.java index ddd60704273..1c0689ee586 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetSetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetSetDialog.java @@ -1,102 +1,102 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Provide a dialog where the user can select a facetSet in the existing
- * facetSets list or create a new one. This class use the specific widget {@link GetOrCreateFiltredFacetSetWidget} and return the selected element with
- * the method {@link #getFacetSetSelected()}.</p>
- *
- * When the "ok" button is pressed, the parent property is set with the selected
- * element.
- *
- * @see GetOrCreateFiltredFacetSetWidget
- */
-public class GetOrCreateFacetSetDialog extends
- AbstractComandExecDialog<FacetSet, IGetOrCreateFilteredFacetSetWidget> {
-
- private GetOrCreateFiltredFacetSetWidget gOCFacetSet; // gOC=getOrCreate
- private final EditingDomain editingDomain;
- private final PropertyElement2<FacetSet> facetSetProp;
- private final FacetSet reject;
-
- /**
- * The constructor.
- *
- * @param callback
- * the callback.
- * @param properties
- * properties that parent widget had.
- * @param reject
- */
- public GetOrCreateFacetSetDialog(
- final IWithResultDialogCallback<FacetSet> callback,
- final EditingDomain editingDomain,
- final PropertyElement2<FacetSet> facetSetProp, final FacetSet reject) {
- super(callback, editingDomain);
- this.editingDomain = editingDomain;
- this.facetSetProp = facetSetProp;
- this.reject = reject;
- }
-
- /**
- * Return the facetSet selected by the user.
- *
- * @return the facetSet selected.
- */
- public FacetSet getFacetSet() {
- return this.gOCFacetSet.getFacetSetSelected();
- }
-
- @Override
- protected IGetOrCreateFilteredFacetSetWidget createWidget() {
- this.gOCFacetSet = new GetOrCreateFiltredFacetSetWidget(
- this.getDialogComposite(), this.editingDomain,
- this.facetSetProp, this.reject);
- return new SynchronizedGetOrCreateFilteredFacetSetWidget(
- this.gOCFacetSet, this.gOCFacetSet.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.GetOrCreate_FacetSet_message;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Select_FacetSet;
- }
-
- @Override
- protected void okPressed() {
- final FacetSet newValue = this.gOCFacetSet.getFacetSetSelected();
- if (newValue != null) {
- this.facetSetProp.setValue2(newValue);
- }
- super.okPressed();
- }
-
- @Override
- protected FacetSet getResult() {
- return this.gOCFacetSet.getFacetSetSelected();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Provide a dialog where the user can select a facetSet in the existing + * facetSets list or create a new one. This class use the specific widget {@link GetOrCreateFiltredFacetSetWidget} and return the selected element with + * the method {@link #getFacetSetSelected()}.</p> + * + * When the "ok" button is pressed, the parent property is set with the selected + * element. + * + * @see GetOrCreateFiltredFacetSetWidget + */ +public class GetOrCreateFacetSetDialog extends + AbstractComandExecDialog<FacetSet, IGetOrCreateFilteredFacetSetWidget> { + + private GetOrCreateFiltredFacetSetWidget gOCFacetSet; // gOC=getOrCreate + private final EditingDomain editingDomain; + private final PropertyElement2<FacetSet> facetSetProp; + private final FacetSet reject; + + /** + * The constructor. + * + * @param callback + * the callback. + * @param properties + * properties that parent widget had. + * @param reject + */ + public GetOrCreateFacetSetDialog( + final IWithResultDialogCallback<FacetSet> callback, + final EditingDomain editingDomain, + final PropertyElement2<FacetSet> facetSetProp, final FacetSet reject) { + super(callback, editingDomain); + this.editingDomain = editingDomain; + this.facetSetProp = facetSetProp; + this.reject = reject; + } + + /** + * Return the facetSet selected by the user. + * + * @return the facetSet selected. + */ + public FacetSet getFacetSet() { + return this.gOCFacetSet.getFacetSetSelected(); + } + + @Override + protected IGetOrCreateFilteredFacetSetWidget createWidget() { + this.gOCFacetSet = new GetOrCreateFiltredFacetSetWidget( + this.getDialogComposite(), this.editingDomain, + this.facetSetProp, this.reject); + return new SynchronizedGetOrCreateFilteredFacetSetWidget( + this.gOCFacetSet, this.gOCFacetSet.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.GetOrCreate_FacetSet_message; + } + + @Override + protected String getDialogTitle() { + return Messages.Select_FacetSet; + } + + @Override + protected void okPressed() { + final FacetSet newValue = this.gOCFacetSet.getFacetSetSelected(); + if (newValue != null) { + this.facetSetProp.setValue2(newValue); + } + super.okPressed(); + } + + @Override + protected FacetSet getResult() { + return this.gOCFacetSet.getFacetSetSelected(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateOperationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateOperationDialog.java index 77c7ded24fe..1210821bd05 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateOperationDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateOperationDialog.java @@ -1,113 +1,113 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredOperationWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Provide a dialog where the user can select an Operation in the existing
- * facets list or create a new one. This class use the specific widget {@link GetOrCreateFiltredOperationWidget} and return the selected element
- * with the method {@link #getFacetOperationSelected()}.</p>
- *
- * When the "ok" button is pressed, the parent property is set with the selected
- * element.
- *
- * @see GetOrCreateFiltredOperationWidget
- */
-public class GetOrCreateOperationDialog extends
- AbstractComandExecDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> {
-
- private GetOrCreateFiltredOperationWidget gOCOperation; // gOC=getOrCreate
- private final EditingDomain editingDomain;
- private final Facet context;
-
- /**
- * The constructor.
- *
- * @param callback
- * the callback.
- * @param context
- * @param specificProperties
- * properties that parent widget had.
- */
- public GetOrCreateOperationDialog(
- final IWithResultDialogCallback<FacetOperation> callback,
- final EditingDomain editingDomain, final Facet context) {
- super(callback, editingDomain);
- this.editingDomain = editingDomain;
- this.context = context;
- }
-
- /**
- * Return the operation selected by the user.
- *
- * @return the operation selected.
- */
- public FacetOperation getFacetOperation() {
- return this.gOCOperation.getFacetOperationSelected();
- }
-
- @Override
- protected IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget> createWidget() {
- this.gOCOperation = new GetOrCreateFiltredOperationWidget(
- this.getDialogComposite(), this.editingDomain, this.context);
- return new SynchronizedGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>(
- this.gOCOperation, this.gOCOperation.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.GetOrCreate_Operation_message;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Select_Operation;
- }
-
- @Override
- protected void okPressed() {
- // TODO Use of an instance of PropetyElement2
- this.getCallback().canceled(
- this.gOCOperation.getFacetOperationSelected());
- super.okPressed();
- }
-
- public void selectElement(final FacetOperation element) {
- this.gOCOperation.selectElement(element);
- }
-
- public IDialog<IDerivedTypedElementWidget> createElement() {
- final IDialog<IDerivedTypedElementWidget> pressNewButton = this.gOCOperation
- .pressNewButton();
- return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>(
- pressNewButton, Display.getDefault());
- }
-
- @Override
- protected FacetOperation getResult() {
- return this.gOCOperation.getFacetOperationSelected();
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredOperationWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.swt.widgets.Display; + +/** + * Provide a dialog where the user can select an Operation in the existing + * facets list or create a new one. This class use the specific widget {@link GetOrCreateFiltredOperationWidget} and return the selected element + * with the method {@link #getFacetOperationSelected()}.</p> + * + * When the "ok" button is pressed, the parent property is set with the selected + * element. + * + * @see GetOrCreateFiltredOperationWidget + */ +public class GetOrCreateOperationDialog extends + AbstractComandExecDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> { + + private GetOrCreateFiltredOperationWidget gOCOperation; // gOC=getOrCreate + private final EditingDomain editingDomain; + private final Facet context; + + /** + * The constructor. + * + * @param callback + * the callback. + * @param context + * @param specificProperties + * properties that parent widget had. + */ + public GetOrCreateOperationDialog( + final IWithResultDialogCallback<FacetOperation> callback, + final EditingDomain editingDomain, final Facet context) { + super(callback, editingDomain); + this.editingDomain = editingDomain; + this.context = context; + } + + /** + * Return the operation selected by the user. + * + * @return the operation selected. + */ + public FacetOperation getFacetOperation() { + return this.gOCOperation.getFacetOperationSelected(); + } + + @Override + protected IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget> createWidget() { + this.gOCOperation = new GetOrCreateFiltredOperationWidget( + this.getDialogComposite(), this.editingDomain, this.context); + return new SynchronizedGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>( + this.gOCOperation, this.gOCOperation.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.GetOrCreate_Operation_message; + } + + @Override + protected String getDialogTitle() { + return Messages.Select_Operation; + } + + @Override + protected void okPressed() { + // TODO Use of an instance of PropetyElement2 + this.getCallback().canceled( + this.gOCOperation.getFacetOperationSelected()); + super.okPressed(); + } + + public void selectElement(final FacetOperation element) { + this.gOCOperation.selectElement(element); + } + + public IDialog<IDerivedTypedElementWidget> createElement() { + final IDialog<IDerivedTypedElementWidget> pressNewButton = this.gOCOperation + .pressNewButton(); + return new SynchronizedAbstractDialog<IDerivedTypedElementWidget>( + pressNewButton, Display.getDefault()); + } + + @Override + protected FacetOperation getResult() { + return this.gOCOperation.getFacetOperationSelected(); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetSubTypingTypeDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetSubTypingTypeDialog.java index 7682765b6c2..c0c32996b05 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetSubTypingTypeDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetSubTypingTypeDialog.java @@ -1,88 +1,88 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetFilteredSubTypingTypeWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-
-/**
- * Provide a dialog for the selection of the sub element.
- */
-public class GetSubTypingTypeDialog extends
- AbstractComandExecDialog<ETypedElement, IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> {
-
- private GetFilteredSubTypingTypeWidget typeWidget;
- private final EClass context;
- private final Facet facet;
-
- /**
- * The constructor.
- *
- * @param callback
- * the callback.
- * @param specificProperties
- * properties that parent widget had.
- */
- public GetSubTypingTypeDialog(
- final IWithResultDialogCallback<ETypedElement> callback,
- final EditingDomain editingDomain, final Facet facet,
- final EClass context) {
- super(callback, editingDomain);
- this.facet = facet;
- this.context = context;
- }
-
- @Override
- protected IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object> createWidget() {
- this.typeWidget = new GetFilteredSubTypingTypeWidget(this.getDialogComposite(),
- this.context, this.facet);
- return new SynchronizedGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>(
- this.typeWidget, this.typeWidget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.GetSubTypingType_message;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.GetSubTypingType_title;
- }
-
- @Override
- protected void okPressed() {
- // TODO Use of an instance of PropetyElement2
- this.getCallback().commited(this.typeWidget.getSubTypeSelected());
- super.okPressed();
- }
-
- public void selectElement(final Object element) {
- if (element instanceof ETypedElement) {
- final ETypedElement eTypeElement = (ETypedElement) element;
- this.typeWidget.selectElement(eTypeElement);
- }
- }
-
- @Override
- protected ETypedElement getResult() {
- return this.typeWidget.getSubTypeSelected();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.GetFilteredSubTypingTypeWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; + +/** + * Provide a dialog for the selection of the sub element. + */ +public class GetSubTypingTypeDialog extends + AbstractComandExecDialog<ETypedElement, IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> { + + private GetFilteredSubTypingTypeWidget typeWidget; + private final EClass context; + private final Facet facet; + + /** + * The constructor. + * + * @param callback + * the callback. + * @param specificProperties + * properties that parent widget had. + */ + public GetSubTypingTypeDialog( + final IWithResultDialogCallback<ETypedElement> callback, + final EditingDomain editingDomain, final Facet facet, + final EClass context) { + super(callback, editingDomain); + this.facet = facet; + this.context = context; + } + + @Override + protected IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object> createWidget() { + this.typeWidget = new GetFilteredSubTypingTypeWidget(this.getDialogComposite(), + this.context, this.facet); + return new SynchronizedGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>( + this.typeWidget, this.typeWidget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.GetSubTypingType_message; + } + + @Override + protected String getDialogTitle() { + return Messages.GetSubTypingType_title; + } + + @Override + protected void okPressed() { + // TODO Use of an instance of PropetyElement2 + this.getCallback().commited(this.typeWidget.getSubTypeSelected()); + super.okPressed(); + } + + public void selectElement(final Object element) { + if (element instanceof ETypedElement) { + final ETypedElement eTypeElement = (ETypedElement) element; + this.typeWidget.selectElement(eTypeElement); + } + } + + @Override + protected ETypedElement getResult() { + return this.typeWidget.getSubTypeSelected(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractDerivedTypedElementDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractDerivedTypedElementDialog.java index 3bb95755d39..e7589de3043 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractDerivedTypedElementDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractDerivedTypedElementDialog.java @@ -1,44 +1,44 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-public abstract class AbstractDerivedTypedElementDialog<W extends IDerivedTypedElementWidget>
- extends
- AbstractETypedElementDialog<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>, W> {
-
- private final PropertyElement2<Query> queryProperty;
-
- protected AbstractDerivedTypedElementDialog(
- final DerivedTypedElement selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.queryProperty = new PropertyElement2<Query>(true);
- if (selection != null) {
- this.queryProperty.setValue2(selection.getQuery());
- }
- }
-
- protected final PropertyElement2<Query> getQueryProperty() {
- return this.queryProperty;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +public abstract class AbstractDerivedTypedElementDialog<W extends IDerivedTypedElementWidget> + extends + AbstractETypedElementDialog<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>, W> { + + private final PropertyElement2<Query> queryProperty; + + protected AbstractDerivedTypedElementDialog( + final DerivedTypedElement selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.queryProperty = new PropertyElement2<Query>(true); + if (selection != null) { + this.queryProperty.setValue2(selection.getQuery()); + } + } + + protected final PropertyElement2<Query> getQueryProperty() { + return this.queryProperty; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractENamedElementDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractENamedElementDialog.java index 69ffae31ec1..b648a932b5c 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractENamedElementDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractENamedElementDialog.java @@ -1,39 +1,39 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.AbstractComandMainDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-public abstract class AbstractENamedElementDialog<C extends EObject, CW extends Object, W extends IENamedElementWidget<C, CW>>
- extends AbstractComandMainDialog<W> {
-
- private final PropertyElement2<String> nameProperty;
-
- protected AbstractENamedElementDialog(final ENamedElement editedElement,
- final EditingDomain editingDomain) {
- super(editedElement, editingDomain);
- this.nameProperty = new PropertyElement2<String>(true);
- if (editedElement != null) {
- this.nameProperty.setValue2(editedElement.getName());
- }
- }
-
- protected final PropertyElement2<String> getNameProperty() {
- return this.nameProperty;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.AbstractComandMainDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +public abstract class AbstractENamedElementDialog<C extends EObject, CW extends Object, W extends IENamedElementWidget<C, CW>> + extends AbstractComandMainDialog<W> { + + private final PropertyElement2<String> nameProperty; + + protected AbstractENamedElementDialog(final ENamedElement editedElement, + final EditingDomain editingDomain) { + super(editedElement, editingDomain); + this.nameProperty = new PropertyElement2<String>(true); + if (editedElement != null) { + this.nameProperty.setValue2(editedElement.getName()); + } + } + + protected final PropertyElement2<String> getNameProperty() { + return this.nameProperty; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractEStructuralFeatureDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractEStructuralFeatureDialog.java index a9fbb1c4cdd..e5272813fad 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractEStructuralFeatureDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractEStructuralFeatureDialog.java @@ -1,77 +1,77 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-public abstract class AbstractEStructuralFeatureDialog<W extends IDerivedTypedElementWidget>
- extends AbstractDerivedTypedElementDialog<W> {
-
- private final PropertyElement2<Boolean> volatileProperty;
- private final PropertyElement2<Boolean> derivedroperty;
- private final PropertyElement2<Boolean> transientProperty;
- private final PropertyElement2<Boolean> changeableroperty;
- private final PropertyElement2<Facet> containerProperty;
-
- protected AbstractEStructuralFeatureDialog(
- final DerivedTypedElement selection,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> containerProperty) {
- super(selection, editingDomain);
- this.volatileProperty = new PropertyElement2<Boolean>(true);
- this.changeableroperty = new PropertyElement2<Boolean>(true);
- this.derivedroperty = new PropertyElement2<Boolean>(true);
- this.transientProperty = new PropertyElement2<Boolean>(true);
- if (selection instanceof EStructuralFeature) {
- final EStructuralFeature structuralFeature = (EStructuralFeature) getSelection();
- this.volatileProperty.setValue2(Boolean.valueOf(structuralFeature
- .isVolatile()));
- this.changeableroperty.setValue2(Boolean.valueOf(structuralFeature
- .isChangeable()));
- this.derivedroperty.setValue2(Boolean.valueOf(structuralFeature
- .isDerived()));
- this.transientProperty.setValue2(Boolean.valueOf(structuralFeature
- .isTransient()));
- }
- this.containerProperty = containerProperty;
- }
-
- protected final PropertyElement2<Boolean> getVolatileProperty() {
- return this.volatileProperty;
- }
-
- protected final PropertyElement2<Boolean> getDerivedroperty() {
- return this.derivedroperty;
- }
-
- protected final PropertyElement2<Boolean> getTransientProperty() {
- return this.transientProperty;
- }
-
- protected final PropertyElement2<Boolean> getChangeableroperty() {
- return this.changeableroperty;
- }
-
- /**
- * @return the containerProperty
- */
- public PropertyElement2<Facet> getContainerProperty() {
- return this.containerProperty;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +public abstract class AbstractEStructuralFeatureDialog<W extends IDerivedTypedElementWidget> + extends AbstractDerivedTypedElementDialog<W> { + + private final PropertyElement2<Boolean> volatileProperty; + private final PropertyElement2<Boolean> derivedroperty; + private final PropertyElement2<Boolean> transientProperty; + private final PropertyElement2<Boolean> changeableroperty; + private final PropertyElement2<Facet> containerProperty; + + protected AbstractEStructuralFeatureDialog( + final DerivedTypedElement selection, + final EditingDomain editingDomain, + final PropertyElement2<Facet> containerProperty) { + super(selection, editingDomain); + this.volatileProperty = new PropertyElement2<Boolean>(true); + this.changeableroperty = new PropertyElement2<Boolean>(true); + this.derivedroperty = new PropertyElement2<Boolean>(true); + this.transientProperty = new PropertyElement2<Boolean>(true); + if (selection instanceof EStructuralFeature) { + final EStructuralFeature structuralFeature = (EStructuralFeature) getSelection(); + this.volatileProperty.setValue2(Boolean.valueOf(structuralFeature + .isVolatile())); + this.changeableroperty.setValue2(Boolean.valueOf(structuralFeature + .isChangeable())); + this.derivedroperty.setValue2(Boolean.valueOf(structuralFeature + .isDerived())); + this.transientProperty.setValue2(Boolean.valueOf(structuralFeature + .isTransient())); + } + this.containerProperty = containerProperty; + } + + protected final PropertyElement2<Boolean> getVolatileProperty() { + return this.volatileProperty; + } + + protected final PropertyElement2<Boolean> getDerivedroperty() { + return this.derivedroperty; + } + + protected final PropertyElement2<Boolean> getTransientProperty() { + return this.transientProperty; + } + + protected final PropertyElement2<Boolean> getChangeableroperty() { + return this.changeableroperty; + } + + /** + * @return the containerProperty + */ + public PropertyElement2<Facet> getContainerProperty() { + return this.containerProperty; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractETypedElementDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractETypedElementDialog.java index 62ccb1cf381..983fdbb18ec 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractETypedElementDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractETypedElementDialog.java @@ -1,78 +1,78 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-public abstract class AbstractETypedElementDialog<C extends EObject, CW extends Object, W extends IETypedElementWidget<C, CW>>
- extends AbstractENamedElementDialog<C, CW, W> {
-
- private final PropertyElement2<Integer> lowerBdProperty;
- private final PropertyElement2<Integer> upperBdProperty;
- private final PropertyElement2<Boolean> uniqueProperty;
- private final PropertyElement2<Boolean> orderedProperty;
- private final PropertyElement2<EClassifier> typeProperty;
-
- protected AbstractETypedElementDialog(final ETypedElement eTypedElement,
- final EditingDomain editingDomain) {
- super(eTypedElement, editingDomain);
- this.lowerBdProperty = new PropertyElement2<Integer>(true);
- this.upperBdProperty = new PropertyElement2<Integer>(true);
- this.typeProperty = new PropertyElement2<EClassifier>(true);
- this.orderedProperty = new PropertyElement2<Boolean>(true);
- this.uniqueProperty = new PropertyElement2<Boolean>(true);
- if (eTypedElement == null) {
- this.lowerBdProperty.setValue2(Integer.valueOf(0));
- this.upperBdProperty.setValue2(Integer.valueOf(1));
- } else {
- this.lowerBdProperty.setValue2(Integer.valueOf(eTypedElement
- .getLowerBound()));
- // Upper Bound
- this.upperBdProperty.setValue2(Integer.valueOf(eTypedElement
- .getUpperBound()));
- // EType
- this.typeProperty.setValue2(eTypedElement.getEType());
- // Ordered
- this.orderedProperty.setValue2(Boolean.valueOf(eTypedElement
- .isOrdered()));
- // Unique
- this.uniqueProperty.setValue2(Boolean.valueOf(eTypedElement
- .isUnique()));
- }
- }
-
- protected final PropertyElement2<Integer> getLowerBdProperty() {
- return this.lowerBdProperty;
- }
-
- protected final PropertyElement2<Integer> getUpperBdProperty() {
- return this.upperBdProperty;
- }
-
- protected final PropertyElement2<Boolean> getUniqueProperty() {
- return this.uniqueProperty;
- }
-
- protected final PropertyElement2<Boolean> getOrderedProperty() {
- return this.orderedProperty;
- }
-
- protected final PropertyElement2<EClassifier> getTypeProperty() {
- return this.typeProperty;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +public abstract class AbstractETypedElementDialog<C extends EObject, CW extends Object, W extends IETypedElementWidget<C, CW>> + extends AbstractENamedElementDialog<C, CW, W> { + + private final PropertyElement2<Integer> lowerBdProperty; + private final PropertyElement2<Integer> upperBdProperty; + private final PropertyElement2<Boolean> uniqueProperty; + private final PropertyElement2<Boolean> orderedProperty; + private final PropertyElement2<EClassifier> typeProperty; + + protected AbstractETypedElementDialog(final ETypedElement eTypedElement, + final EditingDomain editingDomain) { + super(eTypedElement, editingDomain); + this.lowerBdProperty = new PropertyElement2<Integer>(true); + this.upperBdProperty = new PropertyElement2<Integer>(true); + this.typeProperty = new PropertyElement2<EClassifier>(true); + this.orderedProperty = new PropertyElement2<Boolean>(true); + this.uniqueProperty = new PropertyElement2<Boolean>(true); + if (eTypedElement == null) { + this.lowerBdProperty.setValue2(Integer.valueOf(0)); + this.upperBdProperty.setValue2(Integer.valueOf(1)); + } else { + this.lowerBdProperty.setValue2(Integer.valueOf(eTypedElement + .getLowerBound())); + // Upper Bound + this.upperBdProperty.setValue2(Integer.valueOf(eTypedElement + .getUpperBound())); + // EType + this.typeProperty.setValue2(eTypedElement.getEType()); + // Ordered + this.orderedProperty.setValue2(Boolean.valueOf(eTypedElement + .isOrdered())); + // Unique + this.uniqueProperty.setValue2(Boolean.valueOf(eTypedElement + .isUnique())); + } + } + + protected final PropertyElement2<Integer> getLowerBdProperty() { + return this.lowerBdProperty; + } + + protected final PropertyElement2<Integer> getUpperBdProperty() { + return this.upperBdProperty; + } + + protected final PropertyElement2<Boolean> getUniqueProperty() { + return this.uniqueProperty; + } + + protected final PropertyElement2<Boolean> getOrderedProperty() { + return this.orderedProperty; + } + + protected final PropertyElement2<EClassifier> getTypeProperty() { + return this.typeProperty; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddAttributeInFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddAttributeInFacetDialog.java index d507da2b68e..9d8a21c9589 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddAttributeInFacetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddAttributeInFacetDialog.java @@ -1,66 +1,66 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Dialog for the edition of an attribute in a facet.
- */
-public class AddAttributeInFacetDialog extends
- AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> {
-
- /**
- * Constructor.
- *
- * @param selection
- * the selection in the model (ecore file).
- */
- public AddAttributeInFacetDialog(final Facet facet,
- final EditingDomain editingDomain) {
- super(null, editingDomain, new PropertyElement2<Facet>(false, facet));
- }
-
- @Override
- protected IEStructuralFeatureWidget createWidget() {
- final EditFacetAttributeWidget widget = new EditFacetAttributeWidget(
- this.getDialogComposite(),
- EFacetFactory.eINSTANCE.createFacetAttribute(),
- this.getEditingDomain(), this.getContainerProperty(),
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getUniqueProperty(),
- this.getQueryProperty(), this.getVolatileProperty(),
- this.getChangeableroperty(), this.getDerivedroperty(),
- this.getTransientProperty());
- return new SynchronizedEStructuralFeatureWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Add_an_Attribute_desc;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Add_an_Attribute;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Dialog for the edition of an attribute in a facet. + */ +public class AddAttributeInFacetDialog extends + AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> { + + /** + * Constructor. + * + * @param selection + * the selection in the model (ecore file). + */ + public AddAttributeInFacetDialog(final Facet facet, + final EditingDomain editingDomain) { + super(null, editingDomain, new PropertyElement2<Facet>(false, facet)); + } + + @Override + protected IEStructuralFeatureWidget createWidget() { + final EditFacetAttributeWidget widget = new EditFacetAttributeWidget( + this.getDialogComposite(), + EFacetFactory.eINSTANCE.createFacetAttribute(), + this.getEditingDomain(), this.getContainerProperty(), + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getUniqueProperty(), + this.getQueryProperty(), this.getVolatileProperty(), + this.getChangeableroperty(), this.getDerivedroperty(), + this.getTransientProperty()); + return new SynchronizedEStructuralFeatureWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Add_an_Attribute_desc; + } + + @Override + protected String getDialogTitle() { + return Messages.Add_an_Attribute; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddOperationInFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddOperationInFacetDialog.java index acfeb1676b5..c8886f5fb07 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddOperationInFacetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddOperationInFacetDialog.java @@ -1,74 +1,74 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Concrete dialog for the creation of an Operation in a facet.
- */
-public class AddOperationInFacetDialog extends
- AbstractDerivedTypedElementDialog<IDerivedTypedElementWidget> {
-
- private final Facet facet;
- private final PropertyElement2<Facet> facetProperty;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public AddOperationInFacetDialog(final Facet facet,
- final EditingDomain editingDomain) {
- super(null, editingDomain);
- this.facet = facet;
- this.facetProperty = new PropertyElement2<Facet>(false, facet);
- }
-
- @Override
- protected IDerivedTypedElementWidget createWidget() {
- final AddOperationInFacetWidget widget = new AddOperationInFacetWidget(
- this.getDialogComposite(),
- this.getEditingDomain(), this.facetProperty,
- this.getNameProperty(),
- this.getLowerBdProperty(), this.getUpperBdProperty(),
- this.getTypeProperty(), this.getOrderedProperty(),
- this.getUniqueProperty(), this.getQueryProperty());
- return new SynchronizedDerivedTypedElementWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Add_an_Operation_desc;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Add_an_Operation;
- }
-
- protected Facet getFacet() {
- return this.facet;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Concrete dialog for the creation of an Operation in a facet. + */ +public class AddOperationInFacetDialog extends + AbstractDerivedTypedElementDialog<IDerivedTypedElementWidget> { + + private final Facet facet; + private final PropertyElement2<Facet> facetProperty; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public AddOperationInFacetDialog(final Facet facet, + final EditingDomain editingDomain) { + super(null, editingDomain); + this.facet = facet; + this.facetProperty = new PropertyElement2<Facet>(false, facet); + } + + @Override + protected IDerivedTypedElementWidget createWidget() { + final AddOperationInFacetWidget widget = new AddOperationInFacetWidget( + this.getDialogComposite(), + this.getEditingDomain(), this.facetProperty, + this.getNameProperty(), + this.getLowerBdProperty(), this.getUpperBdProperty(), + this.getTypeProperty(), this.getOrderedProperty(), + this.getUniqueProperty(), this.getQueryProperty()); + return new SynchronizedDerivedTypedElementWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Add_an_Operation_desc; + } + + @Override + protected String getDialogTitle() { + return Messages.Add_an_Operation; + } + + protected Facet getFacet() { + return this.facet; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddParameterInOperationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddParameterInOperationDialog.java index b4bd1396c50..da4bbf7c0a7 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddParameterInOperationDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddParameterInOperationDialog.java @@ -1,71 +1,71 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Concrete Dialog for the creation of an Operation in a Facet.
- */
-public class AddParameterInOperationDialog
- extends
- AbstractETypedElementDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>, IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> {
-
- private final PropertyElement2<FacetOperation> operationProperty;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public AddParameterInOperationDialog(final FacetOperation selection,
- final EditingDomain editingDomain) {
- super(null, editingDomain);
- this.operationProperty = new PropertyElement2<FacetOperation>(false,
- selection);
- }
-
- @Override
- protected IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> createWidget() {
- final AddParameterInOperationWidget widget = new AddParameterInOperationWidget(
- this.getDialogComposite(),
- this.getEditingDomain(), this.operationProperty,
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getUniqueProperty());
- return new SynchronizedETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>(
- widget, widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Add_an_Operation_Parameter_desc;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Add_an_Operation_Parameter;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Concrete Dialog for the creation of an Operation in a Facet. + */ +public class AddParameterInOperationDialog + extends + AbstractETypedElementDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>, IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> { + + private final PropertyElement2<FacetOperation> operationProperty; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public AddParameterInOperationDialog(final FacetOperation selection, + final EditingDomain editingDomain) { + super(null, editingDomain); + this.operationProperty = new PropertyElement2<FacetOperation>(false, + selection); + } + + @Override + protected IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> createWidget() { + final AddParameterInOperationWidget widget = new AddParameterInOperationWidget( + this.getDialogComposite(), + this.getEditingDomain(), this.operationProperty, + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getUniqueProperty()); + return new SynchronizedETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>( + widget, widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Add_an_Operation_Parameter_desc; + } + + @Override + protected String getDialogTitle() { + return Messages.Add_an_Operation_Parameter; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddReferenceInFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddReferenceInFacetDialog.java index 594f8980cbe..8e0d02b7cf4 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddReferenceInFacetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddReferenceInFacetDialog.java @@ -1,69 +1,69 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Concrete Dialog for the creation of a Reference in a Facet.
- */
-public class AddReferenceInFacetDialog extends
- AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> {
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public AddReferenceInFacetDialog(final Facet facet,
- final EditingDomain editingDomain) {
- super(null, editingDomain, new PropertyElement2<Facet>(false, facet));
- }
-
- @Override
- protected IEStructuralFeatureWidget createWidget() {
- final EditFacetReferenceWidget widget = new EditFacetReferenceWidget(
- this.getDialogComposite(),
- EFacetFactory.eINSTANCE.createFacetReference(),
- this.getEditingDomain(), this.getContainerProperty(),
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getUniqueProperty(),
- this.getQueryProperty(), this.getVolatileProperty(),
- this.getChangeableroperty(), this.getDerivedroperty(),
- this.getTransientProperty());
- return new SynchronizedEStructuralFeatureWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Add_a_Reference_desc;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Add_a_Reference;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Concrete Dialog for the creation of a Reference in a Facet. + */ +public class AddReferenceInFacetDialog extends + AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> { + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public AddReferenceInFacetDialog(final Facet facet, + final EditingDomain editingDomain) { + super(null, editingDomain, new PropertyElement2<Facet>(false, facet)); + } + + @Override + protected IEStructuralFeatureWidget createWidget() { + final EditFacetReferenceWidget widget = new EditFacetReferenceWidget( + this.getDialogComposite(), + EFacetFactory.eINSTANCE.createFacetReference(), + this.getEditingDomain(), this.getContainerProperty(), + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getUniqueProperty(), + this.getQueryProperty(), this.getVolatileProperty(), + this.getChangeableroperty(), this.getDerivedroperty(), + this.getTransientProperty()); + return new SynchronizedEStructuralFeatureWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Add_a_Reference_desc; + } + + @Override + protected String getDialogTitle() { + return Messages.Add_a_Reference; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetInFacetSetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetInFacetSetDialog.java index a48ecc79e1d..82cf9e01bb2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetInFacetSetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetInFacetSetDialog.java @@ -1,83 +1,83 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Concrete Dialog for the creation of a Facet in a FacetSet.
- */
-public class CreateFacetInFacetSetDialog
- extends
- AbstractENamedElementDialog<
- FacetSet,
- IGetOrCreateFilteredFacetSetWidget,
- IFacetWidget> {
-
- private final PropertyElement2<FacetSet> facetSetProp;
- private final PropertyElement2<String> facetNameProp;
- private final PropertyElement2<EClass> extEClassProp;
- private final PropertyElement2<ETypedElement> conformProp;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public CreateFacetInFacetSetDialog(final FacetSet selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.facetSetProp = new PropertyElement2<FacetSet>(true);
- this.facetNameProp = new PropertyElement2<String>(true);
- this.extEClassProp = new PropertyElement2<EClass>(true);
- this.conformProp = new PropertyElement2<ETypedElement>(true);
- if (selection != null) {
- this.facetSetProp.setValue2(selection);
- }
- }
-
- @Override
- protected IFacetWidget createWidget() {
- final Facet facet = EFacetFactory.eINSTANCE.createFacet();
- final EditFacetWidget widget = new EditFacetWidget(
- this.getDialogComposite(), facet, this.getEditingDomain(),
- this.facetNameProp, this.facetSetProp, this.conformProp,
- this.extEClassProp);
- return new SynchronizedFacetWidget(widget, widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.CreateFacetInFacetSetWizardPage_wizard_description;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Create_facet_in_facetSet;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Concrete Dialog for the creation of a Facet in a FacetSet. + */ +public class CreateFacetInFacetSetDialog + extends + AbstractENamedElementDialog< + FacetSet, + IGetOrCreateFilteredFacetSetWidget, + IFacetWidget> { + + private final PropertyElement2<FacetSet> facetSetProp; + private final PropertyElement2<String> facetNameProp; + private final PropertyElement2<EClass> extEClassProp; + private final PropertyElement2<ETypedElement> conformProp; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public CreateFacetInFacetSetDialog(final FacetSet selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.facetSetProp = new PropertyElement2<FacetSet>(true); + this.facetNameProp = new PropertyElement2<String>(true); + this.extEClassProp = new PropertyElement2<EClass>(true); + this.conformProp = new PropertyElement2<ETypedElement>(true); + if (selection != null) { + this.facetSetProp.setValue2(selection); + } + } + + @Override + protected IFacetWidget createWidget() { + final Facet facet = EFacetFactory.eINSTANCE.createFacet(); + final EditFacetWidget widget = new EditFacetWidget( + this.getDialogComposite(), facet, this.getEditingDomain(), + this.facetNameProp, this.facetSetProp, this.conformProp, + this.extEClassProp); + return new SynchronizedFacetWidget(widget, widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.CreateFacetInFacetSetWizardPage_wizard_description; + } + + @Override + protected String getDialogTitle() { + return Messages.Create_facet_in_facetSet; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetSetInFacetSetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetSetInFacetSetDialog.java index 3e29c7535b7..51ab287459b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetSetInFacetSetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetSetInFacetSetDialog.java @@ -1,78 +1,78 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Concrete Dialog for the creation of a FacetSet in a FacetSet.
- */
-public class CreateFacetSetInFacetSetDialog extends
- AbstractENamedElementDialog<
- FacetSet,
- IGetOrCreateFilteredFacetSetWidget,
- IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>
- > {
-
- private final PropertyElement2<String> facetNameProperty;
- private final PropertyElement2<FacetSet> facetSetProperty;
-
- /**
- * Constructor.
- *
- * @param shell
- * the parent shell.
- * @param selection
- * the selection in the model (ecore file).
- */
- public CreateFacetSetInFacetSetDialog(final FacetSet selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.facetNameProperty = new PropertyElement2<String>(true);
- this.facetSetProperty = new PropertyElement2<FacetSet>(false);
- if (selection != null) {
- this.facetSetProperty.setValue2(selection);
- }
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Create_facetSet_in_facetSet;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.CreateFacetSetWizardImpl_Create_new_facet_Set;
- }
-
- @Override
- protected IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> createWidget() {
- final FacetSet editedFacetSet = EFacetFactory.eINSTANCE
- .createFacetSet();
- final EditFacetSetWidget widget = new EditFacetSetWidget(
- this.getDialogComposite(), editedFacetSet,
- this.getEditingDomain(), this.facetNameProperty,
- this.facetSetProperty);
- return new SynchronizedENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>(
- widget, widget.getDisplay());
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Concrete Dialog for the creation of a FacetSet in a FacetSet. + */ +public class CreateFacetSetInFacetSetDialog extends + AbstractENamedElementDialog< + FacetSet, + IGetOrCreateFilteredFacetSetWidget, + IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> + > { + + private final PropertyElement2<String> facetNameProperty; + private final PropertyElement2<FacetSet> facetSetProperty; + + /** + * Constructor. + * + * @param shell + * the parent shell. + * @param selection + * the selection in the model (ecore file). + */ + public CreateFacetSetInFacetSetDialog(final FacetSet selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.facetNameProperty = new PropertyElement2<String>(true); + this.facetSetProperty = new PropertyElement2<FacetSet>(false); + if (selection != null) { + this.facetSetProperty.setValue2(selection); + } + } + + @Override + protected String getDialogMessage() { + return Messages.Create_facetSet_in_facetSet; + } + + @Override + protected String getDialogTitle() { + return Messages.CreateFacetSetWizardImpl_Create_new_facet_Set; + } + + @Override + protected IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> createWidget() { + final FacetSet editedFacetSet = EFacetFactory.eINSTANCE + .createFacetSet(); + final EditFacetSetWidget widget = new EditFacetSetWidget( + this.getDialogComposite(), editedFacetSet, + this.getEditingDomain(), this.facetNameProperty, + this.facetSetProperty); + return new SynchronizedENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>( + widget, widget.getDisplay()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetAttributeDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetAttributeDialog.java index 8de4e0ce116..5595f74150b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetAttributeDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetAttributeDialog.java @@ -1,73 +1,73 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link FacetAttribute}.
- */
-public class EditFacetAttributeDialog extends
- AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> {
-
- private final FacetAttribute fAttribut;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param fAttribute
- * the selection in the model (ecore file).
- */
- public EditFacetAttributeDialog(final FacetAttribute fAttribute,
- final EditingDomain editingDomain) {
- super(fAttribute, editingDomain, new PropertyElement2<Facet>(true,
- (Facet) fAttribute.eContainer()));
- this.fAttribut = fAttribute;
- }
-
- @Override
- protected IEStructuralFeatureWidget createWidget() {
- final EditFacetAttributeWidget widget = new EditFacetAttributeWidget(
- this.getDialogComposite(), this.fAttribut,
- this.getEditingDomain(), this.getContainerProperty(),
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getUniqueProperty(),
- this.getQueryProperty(), this.getVolatileProperty(),
- this.getChangeableroperty(), this.getDerivedroperty(),
- this.getTransientProperty());
- return new SynchronizedEStructuralFeatureWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_FacetAttribute;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_FacetAttribute;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link FacetAttribute}. + */ +public class EditFacetAttributeDialog extends + AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> { + + private final FacetAttribute fAttribut; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param fAttribute + * the selection in the model (ecore file). + */ + public EditFacetAttributeDialog(final FacetAttribute fAttribute, + final EditingDomain editingDomain) { + super(fAttribute, editingDomain, new PropertyElement2<Facet>(true, + (Facet) fAttribute.eContainer())); + this.fAttribut = fAttribute; + } + + @Override + protected IEStructuralFeatureWidget createWidget() { + final EditFacetAttributeWidget widget = new EditFacetAttributeWidget( + this.getDialogComposite(), this.fAttribut, + this.getEditingDomain(), this.getContainerProperty(), + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getUniqueProperty(), + this.getQueryProperty(), this.getVolatileProperty(), + this.getChangeableroperty(), this.getDerivedroperty(), + this.getTransientProperty()); + return new SynchronizedEStructuralFeatureWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_FacetAttribute; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_FacetAttribute; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetDialog.java index fcb97beecdc..dc916dc35c3 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetDialog.java @@ -1,91 +1,91 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link Facet}.
- */
-public class EditFacetDialog extends
- AbstractENamedElementDialog<
- FacetSet,
- IGetOrCreateFilteredFacetSetWidget,
- IFacetWidget
- > {
-
- private final EditingDomain editingDomain;
- private final PropertyElement2<String> facetNameProperty;
- private final PropertyElement2<FacetSet> facetSetProperty;
- private final PropertyElement2<EClass> facetMetaclass;
- private final PropertyElement2<ETypedElement> conformProperty;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public EditFacetDialog(final Facet selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.editingDomain = editingDomain;
- this.facetNameProperty = new PropertyElement2<String>(true);
- this.facetSetProperty = new PropertyElement2<FacetSet>(true);
- this.facetMetaclass = new PropertyElement2<EClass>(true);
- this.conformProperty = new PropertyElement2<ETypedElement>(true);
- if (selection != null) {
- // Get the first element of the selection
- this.facetNameProperty.setValue2(selection.getName());
- this.facetSetProperty.setValue2((FacetSet) selection.eContainer());
- this.facetMetaclass.setValue2(selection.getExtendedMetaclass());
- this.conformProperty.setValue2(selection
- .getConformanceTypedElement());
- }
- }
-
- @Override
- protected IFacetWidget createWidget() {
- final EditFacetWidget widget = new EditFacetWidget(
- this.getDialogComposite(), (Facet) getSelection(),
- this.editingDomain, this.facetNameProperty,
- this.facetSetProperty, this.conformProperty,
- this.facetMetaclass);
- return new SynchronizedFacetWidget(
- widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_Facet;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_Facet;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link Facet}. + */ +public class EditFacetDialog extends + AbstractENamedElementDialog< + FacetSet, + IGetOrCreateFilteredFacetSetWidget, + IFacetWidget + > { + + private final EditingDomain editingDomain; + private final PropertyElement2<String> facetNameProperty; + private final PropertyElement2<FacetSet> facetSetProperty; + private final PropertyElement2<EClass> facetMetaclass; + private final PropertyElement2<ETypedElement> conformProperty; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public EditFacetDialog(final Facet selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.editingDomain = editingDomain; + this.facetNameProperty = new PropertyElement2<String>(true); + this.facetSetProperty = new PropertyElement2<FacetSet>(true); + this.facetMetaclass = new PropertyElement2<EClass>(true); + this.conformProperty = new PropertyElement2<ETypedElement>(true); + if (selection != null) { + // Get the first element of the selection + this.facetNameProperty.setValue2(selection.getName()); + this.facetSetProperty.setValue2((FacetSet) selection.eContainer()); + this.facetMetaclass.setValue2(selection.getExtendedMetaclass()); + this.conformProperty.setValue2(selection + .getConformanceTypedElement()); + } + } + + @Override + protected IFacetWidget createWidget() { + final EditFacetWidget widget = new EditFacetWidget( + this.getDialogComposite(), (Facet) getSelection(), + this.editingDomain, this.facetNameProperty, + this.facetSetProperty, this.conformProperty, + this.facetMetaclass); + return new SynchronizedFacetWidget( + widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_Facet; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_Facet; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationDialog.java index a7854fa588a..c9f01e66370 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationDialog.java @@ -1,75 +1,75 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractDerivedTypedElementDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link FacetOperation}.
- */
-public class EditFacetOperationDialog extends
- AbstractDerivedTypedElementDialog<IDerivedTypedElementWidget> {
-
- private final FacetOperation fOperation;
- private final PropertyElement2<Facet> facetProperty;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- * @param editingDomain
- * the current editing model.
- */
- public EditFacetOperationDialog(final FacetOperation fOperation,
- final EditingDomain editingDomain) {
- super(fOperation, editingDomain);
- this.fOperation = fOperation;
- this.facetProperty = new PropertyElement2<Facet>(false,
- (Facet) this.fOperation.eContainer());
- }
-
- @Override
- protected IDerivedTypedElementWidget createWidget() {
- final EditFacetOperationWidget widget = new EditFacetOperationWidget(
- this.getDialogComposite(),
- this.fOperation, this.getEditingDomain(), this.facetProperty,
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getUniqueProperty(),
- this.getQueryProperty());
- return new SynchronizedDerivedTypedElementWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_FacetOperation;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_FacetOperation;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractDerivedTypedElementDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link FacetOperation}. + */ +public class EditFacetOperationDialog extends + AbstractDerivedTypedElementDialog<IDerivedTypedElementWidget> { + + private final FacetOperation fOperation; + private final PropertyElement2<Facet> facetProperty; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + * @param editingDomain + * the current editing model. + */ + public EditFacetOperationDialog(final FacetOperation fOperation, + final EditingDomain editingDomain) { + super(fOperation, editingDomain); + this.fOperation = fOperation; + this.facetProperty = new PropertyElement2<Facet>(false, + (Facet) this.fOperation.eContainer()); + } + + @Override + protected IDerivedTypedElementWidget createWidget() { + final EditFacetOperationWidget widget = new EditFacetOperationWidget( + this.getDialogComposite(), + this.fOperation, this.getEditingDomain(), this.facetProperty, + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getUniqueProperty(), + this.getQueryProperty()); + return new SynchronizedDerivedTypedElementWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_FacetOperation; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_FacetOperation; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationParameterDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationParameterDialog.java index 5e6fd70b1bf..c69c74d15f6 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationParameterDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationParameterDialog.java @@ -1,75 +1,75 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractETypedElementDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationParameterWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link EParameter}.
- */
-public class EditFacetOperationParameterDialog
- extends
- AbstractETypedElementDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>, IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> {
-
- private final EditingDomain editingDomain;
- private final PropertyElement2<FacetOperation> operationProperty;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public EditFacetOperationParameterDialog(final EParameter selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.editingDomain = editingDomain;
- this.operationProperty = new PropertyElement2<FacetOperation>(false,
- (FacetOperation) selection.eContainer());
- }
-
- @Override
- protected IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> createWidget() {
- final EditFacetOperationParameterWidget widget = new EditFacetOperationParameterWidget(this.getDialogComposite(),
- (EParameter) getSelection(), this.editingDomain,
- this.operationProperty, this.getNameProperty(),
- this.getLowerBdProperty(), this.getUpperBdProperty(),
- this.getTypeProperty(), this.getOrderedProperty(),
- this.getUniqueProperty());
- return new SynchronizedETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>(
- widget, widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_FacetOperationParameter;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_FacetOperationParameter;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractETypedElementDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationParameterWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link EParameter}. + */ +public class EditFacetOperationParameterDialog + extends + AbstractETypedElementDialog<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>, IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> { + + private final EditingDomain editingDomain; + private final PropertyElement2<FacetOperation> operationProperty; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public EditFacetOperationParameterDialog(final EParameter selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.editingDomain = editingDomain; + this.operationProperty = new PropertyElement2<FacetOperation>(false, + (FacetOperation) selection.eContainer()); + } + + @Override + protected IETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> createWidget() { + final EditFacetOperationParameterWidget widget = new EditFacetOperationParameterWidget(this.getDialogComposite(), + (EParameter) getSelection(), this.editingDomain, + this.operationProperty, this.getNameProperty(), + this.getLowerBdProperty(), this.getUpperBdProperty(), + this.getTypeProperty(), this.getOrderedProperty(), + this.getUniqueProperty()); + return new SynchronizedETypedElementWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>( + widget, widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_FacetOperationParameter; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_FacetOperationParameter; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetReferenceDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetReferenceDialog.java index 7b4ff1f6628..68f07f22c31 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetReferenceDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetReferenceDialog.java @@ -1,74 +1,74 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link FacetReference}.
- */
-public class EditFacetReferenceDialog extends
- AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> {
-
- private final FacetReference facetReference;
-
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public EditFacetReferenceDialog(final FacetReference facetReference,
- final EditingDomain editingDomain) {
- super(facetReference, editingDomain, new PropertyElement2<Facet>(true,
- (Facet) facetReference.eContainer()));
- this.facetReference = facetReference;
- }
-
- @Override
- protected IEStructuralFeatureWidget createWidget() {
- final EditFacetReferenceWidget widget = new EditFacetReferenceWidget(
- this.getDialogComposite(), this.facetReference,
- this.getEditingDomain(), this.getContainerProperty(),
- this.getNameProperty(), this.getLowerBdProperty(),
- this.getUpperBdProperty(), this.getTypeProperty(),
- this.getOrderedProperty(), this.getOrderedProperty(),
- this.getQueryProperty(), this.getVolatileProperty(),
- this.getChangeableroperty(), this.getDerivedroperty(),
- this.getTransientProperty());
- return new SynchronizedEStructuralFeatureWidget(widget,
- widget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_FacetReference;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_FacetReference;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link FacetReference}. + */ +public class EditFacetReferenceDialog extends + AbstractEStructuralFeatureDialog<IEStructuralFeatureWidget> { + + private final FacetReference facetReference; + + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public EditFacetReferenceDialog(final FacetReference facetReference, + final EditingDomain editingDomain) { + super(facetReference, editingDomain, new PropertyElement2<Facet>(true, + (Facet) facetReference.eContainer())); + this.facetReference = facetReference; + } + + @Override + protected IEStructuralFeatureWidget createWidget() { + final EditFacetReferenceWidget widget = new EditFacetReferenceWidget( + this.getDialogComposite(), this.facetReference, + this.getEditingDomain(), this.getContainerProperty(), + this.getNameProperty(), this.getLowerBdProperty(), + this.getUpperBdProperty(), this.getTypeProperty(), + this.getOrderedProperty(), this.getOrderedProperty(), + this.getQueryProperty(), this.getVolatileProperty(), + this.getChangeableroperty(), this.getDerivedroperty(), + this.getTransientProperty()); + return new SynchronizedEStructuralFeatureWidget(widget, + widget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_FacetReference; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_FacetReference; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetSetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetSetDialog.java index c9d678eccaa..3c973a8143b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetSetDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetSetDialog.java @@ -1,70 +1,70 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * Widget for the edition of a {@link FacetSet}.
- */
-public class EditFacetSetDialog extends
- AbstractENamedElementDialog<FacetSet, IGetOrCreateFilteredFacetSetWidget, IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> {
-
- private final PropertyElement2<FacetSet> contrainerProp;
- private final FacetSet editedFacetSet;
-
- /**
- * Constructor.
- *
- * @param callback
- * the callback.
- * @param selection
- * the selection in the model (ecore file).
- */
- public EditFacetSetDialog(final FacetSet selection,
- final EditingDomain editingDomain) {
- super(selection, editingDomain);
- this.editedFacetSet = selection;
- this.contrainerProp = new PropertyElement2<FacetSet>(true, true);
- this.contrainerProp.setValue2((FacetSet) selection.eContainer());
- }
-
- @Override
- protected String getDialogMessage() {
- return Messages.Edit_FacetSet;
- }
-
- @Override
- protected String getDialogTitle() {
- return Messages.Edit_FacetSet;
- }
-
- @Override
- protected IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> createWidget() {
- final EditFacetSetWidget widget = new EditFacetSetWidget(
- this.getDialogComposite(), this.editedFacetSet,
- this.getEditingDomain(), this.getNameProperty(),
- this.contrainerProp);
- return new SynchronizedENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>(
- widget, widget.getDisplay());
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.edition; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * Widget for the edition of a {@link FacetSet}. + */ +public class EditFacetSetDialog extends + AbstractENamedElementDialog<FacetSet, IGetOrCreateFilteredFacetSetWidget, IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> { + + private final PropertyElement2<FacetSet> contrainerProp; + private final FacetSet editedFacetSet; + + /** + * Constructor. + * + * @param callback + * the callback. + * @param selection + * the selection in the model (ecore file). + */ + public EditFacetSetDialog(final FacetSet selection, + final EditingDomain editingDomain) { + super(selection, editingDomain); + this.editedFacetSet = selection; + this.contrainerProp = new PropertyElement2<FacetSet>(true, true); + this.contrainerProp.setValue2((FacetSet) selection.eContainer()); + } + + @Override + protected String getDialogMessage() { + return Messages.Edit_FacetSet; + } + + @Override + protected String getDialogTitle() { + return Messages.Edit_FacetSet; + } + + @Override + protected IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> createWidget() { + final EditFacetSetWidget widget = new EditFacetSetWidget( + this.getDialogComposite(), this.editedFacetSet, + this.getEditingDomain(), this.getNameProperty(), + this.contrainerProp); + return new SynchronizedENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>( + widget, widget.getDisplay()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java index 1457ba2a4a3..3d15cfb803e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java @@ -1,34 +1,34 @@ -/**
- * 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:
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exception;
-
-public class SdkUiRuntimeException extends RuntimeException {
-
- private static final long serialVersionUID = 6503448051517995525L;
-
- public SdkUiRuntimeException() {
- super();
- }
-
- public SdkUiRuntimeException(final String message) {
- super(message);
- }
-
- public SdkUiRuntimeException(final Throwable cause) {
- super(cause);
- }
-
- public SdkUiRuntimeException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
-}
+/** + * 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: + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exception; + +public class SdkUiRuntimeException extends RuntimeException { + + private static final long serialVersionUID = 6503448051517995525L; + + public SdkUiRuntimeException() { + super(); + } + + public SdkUiRuntimeException(final String message) { + super(message); + } + + public SdkUiRuntimeException(final Throwable cause) { + super(cause); + } + + public SdkUiRuntimeException(final String message, final Throwable cause) { + super(message, cause); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java index 3862fe0c611..438d9f97e69 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java @@ -1,41 +1,41 @@ -/**
- * 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:
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-
-public interface IQueryContext {
-
- Resource getResource();
-
- Facet getFacet();
-
- String getDerivedTypedElementName();
-
- EObject getIntermediateEObject();
-
- IProject getProject();
-
- EClassifier getReturnType();
-
- int getUpperBound();
-
- EClassifier getExtendedEClass();
-
- Query getQuery();
-
-}
+/** + * 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: + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported; + +import org.eclipse.core.resources.IProject; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; + +public interface IQueryContext { + + Resource getResource(); + + Facet getFacet(); + + String getDerivedTypedElementName(); + + EObject getIntermediateEObject(); + + IProject getProject(); + + EClassifier getReturnType(); + + int getUpperBound(); + + EClassifier getExtendedEClass(); + + Query getQuery(); + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java index e9a9a003c32..17b734e716c 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java @@ -1,38 +1,38 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class will be used for the creation of a java query.
- *
- * @see JavaQueryWidget
- */
-public interface IQueryDialogFactoryStrategy {
-
- IAbstractWidget createWidget(Composite parent,
- IQueryContext queryContext);
-
- Query createQuery(boolean canBeCached, boolean sideEffects,
- IQueryContext queryContext);
-
- String getDialogMessage();
-
- String getDialogTitle();
-
- String getConclusionText();
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget; +import org.eclipse.swt.widgets.Composite; + +/** + * This class will be used for the creation of a java query. + * + * @see JavaQueryWidget + */ +public interface IQueryDialogFactoryStrategy { + + IAbstractWidget createWidget(Composite parent, + IQueryContext queryContext); + + Query createQuery(boolean canBeCached, boolean sideEffects, + IQueryContext queryContext); + + String getDialogMessage(); + + String getDialogTitle(); + + String getConclusionText(); + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/dialog/query/IQueryDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/dialog/query/IQueryDialogFactory.java index 09211dbc9bf..708c2e89082 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/dialog/query/IQueryDialogFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/dialog/query/IQueryDialogFactory.java @@ -1,27 +1,27 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.dialog.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-
-/**
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IQueryDialogFactory extends IDialog<Object> {
-
- Query createQuery();
-
- String getConclusionText();
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.dialog.query; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; + +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IQueryDialogFactory extends IDialog<Object> { + + Query createQuery(); + + String getConclusionText(); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IDerivedTypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IDerivedTypedElementWidget.java index 1e7a8404cec..7ad535e40a5 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IDerivedTypedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IDerivedTypedElementWidget.java @@ -1,49 +1,49 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-
-/**
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IDerivedTypedElementWidget extends
- IETypedElementWidget<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> {
-
- Query getQuery();
-
- void setQuery(Query value);
-
- /**
- * Select the query with the name in parameter.
- *
- * @param queryName
- * the name of the query to select.
- */
- IDialog<ICreateQueryWidget> selectQueryType(String queryName);
-
- /**
- * @return true if the query is enable.
- */
- boolean isQueryEnable();
-
- /**
- * @return the text displayed with the query.
- */
- String getQueryText();
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; + +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IDerivedTypedElementWidget extends + IETypedElementWidget<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> { + + Query getQuery(); + + void setQuery(Query value); + + /** + * Select the query with the name in parameter. + * + * @param queryName + * the name of the query to select. + */ + IDialog<ICreateQueryWidget> selectQueryType(String queryName); + + /** + * @return true if the query is enable. + */ + boolean isQueryEnable(); + + /** + * @return the text displayed with the query. + */ + String getQueryText(); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IENamedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IENamedElementWidget.java index 16574375321..4be7a18990e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IENamedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IENamedElementWidget.java @@ -1,48 +1,48 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
-
-/**
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IENamedElementWidget<C extends EObject, CW extends Object>
- extends ICommandWidget {
-
- /**
- * Press the get or create parent button.
- *
- * @return the dialog open when the button is pressed.
- */
- IDialog<CW> pressParentButton();
-
- /**
- * @return the name of the element.
- */
- String getElementName();
-
- /**
- * Set the name of the element.
- *
- * @param value
- * the name.
- */
- void setName(String value);
-
- C getContainer();
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget; + +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IENamedElementWidget<C extends EObject, CW extends Object> + extends ICommandWidget { + + /** + * Press the get or create parent button. + * + * @return the dialog open when the button is pressed. + */ + IDialog<CW> pressParentButton(); + + /** + * @return the name of the element. + */ + String getElementName(); + + /** + * Set the name of the element. + * + * @param value + * the name. + */ + void setName(String value); + + C getContainer(); + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IEStructuralFeatureWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IEStructuralFeatureWidget.java index 08798b48d79..df0f78452c8 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IEStructuralFeatureWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IEStructuralFeatureWidget.java @@ -1,37 +1,37 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget;
-
-
-/**
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IEStructuralFeatureWidget extends IDerivedTypedElementWidget {
-
- boolean isTransient();
-
- void setTransient(boolean value);
-
- boolean isVolatile();
-
- void setVolatile(boolean value);
-
- boolean isChangeable();
-
- void setChangeable(boolean value);
-
- boolean isDerived();
-
- void setDerived(boolean value);
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget; + + +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IEStructuralFeatureWidget extends IDerivedTypedElementWidget { + + boolean isTransient(); + + void setTransient(boolean value); + + boolean isVolatile(); + + void setVolatile(boolean value); + + boolean isChangeable(); + + void setChangeable(boolean value); + + boolean isDerived(); + + void setDerived(boolean value); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IETypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IETypedElementWidget.java index 03c497a0575..7f43f08f0f1 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IETypedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IETypedElementWidget.java @@ -1,56 +1,56 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard;
-
-/**
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IETypedElementWidget<C extends EObject, CW extends Object>
- extends
- IENamedElementWidget<C, CW> {
-
- boolean isOrdered();
-
- void setOrdered(boolean value);
-
- boolean isUnique();
-
- void setUnique(boolean value);
-
- int getLowerBound();
-
- void setLowerBound(int value);
-
- int getUpperBound();
-
- void setUpperBound(int value);
-
- EClassifier getEType();
-
- void setEType(EClassifier value);
-
- /**
- * Press the button to select the type.
- */
- ISelectETypeWizard<EClassifier> pressTypeButton();
-
- /**
- * @return the type of the element.
- */
- String getElementTypeName();
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard; + +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IETypedElementWidget<C extends EObject, CW extends Object> + extends + IENamedElementWidget<C, CW> { + + boolean isOrdered(); + + void setOrdered(boolean value); + + boolean isUnique(); + + void setUnique(boolean value); + + int getLowerBound(); + + void setLowerBound(int value); + + int getUpperBound(); + + void setUpperBound(int value); + + EClassifier getEType(); + + void setEType(EClassifier value); + + /** + * Press the button to select the type. + */ + ISelectETypeWizard<EClassifier> pressTypeButton(); + + /** + * @return the type of the element. + */ + String getElementTypeName(); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IFacetWidget.java index 6573bca65b0..600ec3f975b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IFacetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IFacetWidget.java @@ -1,32 +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:
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget;
-
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-
-public interface IFacetWidget extends
- IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> {
-
- void setSubTypingFacetSelection(final boolean enable);
-
- IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton();
-
- String getSubTypingFacet();
-
- IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget();
-
+/** + * 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: + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget; + +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; + +public interface IFacetWidget extends + IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> { + + void setSubTypingFacetSelection(final boolean enable); + + IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton(); + + String getSubTypingFacet(); + + IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget(); + }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/getorcreate/IGetOrCreateFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/getorcreate/IGetOrCreateFacetSetWidget.java index 7722d9a5fa3..97552829efa 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/getorcreate/IGetOrCreateFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/getorcreate/IGetOrCreateFacetSetWidget.java @@ -1,35 +1,35 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget;
-
-/**
- * Interface for {@link GetOrCreateFacetSetWidget}.
- *
- * @see GetOrCreateFacetSetWidget
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IGetOrCreateFacetSetWidget extends
- IAbstractGetOrCreateElementWithButtonWidget<IDialog<IGetOrCreateFilteredFacetSetWidget>> {
-
- /**
- * @return the {@link FacetSet} selected.
- */
- FacetSet getFacetSet();
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget; + +/** + * Interface for {@link GetOrCreateFacetSetWidget}. + * + * @see GetOrCreateFacetSetWidget + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IGetOrCreateFacetSetWidget extends + IAbstractGetOrCreateElementWithButtonWidget<IDialog<IGetOrCreateFilteredFacetSetWidget>> { + + /** + * @return the {@link FacetSet} selected. + */ + FacetSet getFacetSet(); }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/metaclass/IGetExtendedMetaclassWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/metaclass/IGetExtendedMetaclassWidget.java index 25d97706f10..a2257f8a17b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/metaclass/IGetExtendedMetaclassWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/metaclass/IGetExtendedMetaclassWidget.java @@ -1,21 +1,21 @@ -/**
- * 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:
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget;
-
-public interface IGetExtendedMetaclassWidget extends
- IAbstractGetOrCreateElementWithButtonWidget<ISelectETypeWizard<EClass>> {
- // This interface is juste dedicated to simplify the method's signatures
-}
+/** + * 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: + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget; + +public interface IGetExtendedMetaclassWidget extends + IAbstractGetOrCreateElementWithButtonWidget<ISelectETypeWizard<EClass>> { + // This interface is juste dedicated to simplify the method's signatures +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/query/ICreateQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/query/ICreateQueryWidget.java index de8052987a3..80a9ed1e990 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/query/ICreateQueryWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/component/query/ICreateQueryWidget.java @@ -1,31 +1,31 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
-
-
-/**
- * @see CreateQueryWidget
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface ICreateQueryWidget extends ICommandWidget {
-
- Object getCreateQueryWidget();
-
- boolean isCanBeCached();
-
- boolean isHasSideEffect();
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget; + + +/** + * @see CreateQueryWidget + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface ICreateQueryWidget extends ICommandWidget { + + Object getCreateQueryWidget(); + + boolean isCanBeCached(); + + boolean isHasSideEffect(); }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/ICreateFacetInFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/ICreateFacetInFacetSetWidget.java index 01e0ade2bc1..5479552494e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/ICreateFacetInFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/ICreateFacetInFacetSetWidget.java @@ -1,62 +1,62 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation;
-
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
-
-/**
- * @see CreateFacetInFacetSetWidget
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface ICreateFacetInFacetSetWidget extends
- IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> {
-
- /**
- * @return the getOrCreateFacetSetWidget
- */
- IGetOrCreateFacetSetWidget getGetOrCreateFacetSetWidget();
-
- /**
- * @return the selectSubTypingTypeWidget
- */
- IAbstractWidget getSelectSubTypingTypeWidget();
-
- /**
- * @return the getFacetNameWidget
- */
- AbstractGetElementNameWidget getGetFacetNameWidget();
-
- /**
- * @return the getExtendedMetaclassWidget
- */
- IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget();
-
- /**
- * @return the name of the sub-typing widget.
- */
- String getSubTypingFacet();
-
- IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton();
-
- void setSubTypingFacetSelection(final boolean enable);
-
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation; + +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget; + +/** + * @see CreateFacetInFacetSetWidget + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface ICreateFacetInFacetSetWidget extends + IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> { + + /** + * @return the getOrCreateFacetSetWidget + */ + IGetOrCreateFacetSetWidget getGetOrCreateFacetSetWidget(); + + /** + * @return the selectSubTypingTypeWidget + */ + IAbstractWidget getSelectSubTypingTypeWidget(); + + /** + * @return the getFacetNameWidget + */ + AbstractGetElementNameWidget getGetFacetNameWidget(); + + /** + * @return the getExtendedMetaclassWidget + */ + IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget(); + + /** + * @return the name of the sub-typing widget. + */ + String getSubTypingFacet(); + + IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton(); + + void setSubTypingFacetSelection(final boolean enable); + }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/IGetOrCreateFilteredFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/IGetOrCreateFilteredFacetSetWidget.java index 7b6fdcc4a6b..5095e5b28e4 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/IGetOrCreateFilteredFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/IGetOrCreateFilteredFacetSetWidget.java @@ -1,26 +1,26 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-
-public interface IGetOrCreateFilteredFacetSetWidget
- extends
- IGetOrCreateFilteredElementCommmandWidget<
- FacetSet,
- IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>
- > {
- // This interfacet is just a type declaration shortcut
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; + +public interface IGetOrCreateFilteredFacetSetWidget + extends + IGetOrCreateFilteredElementCommmandWidget< + FacetSet, + IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> + > { + // This interfacet is just a type declaration shortcut }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/IWizardFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/IWizardFactory.java index 0ae2a5e497c..28cfc9889c0 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/IWizardFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/IWizardFactory.java @@ -1,36 +1,36 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.WizardFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
-
-/**
- * Factory for the wizards creation.
- *
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IWizardFactory {
-
- IWizardFactory INSTANCE = new WizardFactory();
-
- /**
- * Create a concrete instance of {@link ICreateFacetSetWizard}
- *
- * @param selection
- * the original selection for the wizard.
- * @return a new instance of {@link ICreateFacetSetWizard}
- */
- IExtendedWizard createCreateFacetSetWizard(ISelection selection);
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.WizardFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard; + +/** + * Factory for the wizards creation. + * + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IWizardFactory { + + IWizardFactory INSTANCE = new WizardFactory(); + + /** + * Create a concrete instance of {@link ICreateFacetSetWizard} + * + * @param selection + * the original selection for the wizard. + * @return a new instance of {@link ICreateFacetSetWizard} + */ + IExtendedWizard createCreateFacetSetWizard(ISelection selection); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/ICreateFacetSetWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/ICreateFacetSetWizardPage.java index 75a5469de68..e30357eada2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/ICreateFacetSetWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/ICreateFacetSetWizardPage.java @@ -1,40 +1,40 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage;
-
-/**
- * @see CreateFacetSetWizardPage
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface ICreateFacetSetWizardPage extends IWizardPage {
-
- /**
- * @return the model file.
- */
- IFile getModelFile();
-
- /**
- * @return the model file name.
- */
- String getFileName();
-
- /**
- * @param fileName
- */
- void setFileName(String fileName);
-
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page; + +import org.eclipse.core.resources.IFile; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage; + +/** + * @see CreateFacetSetWizardPage + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface ICreateFacetSetWizardPage extends IWizardPage { + + /** + * @return the model file. + */ + IFile getModelFile(); + + /** + * @return the model file name. + */ + String getFileName(); + + /** + * @param fileName + */ + void setFileName(String fileName); + }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/IFacetSetPropertyWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/IFacetSetPropertyWizardPage.java index c940b69379c..eb886ec6db3 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/IFacetSetPropertyWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/IFacetSetPropertyWizardPage.java @@ -1,50 +1,50 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage;
-
-/**
- * @see FacetSetPropertyWizardPage
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IFacetSetPropertyWizardPage extends IWizardPage {
-
- /**
- * @return the nsURI.
- */
- String getNsUri();
-
- /**
- * Set the nsURI.
- *
- * @param nsUri
- * the nsURI to set.
- */
- void setNsUri(String nsUri);
-
- /**
- * @return the prefix.
- */
- String getPrefix();
-
- /**
- * Set the prefix.
- *
- * @param prefix
- * the prefix to set.
- */
- void setPrefix(String prefix);
-
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page; + +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage; + +/** + * @see FacetSetPropertyWizardPage + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IFacetSetPropertyWizardPage extends IWizardPage { + + /** + * @return the nsURI. + */ + String getNsUri(); + + /** + * Set the nsURI. + * + * @param nsUri + * the nsURI to set. + */ + void setNsUri(String nsUri); + + /** + * @return the prefix. + */ + String getPrefix(); + + /** + * Set the prefix. + * + * @param prefix + * the prefix to set. + */ + void setPrefix(String prefix); + }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddAttributeInFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddAttributeInFacetHandler.java index 45988a4a4d0..35058112d60 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddAttributeInFacetHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddAttributeInFacetHandler.java @@ -1,33 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * Handler for the creation of an Attribute in a Facet.
- */
-public class AddAttributeInFacetHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return Facet.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE.openAddAttributeInFacetDialog();
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * Handler for the creation of an Attribute in a Facet. + */ +public class AddAttributeInFacetHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return Facet.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE.openAddAttributeInFacetDialog(); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddOperationInFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddOperationInFacetHandler.java index fb413ea2d4f..504b1337d63 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddOperationInFacetHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddOperationInFacetHandler.java @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * Handler for the creation of an Operation in a Facet.
- */
-public class AddOperationInFacetHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return Facet.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE.openAddOperationInFacetDialog();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * Handler for the creation of an Operation in a Facet. + */ +public class AddOperationInFacetHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return Facet.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE.openAddOperationInFacetDialog(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddParameterInOperationHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddParameterInOperationHandler.java index 42d3ffb8634..5420b7c8b23 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddParameterInOperationHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddParameterInOperationHandler.java @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * Handler for the creation of a Parameter in an Operation.
- */
-public class AddParameterInOperationHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return FacetOperation.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE.openAddParameterInOperationDialog();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * Handler for the creation of a Parameter in an Operation. + */ +public class AddParameterInOperationHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return FacetOperation.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE.openAddParameterInOperationDialog(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddReferenceInFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddReferenceInFacetHandler.java index 35739774bb8..c6f259c17e7 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddReferenceInFacetHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddReferenceInFacetHandler.java @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * Handler for the creation of a Reference in a Facet.
- */
-public class AddReferenceInFacetHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return Facet.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE.openAddReferenceInFacetDialog();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * Handler for the creation of a Reference in a Facet. + */ +public class AddReferenceInFacetHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return Facet.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE.openAddReferenceInFacetDialog(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetInFacetSetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetInFacetSetHandler.java index cec1c80e290..62b9b757f96 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetInFacetSetHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetInFacetSetHandler.java @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * Handler for the creation of an Facet in a FacetSet.
- */
-public class CreateFacetInFacetSetHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return FacetSet.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE.openCreateFacetInFacetSetDialog();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * Handler for the creation of an Facet in a FacetSet. + */ +public class CreateFacetInFacetSetHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return FacetSet.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE.openCreateFacetInFacetSetDialog(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetSetInFacetSetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetSetInFacetSetHandler.java index d6905623466..01ab6c7b42a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetSetInFacetSetHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetSetInFacetSetHandler.java @@ -1,33 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-/**
- * The concrete handler for the creation of a FacetSet in a FacetSet.
- */
-public class CreateFacetSetInFacetSetHandler extends AbstractSelectionExpectedTypeHandler {
-
- @Override
- protected Class<?> getSelectionExpectedType() {
- return FacetSet.class;
- }
-
- public Object execute(final ExecutionEvent event) {
- return IFacetDialogFactory.INSTANCE
- .openCreateFacetSetInFacetSetDialog();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +/** + * The concrete handler for the creation of a FacetSet in a FacetSet. + */ +public class CreateFacetSetInFacetSetHandler extends AbstractSelectionExpectedTypeHandler { + + @Override + protected Class<?> getSelectionExpectedType() { + return FacetSet.class; + } + + public Object execute(final ExecutionEvent event) { + return IFacetDialogFactory.INSTANCE + .openCreateFacetSetInFacetSetDialog(); + } +} 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 index 24d4acde0e0..7b2b66da706 100644 --- 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 @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.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 index 63e8f84fb40..51fa624d7da 100644 --- 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 @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.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 index 640ac601e4c..3f1b27ac827 100644 --- 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 @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.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 index dce4cbef0f2..6da198f0ad5 100644 --- 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 @@ -1,33 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.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 index 6ffd0101114..26f0392ec94 100644 --- 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 @@ -1,32 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.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 index 69cf58f9eec..9a4a5da6af3 100644 --- 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 @@ -1,45 +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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.handler.HandlerUtils;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
-
-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();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.handler.HandlerUtils; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler; + +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(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties index 8567f7a45cd..b68d84de61e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties @@ -1,177 +1,177 @@ -##########################################################################
-# Copyright (c) 2011, 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:
-# Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
-# Nicolas Bros (Mia-Software) - Bug 370442 - rewrite the Facet loading dialog for v0.2
-# Grégoire Dupé (Mia-Software) - copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties
-# Nicolas Bros (Mia-Software) - copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties
-# Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
-# Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
-# Nicolas Bros (Mia-Software) - Bug 372865 - FacetSet selection dialog
-# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
-# Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
-###########################################################################
-Changeable=Changeable
-Derived=Derived
-Ordered=Ordered
-Transient=Transient
-Unique=Unique
-Volatile=Volatile
-Enter_a_nsUri=Enter a nsUri :
-Please_enter_nsUri=Please enter a nsUri
-Enter_a_prefix=Enter a prefix :
-ETypedElementSelectionControl_ClassicView=Classic View
-ETypedElementSelectionControl_invalidSelection=The selection contains invalid elements
-ETypedElementSelectionControl_invalidSelectionAtLeastOneElement=You must select at least 1 element
-ETypedElementSelectionControl_invalidSelectionAtMostXElements=You must select at most {0} elements
-ETypedElementSelectionControl_invalidSelectionETypedElementsOnly=Only ETypedElements can be selected
-ETypedElementSelectionDialog_dialogTitle=Select ETypedElement
-ETypedElementSelectionDialog_dialogTitleMultiSelection=Select ETypedElements
-ETypedElementSelectionDialog_radioButtonMultiSelection=ETypedElements selected below:
-ETypedElementSelectionDialog_radioButtonNoSelection=No selection
-ETypedElementSelectionDialog_radioButtonSingleSelection=ETypedElement selected below:
-ETypedElementSelectionSortedControl_metamodelView=Metamodel View
-ETypedElementSelectionSortedControl_toolTip=Display possible values sorted by metamodels
-Please_enter_prefix=Please enter a prefix
-Please_select_EPackage=Please, select an EPackage
-Select_query_type=Select a query
-Add_an_Attribute=Add an attribute
-Add_an_Attribute_desc=Add a new attribute to the selected facet
-Attribute_name=Attribute name:
-Operation=Operation :
-Facet=Facet :
-Facet_mustGiveFacetName=You must give a Facet name
-Facet_mustGiveReferenceName=You must give a Reference Name
-Facet_mustGiveOperationName=You must give a Operation Name
-Facet_mustGiveParameterName=You must give an Operation Parameter Name
-FacetSet=FacetSet :
-FacetSet_mustSelectFacetSet=You must select a FacetSet
-FacetSet_mustGiveFacetSetName=You must give a FacetSet name
-FacetSetsCatalogView_categoriesColumn=Categories
-FacetSetsCatalogView_documentationColumn=Documentation
-FacetSetsCatalogView_extendsColumn=Extends
-FacetSetsCatalogView_nameColumn=Name
-FacetSetsCatalogView_viewTitle=Facet Sets
-FacetSetSelectionControl_mustSelectAtLeastOneElement=You must select at least 1 element
-FacetSetSelectionControl_mustSelectAtMostNElements=You must select at most {0} elements
-FacetSetSelectionControl_onlyFacetSetsAllowedInSelection=Only FacetSets can be selected
-FacetSetSelectionControl_selectionContainsInvalidElements=The selection contains invalid elements
-FacetSetSelectionDialog_deselectAll=Deselect All
-FacetSetSelectionDialog_selectAll=Select All
-FacetSetSelectionDialog_titleSelectFacetSet=Select FacetSet
-FacetSetSelectionDialog_titleSelectFacetSets=Select FacetSets
-
-GetOrCreate_FacetSet_message=Select or create a FacetSet
-Select_FacetSet=Select a FacetSet
-GetOrCreate_Facet_message=Select or create a Facet
-Select_Facet=Select a Facet
-GetOrCreate_Operation_message=Select or create an Operation
-Select_Operation=Select an Operation
-Facet_mustSelectFacet=You must select a Facet
-Facet_mustSelectQuery=You must select a Query
-Facet_mustGiveAttributeName=You must give a Facet name
-Facet_mustSelectConformanceType=You must select a conformance type
-Operation_mustSelectOperation=You must select an Operation
-Type_mustSelectType=You must select a Type
-Lower_bound=Lower Bound :
-Upper_bound=Upper Bound :
-Add_a_Reference=Add a reference
-Add_an_Operation=Add an Operation
-Add_an_Operation_desc=Add a new operation to the selected facet
-Add_an_Operation_Parameter=Add an Operation Parameter
-Add_an_Operation_Parameter_desc=Add a new operation's parameter to the selected operation
-Operation_name=Operation Name:
-Parameter_name=Parameter Name:
-Add_a_Reference_desc=Add a reference to the selected facet
-Create=Create
-Create_FacetSet_Model=Create FacetSet Model
-CreateFacetInFacetSetWidget_FacetSetName=Facet Set Name
-CreateFacetInFacetSetWizardPage_could_not_find_wizard_page=Could not find the wizard for this query type
-Create_facet_in_facetSet=Create a Facet in a FacetSet
-Create_facetSet_in_facetSet=Create a Facet in a FacetSet
-Please_enter_value_for=Please enter a value for {0}
-CreateFacetInFacetSetWizardPage_Please_fill_extendedMetaClass=Please fill the extendedMetaClass field
-CreateFacetInFacetSetWizardPage_Sub_Typing_Facet=SubTyping Facet
-CreateFacetInFacetSetWizardPage_wizard_description=This wizard creates a new facet in a facetSet.
-CreateFacetSetWizardImpl_Create_new_facet_Set=Create a new Facet Set
-CreateFacetSetWizardImpl_FacetModel=Facet Set
-CreateFacetSetWizardImpl_File_extension_restriction=File extension has to be ".efacet"
-CreateFacetSetWizardPage_Not_a_Plugin_project=Warning : you are creating this FacetSet in a non-Plugin project. It will not be available until moved to a Plugin project.
-Create_Query=Create Query:
-Load_MetaModel_Resource=Load Meta-model Resource
-FacetSetSelectionDialog_selectFacetSetsMessage=Choose FacetSets:
-FacetSetSelectionDialog_selectFacetSetsTitle=Select FacetSets
-Package_Selection=Package Selection
-Select_Registered_URI=&Select a registered package URI:
-
-SelectQueryTypeWizardPage_No_wizard_found=No wizard page extension was found for the selected query type. Wizard pages have to be registered using queryFactoryWizardPageRegistration extension point
-SelectQueryTypeWizardPage_Query_Type=Query Type :
-JavaQueryWizardPage_Can_be_cached=Can be cached :
-JavaQueryWizardPage_has_side_effect=Has side effect :
-JavaQueryWizardPage_Query_name=Query name :
-Reference_name=Reference name:
-
-Select=Select
-Type=Type :
-New=New...
-Select_EClass=Select an EClass
-Select_EClassifier=Select an EClassifier
-Select_EDataType=Select an EDataType
-Select_EPackage=Select an EPackage
-Select_ETypedElement= Select an ETypedElement
-
-Query_name=Query name :
-Query_Select_Name_And_Type=You have to select a name and a type before the query
-
-#### Begin: copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties
-QueryExecutionView_0=Missing bundle...
-QueryExecutionView_1=To execute the query, the depending bundle {0} must be installed. It will not be hot loaded.
-QueryExecutionView_classpathWarning=The output location of the Java project "{0}" was not found in its Bundle-ClassPath. This prevents the Java queries implementations it contains from being loaded.
-QueryExecutionView_errorInBundleClasspath=Error in Bundle-ClassPath
-QueryExecutionView_execEnvNotAvailable=Execution environment not available
-QueryExecutionView_execEnvError=To execute the query the execution environment {0} is required but not available. The available execution environments are: {1}
-QueryExecutionView_Context=Context
-QueryExecutionView_DisplayResultIn=Display result in:
-QueryExecutionView_dragAndDropHint=drag&drop model elements here
-QueryExecutionView_ErrorExecutingQuery=Error executing query
-QueryExecutionView_ETypeElementsGroup=ETypeElements
-QueryExecutionView_ExecuteButton=E&xecute
-QueryExecutionView_ExecuteGroup=Execute
-QueryExecutionView_NoQueryDisplayer=No Query Displayer
-QueryExecutionView_NoQuerySelected=No query
-QueryExecutionView_notImplementedYet=<Not implemented yet>
-QueryExecutionView_NullQueryResult=Null query result
-QueryExecutionView_Parameters=Parameters
-QueryExecutionView_Query=Query
-QueryExecutionView_QueryException=Query exception
-QueryExecutionView_QueryReturnedNull=Query returned a null result (see error log)
-QueryExecutionView_SelectQueryToExecute=You must select a query to execute
-
-Query_Query_Name=Query name :
-Query_has_side_effect=Has side effect :
-Query_Can_be_cached=Can be cached :
-
-Metaclass_mustSelectMetaclass=You must select a MetaClass
-ExtendedMetaClass=&Extended Meta-Class:
-#### End: copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties
-
-#### Edition
-Edit_FacetSet=Edit a FacetSet
-Edit_Facet=Edit a Facet
-Edit_FacetAttribute=Edit a Facet Attribute
-Edit_FacetReference=Edit a Facet Reference
-Edit_FacetOperation=Edit a Facet Operation
-Edit_FacetOperationParameter=Edit a Facet Operation Parameter
-EditFacetSetWidget_FacetSetName=Facet Set Name
-EditFacetWidget_FacetName=Facet Name
-
-GetSubTypingType_message=Select a Sub typing type
-GetSubTypingType_title=Select a Sub typing type
-
+########################################################################## +# Copyright (c) 2011, 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: +# Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor +# Nicolas Bros (Mia-Software) - Bug 370442 - rewrite the Facet loading dialog for v0.2 +# Grégoire Dupé (Mia-Software) - copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties +# Nicolas Bros (Mia-Software) - copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties +# Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet. +# Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 +# Nicolas Bros (Mia-Software) - Bug 372865 - FacetSet selection dialog +# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors +# Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors +########################################################################### +Changeable=Changeable +Derived=Derived +Ordered=Ordered +Transient=Transient +Unique=Unique +Volatile=Volatile +Enter_a_nsUri=Enter a nsUri : +Please_enter_nsUri=Please enter a nsUri +Enter_a_prefix=Enter a prefix : +ETypedElementSelectionControl_ClassicView=Classic View +ETypedElementSelectionControl_invalidSelection=The selection contains invalid elements +ETypedElementSelectionControl_invalidSelectionAtLeastOneElement=You must select at least 1 element +ETypedElementSelectionControl_invalidSelectionAtMostXElements=You must select at most {0} elements +ETypedElementSelectionControl_invalidSelectionETypedElementsOnly=Only ETypedElements can be selected +ETypedElementSelectionDialog_dialogTitle=Select ETypedElement +ETypedElementSelectionDialog_dialogTitleMultiSelection=Select ETypedElements +ETypedElementSelectionDialog_radioButtonMultiSelection=ETypedElements selected below: +ETypedElementSelectionDialog_radioButtonNoSelection=No selection +ETypedElementSelectionDialog_radioButtonSingleSelection=ETypedElement selected below: +ETypedElementSelectionSortedControl_metamodelView=Metamodel View +ETypedElementSelectionSortedControl_toolTip=Display possible values sorted by metamodels +Please_enter_prefix=Please enter a prefix +Please_select_EPackage=Please, select an EPackage +Select_query_type=Select a query +Add_an_Attribute=Add an attribute +Add_an_Attribute_desc=Add a new attribute to the selected facet +Attribute_name=Attribute name: +Operation=Operation : +Facet=Facet : +Facet_mustGiveFacetName=You must give a Facet name +Facet_mustGiveReferenceName=You must give a Reference Name +Facet_mustGiveOperationName=You must give a Operation Name +Facet_mustGiveParameterName=You must give an Operation Parameter Name +FacetSet=FacetSet : +FacetSet_mustSelectFacetSet=You must select a FacetSet +FacetSet_mustGiveFacetSetName=You must give a FacetSet name +FacetSetsCatalogView_categoriesColumn=Categories +FacetSetsCatalogView_documentationColumn=Documentation +FacetSetsCatalogView_extendsColumn=Extends +FacetSetsCatalogView_nameColumn=Name +FacetSetsCatalogView_viewTitle=Facet Sets +FacetSetSelectionControl_mustSelectAtLeastOneElement=You must select at least 1 element +FacetSetSelectionControl_mustSelectAtMostNElements=You must select at most {0} elements +FacetSetSelectionControl_onlyFacetSetsAllowedInSelection=Only FacetSets can be selected +FacetSetSelectionControl_selectionContainsInvalidElements=The selection contains invalid elements +FacetSetSelectionDialog_deselectAll=Deselect All +FacetSetSelectionDialog_selectAll=Select All +FacetSetSelectionDialog_titleSelectFacetSet=Select FacetSet +FacetSetSelectionDialog_titleSelectFacetSets=Select FacetSets + +GetOrCreate_FacetSet_message=Select or create a FacetSet +Select_FacetSet=Select a FacetSet +GetOrCreate_Facet_message=Select or create a Facet +Select_Facet=Select a Facet +GetOrCreate_Operation_message=Select or create an Operation +Select_Operation=Select an Operation +Facet_mustSelectFacet=You must select a Facet +Facet_mustSelectQuery=You must select a Query +Facet_mustGiveAttributeName=You must give a Facet name +Facet_mustSelectConformanceType=You must select a conformance type +Operation_mustSelectOperation=You must select an Operation +Type_mustSelectType=You must select a Type +Lower_bound=Lower Bound : +Upper_bound=Upper Bound : +Add_a_Reference=Add a reference +Add_an_Operation=Add an Operation +Add_an_Operation_desc=Add a new operation to the selected facet +Add_an_Operation_Parameter=Add an Operation Parameter +Add_an_Operation_Parameter_desc=Add a new operation's parameter to the selected operation +Operation_name=Operation Name: +Parameter_name=Parameter Name: +Add_a_Reference_desc=Add a reference to the selected facet +Create=Create +Create_FacetSet_Model=Create FacetSet Model +CreateFacetInFacetSetWidget_FacetSetName=Facet Set Name +CreateFacetInFacetSetWizardPage_could_not_find_wizard_page=Could not find the wizard for this query type +Create_facet_in_facetSet=Create a Facet in a FacetSet +Create_facetSet_in_facetSet=Create a Facet in a FacetSet +Please_enter_value_for=Please enter a value for {0} +CreateFacetInFacetSetWizardPage_Please_fill_extendedMetaClass=Please fill the extendedMetaClass field +CreateFacetInFacetSetWizardPage_Sub_Typing_Facet=SubTyping Facet +CreateFacetInFacetSetWizardPage_wizard_description=This wizard creates a new facet in a facetSet. +CreateFacetSetWizardImpl_Create_new_facet_Set=Create a new Facet Set +CreateFacetSetWizardImpl_FacetModel=Facet Set +CreateFacetSetWizardImpl_File_extension_restriction=File extension has to be ".efacet" +CreateFacetSetWizardPage_Not_a_Plugin_project=Warning : you are creating this FacetSet in a non-Plugin project. It will not be available until moved to a Plugin project. +Create_Query=Create Query: +Load_MetaModel_Resource=Load Meta-model Resource +FacetSetSelectionDialog_selectFacetSetsMessage=Choose FacetSets: +FacetSetSelectionDialog_selectFacetSetsTitle=Select FacetSets +Package_Selection=Package Selection +Select_Registered_URI=&Select a registered package URI: + +SelectQueryTypeWizardPage_No_wizard_found=No wizard page extension was found for the selected query type. Wizard pages have to be registered using queryFactoryWizardPageRegistration extension point +SelectQueryTypeWizardPage_Query_Type=Query Type : +JavaQueryWizardPage_Can_be_cached=Can be cached : +JavaQueryWizardPage_has_side_effect=Has side effect : +JavaQueryWizardPage_Query_name=Query name : +Reference_name=Reference name: + +Select=Select +Type=Type : +New=New... +Select_EClass=Select an EClass +Select_EClassifier=Select an EClassifier +Select_EDataType=Select an EDataType +Select_EPackage=Select an EPackage +Select_ETypedElement= Select an ETypedElement + +Query_name=Query name : +Query_Select_Name_And_Type=You have to select a name and a type before the query + +#### Begin: copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties +QueryExecutionView_0=Missing bundle... +QueryExecutionView_1=To execute the query, the depending bundle {0} must be installed. It will not be hot loaded. +QueryExecutionView_classpathWarning=The output location of the Java project "{0}" was not found in its Bundle-ClassPath. This prevents the Java queries implementations it contains from being loaded. +QueryExecutionView_errorInBundleClasspath=Error in Bundle-ClassPath +QueryExecutionView_execEnvNotAvailable=Execution environment not available +QueryExecutionView_execEnvError=To execute the query the execution environment {0} is required but not available. The available execution environments are: {1} +QueryExecutionView_Context=Context +QueryExecutionView_DisplayResultIn=Display result in: +QueryExecutionView_dragAndDropHint=drag&drop model elements here +QueryExecutionView_ErrorExecutingQuery=Error executing query +QueryExecutionView_ETypeElementsGroup=ETypeElements +QueryExecutionView_ExecuteButton=E&xecute +QueryExecutionView_ExecuteGroup=Execute +QueryExecutionView_NoQueryDisplayer=No Query Displayer +QueryExecutionView_NoQuerySelected=No query +QueryExecutionView_notImplementedYet=<Not implemented yet> +QueryExecutionView_NullQueryResult=Null query result +QueryExecutionView_Parameters=Parameters +QueryExecutionView_Query=Query +QueryExecutionView_QueryException=Query exception +QueryExecutionView_QueryReturnedNull=Query returned a null result (see error log) +QueryExecutionView_SelectQueryToExecute=You must select a query to execute + +Query_Query_Name=Query name : +Query_has_side_effect=Has side effect : +Query_Can_be_cached=Can be cached : + +Metaclass_mustSelectMetaclass=You must select a MetaClass +ExtendedMetaClass=&Extended Meta-Class: +#### End: copied from /org.eclipse.papyrus.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties + +#### Edition +Edit_FacetSet=Edit a FacetSet +Edit_Facet=Edit a Facet +Edit_FacetAttribute=Edit a Facet Attribute +Edit_FacetReference=Edit a Facet Reference +Edit_FacetOperation=Edit a Facet Operation +Edit_FacetOperationParameter=Edit a Facet Operation Parameter +EditFacetSetWidget_FacetSetName=Facet Set Name +EditFacetWidget_FacetName=Facet Name + +GetSubTypingType_message=Select a Sub typing type +GetSubTypingType_title=Select a Sub typing type + FacetSetPropertyWizardPage_facet_properties=Set the Facet properties
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java index 877ceb8246c..c662240a91d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java @@ -1,250 +1,250 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.ExtensiblePackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.dialog.query.IQueryDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.query.AbstractQueryWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.WidgetProperties;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This abstract class must be extended by the plug-in which has to extend this
- * plug-in. This abstract class must provide a simple way to create an dialog
- * for the creation of the query</p>
- *
- * The {@link #createWidget()} method must return a widget that extends {@link AbstractQueryWidget} class add provide a widget for the edition of the
- * query.</p>
- *
- * The {@link #createQuery()} method must return the final query created. The query
- * must be a subclass of {@link Query}.</p>
- *
- * The {@link #getDialogMessage()} method must return a simple text that will
- * notice the user that he successfully create the query.
- *
- * @see WidgetProperties
- * @see PropertyElement
- * @see AbstractQueryWidget
- * @see Query
- */
-public abstract class AbstractQueryDialogFactory<Q extends Query> implements
- IQueryDialogFactory {
-
- public static final ETypedElement QUERY_NAME = EcorePackage.eINSTANCE
- .getENamedElement_Name();
- public static final ETypedElement QUERY_TYPE = EcorePackage.eINSTANCE
- .getETypedElement_EType();
- public static final ETypedElement CAN_BE_CACHED = ExtensiblePackage.eINSTANCE
- .getQuery_CanBeCached();
- public static final ETypedElement SIDE_EFFECTS = ExtensiblePackage.eINSTANCE
- .getQuery_CanHaveSideEffects();
- private DerivedTypedElement dte;
-
- private IDialog<?> parentDialog;
- private WidgetProperties<ETypedElement> properties;
- private Q initialQuery;
- private final PropertyElement canBeCachedProp = getProperties()
- .getProperty(AbstractQueryDialogFactory.CAN_BE_CACHED);
- private final PropertyElement sideEffectsProp = getProperties()
- .getProperty(AbstractQueryDialogFactory.SIDE_EFFECTS);
-
- /**
- * @return the widget associated to the dialog. The widget will contain all
- * the necessaries {@link AbstractWidget} for the creation of the
- * query.
- */
- public abstract AbstractQueryWidget<ETypedElement> createWidget(
- Composite parent);
-
- /**
- * Return a map with the specific properties of the query.
- *
- * @return the properties
- */
- public abstract Map<ETypedElement, PropertyElement> createSpecificProperties();
-
- /**
- * @return the query created by this widget. Null if no query have been
- * created.
- */
- public abstract Query createQuery();
-
- /**
- * @return the message description of the dialog.
- */
- public abstract String getDialogMessage();
-
- /**
- * @return the title of the dialog.
- */
- public abstract String getDialogTitle();
-
- /**
- * @return a text that the extension must set for the main dialog (to let
- * the user know that he create the query).
- */
- public abstract String getConclusionText();
-
- /**
- * @return the parentDialog
- */
- public IDialog<?> getParent() {
- return this.parentDialog;
- }
-
- /**
- * @param queryName
- * the queryName to set
- */
- public void setQueryName(final String queryName) {
- getQueryNameProperty().setValue(queryName);
- }
-
- /**
- * @return the facetset
- */
- public DerivedTypedElement getDerivedTypedElement() {
- return this.dte;
- }
-
- /**
- * @param queryName
- * the queryName to set
- */
- public void setQueryType(final EClassifier queryType) {
- getQueryTypeProperty().setValue(queryType);
- }
-
- /**
- * @return the query type.
- */
- public PropertyElement getQueryTypeProperty() {
- return getProperties().getProperty(
- AbstractQueryDialogFactory.QUERY_TYPE);
- }
-
- /**
- * This method return a singleton of the properties {@link WidgetProperties} with the initialization of some standard properties as: </nl> <li>The query name : {@link #getQueryNameProperty()}</li> <li>If the query can be cached :
- * {@link #getCanBeCachedProperty()}</li> <li>If the query can have side effects : {@link #getCanHaveSideEffects()}</li> </nl>
- *
- * @return the properties
- */
- public WidgetProperties<ETypedElement> getProperties() {
- if (this.properties == null) {
- this.properties = new WidgetProperties<ETypedElement>();
-
- // Query Name
- this.properties.addProperty(AbstractQueryDialogFactory.QUERY_NAME,
- new PropertyElement("QueryName", String.class, false)); //$NON-NLS-1$
- // CanBeCached
- this.properties.addProperty(
- AbstractQueryDialogFactory.CAN_BE_CACHED,
- new PropertyElement("CanBeCached", Boolean.class, true, //$NON-NLS-1$
- Boolean.FALSE));
- // CanHaveSideEffects
- this.properties.addProperty(
- AbstractQueryDialogFactory.SIDE_EFFECTS,
- new PropertyElement("CanHaveSideEffects", Boolean.class, //$NON-NLS-1$
- true, Boolean.FALSE));
- // QueryType
- this.properties.addProperty(AbstractQueryDialogFactory.QUERY_TYPE,
- new PropertyElement("QueryType", EClassifier.class, true)); //$NON-NLS-1$
- }
- return this.properties;
- }
-
- /**
- * The the specific properties to the existing properties.
- */
- public void addSpecificProperties() {
- // Adding user's properties
- final Map<ETypedElement, PropertyElement> userProp = createSpecificProperties();
- if (userProp != null) {
- for (final ETypedElement element : userProp.keySet()) {
- this.properties.addProperty(element, userProp.get(element));
- }
- }
- }
-
- /**
- * @return the queryNameProperty
- */
- public PropertyElement getQueryNameProperty() {
- return getProperties().getProperty(
- AbstractQueryDialogFactory.QUERY_NAME);
- }
-
- /**
- * @return the CanBeCachedProperty
- */
- public PropertyElement getCanBeCachedProperty() {
- return this.canBeCachedProp;
- }
-
- public boolean isCanBeCachedPropertyValue() {
- return ((Boolean) this.canBeCachedProp.getValue()).booleanValue();
- }
-
- /**
- * @return the CanHaveSideEffects
- */
- public PropertyElement getCanHaveSideEffects() {
- return this.sideEffectsProp;
- }
-
- public boolean isCanHaveSideEffectsValue() {
- return ((Boolean) this.sideEffectsProp.getValue()).booleanValue();
- }
-
- /**
- * @return the initialQuery
- */
- public Q getInitialQuery() {
- return this.initialQuery;
- }
-
- /**
- * @param initialQuery
- * the initialQuery to set
- */
- public void setInitialQuery(final Q initialQuery) {
- this.initialQuery = initialQuery;
- }
-
- public void commit() {
- this.parentDialog.commit();
- }
-
- public void cancel() {
- this.parentDialog.cancel();
- }
-
- public int open() {
- return this.parentDialog.open();
- }
-
- public boolean isDialogValid() {
- return this.parentDialog.isDialogValid();
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import java.util.Map; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.ExtensiblePackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.dialog.query.IQueryDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.query.AbstractQueryWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.papyrus.emf.facet.util.ui.utils.WidgetProperties; +import org.eclipse.swt.widgets.Composite; + +/** + * This abstract class must be extended by the plug-in which has to extend this + * plug-in. This abstract class must provide a simple way to create an dialog + * for the creation of the query</p> + * + * The {@link #createWidget()} method must return a widget that extends {@link AbstractQueryWidget} class add provide a widget for the edition of the + * query.</p> + * + * The {@link #createQuery()} method must return the final query created. The query + * must be a subclass of {@link Query}.</p> + * + * The {@link #getDialogMessage()} method must return a simple text that will + * notice the user that he successfully create the query. + * + * @see WidgetProperties + * @see PropertyElement + * @see AbstractQueryWidget + * @see Query + */ +public abstract class AbstractQueryDialogFactory<Q extends Query> implements + IQueryDialogFactory { + + public static final ETypedElement QUERY_NAME = EcorePackage.eINSTANCE + .getENamedElement_Name(); + public static final ETypedElement QUERY_TYPE = EcorePackage.eINSTANCE + .getETypedElement_EType(); + public static final ETypedElement CAN_BE_CACHED = ExtensiblePackage.eINSTANCE + .getQuery_CanBeCached(); + public static final ETypedElement SIDE_EFFECTS = ExtensiblePackage.eINSTANCE + .getQuery_CanHaveSideEffects(); + private DerivedTypedElement dte; + + private IDialog<?> parentDialog; + private WidgetProperties<ETypedElement> properties; + private Q initialQuery; + private final PropertyElement canBeCachedProp = getProperties() + .getProperty(AbstractQueryDialogFactory.CAN_BE_CACHED); + private final PropertyElement sideEffectsProp = getProperties() + .getProperty(AbstractQueryDialogFactory.SIDE_EFFECTS); + + /** + * @return the widget associated to the dialog. The widget will contain all + * the necessaries {@link AbstractWidget} for the creation of the + * query. + */ + public abstract AbstractQueryWidget<ETypedElement> createWidget( + Composite parent); + + /** + * Return a map with the specific properties of the query. + * + * @return the properties + */ + public abstract Map<ETypedElement, PropertyElement> createSpecificProperties(); + + /** + * @return the query created by this widget. Null if no query have been + * created. + */ + public abstract Query createQuery(); + + /** + * @return the message description of the dialog. + */ + public abstract String getDialogMessage(); + + /** + * @return the title of the dialog. + */ + public abstract String getDialogTitle(); + + /** + * @return a text that the extension must set for the main dialog (to let + * the user know that he create the query). + */ + public abstract String getConclusionText(); + + /** + * @return the parentDialog + */ + public IDialog<?> getParent() { + return this.parentDialog; + } + + /** + * @param queryName + * the queryName to set + */ + public void setQueryName(final String queryName) { + getQueryNameProperty().setValue(queryName); + } + + /** + * @return the facetset + */ + public DerivedTypedElement getDerivedTypedElement() { + return this.dte; + } + + /** + * @param queryName + * the queryName to set + */ + public void setQueryType(final EClassifier queryType) { + getQueryTypeProperty().setValue(queryType); + } + + /** + * @return the query type. + */ + public PropertyElement getQueryTypeProperty() { + return getProperties().getProperty( + AbstractQueryDialogFactory.QUERY_TYPE); + } + + /** + * This method return a singleton of the properties {@link WidgetProperties} with the initialization of some standard properties as: </nl> <li>The query name : {@link #getQueryNameProperty()}</li> <li>If the query can be cached : + * {@link #getCanBeCachedProperty()}</li> <li>If the query can have side effects : {@link #getCanHaveSideEffects()}</li> </nl> + * + * @return the properties + */ + public WidgetProperties<ETypedElement> getProperties() { + if (this.properties == null) { + this.properties = new WidgetProperties<ETypedElement>(); + + // Query Name + this.properties.addProperty(AbstractQueryDialogFactory.QUERY_NAME, + new PropertyElement("QueryName", String.class, false)); //$NON-NLS-1$ + // CanBeCached + this.properties.addProperty( + AbstractQueryDialogFactory.CAN_BE_CACHED, + new PropertyElement("CanBeCached", Boolean.class, true, //$NON-NLS-1$ + Boolean.FALSE)); + // CanHaveSideEffects + this.properties.addProperty( + AbstractQueryDialogFactory.SIDE_EFFECTS, + new PropertyElement("CanHaveSideEffects", Boolean.class, //$NON-NLS-1$ + true, Boolean.FALSE)); + // QueryType + this.properties.addProperty(AbstractQueryDialogFactory.QUERY_TYPE, + new PropertyElement("QueryType", EClassifier.class, true)); //$NON-NLS-1$ + } + return this.properties; + } + + /** + * The the specific properties to the existing properties. + */ + public void addSpecificProperties() { + // Adding user's properties + final Map<ETypedElement, PropertyElement> userProp = createSpecificProperties(); + if (userProp != null) { + for (final ETypedElement element : userProp.keySet()) { + this.properties.addProperty(element, userProp.get(element)); + } + } + } + + /** + * @return the queryNameProperty + */ + public PropertyElement getQueryNameProperty() { + return getProperties().getProperty( + AbstractQueryDialogFactory.QUERY_NAME); + } + + /** + * @return the CanBeCachedProperty + */ + public PropertyElement getCanBeCachedProperty() { + return this.canBeCachedProp; + } + + public boolean isCanBeCachedPropertyValue() { + return ((Boolean) this.canBeCachedProp.getValue()).booleanValue(); + } + + /** + * @return the CanHaveSideEffects + */ + public PropertyElement getCanHaveSideEffects() { + return this.sideEffectsProp; + } + + public boolean isCanHaveSideEffectsValue() { + return ((Boolean) this.sideEffectsProp.getValue()).booleanValue(); + } + + /** + * @return the initialQuery + */ + public Q getInitialQuery() { + return this.initialQuery; + } + + /** + * @param initialQuery + * the initialQuery to set + */ + public void setInitialQuery(final Q initialQuery) { + this.initialQuery = initialQuery; + } + + public void commit() { + this.parentDialog.commit(); + } + + public void cancel() { + this.parentDialog.cancel(); + } + + public int open() { + return this.parentDialog.open(); + } + + public boolean isDialogValid() { + return this.parentDialog.isDialogValid(); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java index 2ce3cdf9985..2895283bb16 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java @@ -1,161 +1,161 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.AbstractCommandDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedCreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-
-/**
- * This class provide the dialog for the creation of the specific dialog
- * according of the type of the query selected.
- *
- * To run, this class needs to have into the properties pass in the constructor:
- * <p>
- * <li>The {@link PropertyElement} <code>name</code> with the key <code>EcorePackage.eINSTANCE.getENamedElement_Name()</code></li>
- * </p>
- * <li>The {@link PropertyElement} <code>type</code> with the key <code>EcorePackage.eINSTANCE.getETypedElement_EType()</code></li> </p> <li>
- * The {@link PropertyElement} <code>parent</code> (a {@link Facet}) with the key <code>EcorePackage.eINSTANCE.getEObject__EContainer()</code></li> </p>
- */
-public class GetQueryDialog extends
- AbstractCommandDialog<IWithResultDialogCallback<IQueryCreationResult>, ICreateQueryWidget> {
-
- private final PropertyElement2<Boolean> canBeCachedProp;
- private final PropertyElement2<Boolean> sideEffectsProp;
- private CreateQueryWidget createQueryWidget;
- private boolean valid;
- private final IQueryDialogFactoryStrategy strategy;
- private final IQueryContext queryContext;
-
- /**
- *
- * @param callback
- * the callback.
- * @param properties
- * properties that parent widget had.
- * @param propertyElement
- * the {@link PropertyElement} containing the query
- * @param qDialogFactoryStrategiy
- * an instance of {@link AbstractQueryDialogFactory} needed to
- * create the dialog
- * @param query
- */
- public GetQueryDialog(
- final IWithResultDialogCallback<IQueryCreationResult> callback,
- final IQueryDialogFactoryStrategy strategy,
- final IQueryContext queryContext) {
- super(callback);
- this.canBeCachedProp = new PropertyElement2<Boolean>(true);
- this.canBeCachedProp.setValue(Boolean.FALSE);
- this.sideEffectsProp = new PropertyElement2<Boolean>(true);
- this.sideEffectsProp.setValue(Boolean.FALSE);
- this.strategy = strategy;
- this.queryContext = queryContext;
- }
-
- @Override
- public ICreateQueryWidget createWidget() {
- this.createQueryWidget = new CreateQueryWidget(
- this.getDialogComposite(), this.strategy, this.canBeCachedProp,
- this.sideEffectsProp, this.queryContext);
- return new SynchronizedCreateQueryWidget(this.createQueryWidget,
- this.createQueryWidget.getDisplay());
- }
-
- @Override
- protected String getDialogMessage() {
- return this.strategy.getDialogMessage();
- }
-
- @Override
- protected String getDialogTitle() {
- return this.strategy.getDialogTitle();
- }
-
- @Override
- protected void okPressed() {
- this.valid = isValid();
- if (this.valid) {
- final boolean sideEffects = this.sideEffectsProp.getValue2()
- .booleanValue();
- final boolean canBeCashed = this.canBeCachedProp.getValue2()
- .booleanValue();
- final Query query = this.strategy.createQuery(canBeCashed,
- sideEffects, this.queryContext);
- final IWithResultDialogCallback<IQueryCreationResult> callback = getCallback();
- callback.commited(new IQueryCreationResult() {
- public Query getQuery() {
- return query;
- }
-
- public String getLabel() {
- return GetQueryDialog.this.getConclusionText();
- }
- });
- }
- super.okPressed();
- }
-
- @Override
- protected void cancelPressed() {
- final IWithResultDialogCallback<IQueryCreationResult> callback = getCallback();
- callback.canceled(null);
- super.cancelPressed();
- }
-
- @Override
- public boolean isDialogValid() {
- return this.valid;
- }
-
- private boolean isValid() {
- boolean result = true;
- final String error = getWidget().getError();
- if (error != null) {
- result = false;
- }
- return result;
- }
-
- public String getConclusionText() {
- return this.strategy.getConclusionText();
- }
-
-
- public boolean isCanBeCached() {
- return this.createQueryWidget.isCanBeCached();
- }
-
- public boolean isHasSideEffect() {
- return this.createQueryWidget.isHasSideEffect();
- }
-
- public IAbstractWidget getCreateQueryWidget() {
- return this.createQueryWidget.getCreateQueryWidget();
- }
-
- public IAbstractWidget createSubWidget() {
- return this.strategy.createWidget(this.getDialogComposite(),
- this.queryContext);
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.AbstractCommandDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedCreateQueryWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; + +/** + * This class provide the dialog for the creation of the specific dialog + * according of the type of the query selected. + * + * To run, this class needs to have into the properties pass in the constructor: + * <p> + * <li>The {@link PropertyElement} <code>name</code> with the key <code>EcorePackage.eINSTANCE.getENamedElement_Name()</code></li> + * </p> + * <li>The {@link PropertyElement} <code>type</code> with the key <code>EcorePackage.eINSTANCE.getETypedElement_EType()</code></li> </p> <li> + * The {@link PropertyElement} <code>parent</code> (a {@link Facet}) with the key <code>EcorePackage.eINSTANCE.getEObject__EContainer()</code></li> </p> + */ +public class GetQueryDialog extends + AbstractCommandDialog<IWithResultDialogCallback<IQueryCreationResult>, ICreateQueryWidget> { + + private final PropertyElement2<Boolean> canBeCachedProp; + private final PropertyElement2<Boolean> sideEffectsProp; + private CreateQueryWidget createQueryWidget; + private boolean valid; + private final IQueryDialogFactoryStrategy strategy; + private final IQueryContext queryContext; + + /** + * + * @param callback + * the callback. + * @param properties + * properties that parent widget had. + * @param propertyElement + * the {@link PropertyElement} containing the query + * @param qDialogFactoryStrategiy + * an instance of {@link AbstractQueryDialogFactory} needed to + * create the dialog + * @param query + */ + public GetQueryDialog( + final IWithResultDialogCallback<IQueryCreationResult> callback, + final IQueryDialogFactoryStrategy strategy, + final IQueryContext queryContext) { + super(callback); + this.canBeCachedProp = new PropertyElement2<Boolean>(true); + this.canBeCachedProp.setValue(Boolean.FALSE); + this.sideEffectsProp = new PropertyElement2<Boolean>(true); + this.sideEffectsProp.setValue(Boolean.FALSE); + this.strategy = strategy; + this.queryContext = queryContext; + } + + @Override + public ICreateQueryWidget createWidget() { + this.createQueryWidget = new CreateQueryWidget( + this.getDialogComposite(), this.strategy, this.canBeCachedProp, + this.sideEffectsProp, this.queryContext); + return new SynchronizedCreateQueryWidget(this.createQueryWidget, + this.createQueryWidget.getDisplay()); + } + + @Override + protected String getDialogMessage() { + return this.strategy.getDialogMessage(); + } + + @Override + protected String getDialogTitle() { + return this.strategy.getDialogTitle(); + } + + @Override + protected void okPressed() { + this.valid = isValid(); + if (this.valid) { + final boolean sideEffects = this.sideEffectsProp.getValue2() + .booleanValue(); + final boolean canBeCashed = this.canBeCachedProp.getValue2() + .booleanValue(); + final Query query = this.strategy.createQuery(canBeCashed, + sideEffects, this.queryContext); + final IWithResultDialogCallback<IQueryCreationResult> callback = getCallback(); + callback.commited(new IQueryCreationResult() { + public Query getQuery() { + return query; + } + + public String getLabel() { + return GetQueryDialog.this.getConclusionText(); + } + }); + } + super.okPressed(); + } + + @Override + protected void cancelPressed() { + final IWithResultDialogCallback<IQueryCreationResult> callback = getCallback(); + callback.canceled(null); + super.cancelPressed(); + } + + @Override + public boolean isDialogValid() { + return this.valid; + } + + private boolean isValid() { + boolean result = true; + final String error = getWidget().getError(); + if (error != null) { + result = false; + } + return result; + } + + public String getConclusionText() { + return this.strategy.getConclusionText(); + } + + + public boolean isCanBeCached() { + return this.createQueryWidget.isCanBeCached(); + } + + public boolean isHasSideEffect() { + return this.createQueryWidget.isHasSideEffect(); + } + + public IAbstractWidget getCreateQueryWidget() { + return this.createQueryWidget.getCreateQueryWidget(); + } + + public IAbstractWidget createSubWidget() { + return this.strategy.createWidget(this.getDialogComposite(), + this.queryContext); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java index 8ebeaf7ca2d..001621a42ea 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java @@ -1,21 +1,21 @@ -/**
- * 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:
- * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-
-public interface IQueryCreationResult {
-
- Query getQuery();
-
- String getLabel();
-}
+/** + * 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: + * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; + +public interface IQueryCreationResult { + + Query getQuery(); + + String getLabel(); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java index 987a3b7ac6c..eefcb3c345f 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java @@ -1,52 +1,52 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import java.util.List;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
-
-/**
- * This interface provide to get all the plug-ins extending the extension point
- * and the lazy loading of this plug-ins.
- *
- * @see QueryWidgetCompositeFactoryImpl
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IQueryWidgetCompositeFactoryFactory {
-
- /**
- * Returns an instance of {@link QueryWidgetCompositeFactoryImpl}.
- */
- IQueryWidgetCompositeFactoryFactory INSTANCE = new QueryWidgetCompositeFactoryImpl();
-
- /**
- * Return a registered {@link AbstractQueryDialogFactory} corresponding to
- * the given type name.
- *
- * @param managedTypeName
- * the <i>managedQueryTypeName</i> extension attribute.
- * @return an instance of the class which implements {@link AbstractQueryDialogFactory}.
- */
- IQueryDialogFactoryStrategy getQueryDialogFactoryStrategy(
- String managedTypeName);
-
- /**
- * Returns every registered {@link AbstractQueryDialogFactory} name.
- *
- * @return a list containing the <i>managedQueryTypeName</i>.
- */
- List<String> getRegisteredQueryWidgetsComposite();
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import java.util.List; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy; + +/** + * This interface provide to get all the plug-ins extending the extension point + * and the lazy loading of this plug-ins. + * + * @see QueryWidgetCompositeFactoryImpl + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ +public interface IQueryWidgetCompositeFactoryFactory { + + /** + * Returns an instance of {@link QueryWidgetCompositeFactoryImpl}. + */ + IQueryWidgetCompositeFactoryFactory INSTANCE = new QueryWidgetCompositeFactoryImpl(); + + /** + * Return a registered {@link AbstractQueryDialogFactory} corresponding to + * the given type name. + * + * @param managedTypeName + * the <i>managedQueryTypeName</i> extension attribute. + * @return an instance of the class which implements {@link AbstractQueryDialogFactory}. + */ + IQueryDialogFactoryStrategy getQueryDialogFactoryStrategy( + String managedTypeName); + + /** + * Returns every registered {@link AbstractQueryDialogFactory} name. + * + * @return a list containing the <i>managedQueryTypeName</i>. + */ + List<String> getRegisteredQueryWidgetsComposite(); + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java index 58a9abacf89..c79d303df46 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java @@ -1,91 +1,91 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Activator;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-
-/**
- * Implementation of the {@link IQueryWidgetCompositeFactoryFactory}.
- */
-public class QueryWidgetCompositeFactoryImpl implements
- IQueryWidgetCompositeFactoryFactory {
-
- private static final String EXTENSION_POINT = "org.eclipse.papyrus.emf.facet.efacet.sdk.ui.queryFactoryDialogRegistration"; //$NON-NLS-1$
- private static final String DIALOG_FACTORY = "dialogFactory"; //$NON-NLS-1$
- private static final String MANAGED_TYPE_NAME = "managedQueryTypeName"; //$NON-NLS-1$
-
- private Map<String, IQueryDialogFactoryStrategy> extensions;
-
- public IQueryDialogFactoryStrategy getQueryDialogFactoryStrategy(
- final String managedTypeName) {
- // Lazy Loading, we only create the necessary instance.
- for (final IConfigurationElement element : Platform
- .getExtensionRegistry().getConfigurationElementsFor(
- QueryWidgetCompositeFactoryImpl.EXTENSION_POINT)) {
- final String elementName = element
- .getAttribute(QueryWidgetCompositeFactoryImpl.MANAGED_TYPE_NAME);
- if (elementName.equals(managedTypeName)) {
- try {
- final Object object = element
- .createExecutableExtension(QueryWidgetCompositeFactoryImpl.DIALOG_FACTORY);
- if (object instanceof IQueryDialogFactoryStrategy) {
- final IQueryDialogFactoryStrategy strategy = (IQueryDialogFactoryStrategy) object;
- this.extensions.put(elementName, strategy);
- } else {
- final String errorMsg = NLS
- .bind("The attribut {0} must contains a class implementing {1}", //$NON-NLS-1$
- QueryWidgetCompositeFactoryImpl.DIALOG_FACTORY,
- IQueryDialogFactoryStrategy.class
- .getName());
- Logger.logError(errorMsg, Activator.getDefault());
- }
- } catch (final InvalidRegistryObjectException e) {
- Logger.logError(e, Activator.getDefault());
- } catch (final CoreException e) {
- Logger.logError(e, Activator.getDefault());
- }
- }
- }
- return this.extensions.get(managedTypeName);
- }
-
- public List<String> getRegisteredQueryWidgetsComposite() {
- if (this.extensions == null) {
- this.extensions = new HashMap<String, IQueryDialogFactoryStrategy>();
-
- for (final IConfigurationElement element : Platform
- .getExtensionRegistry().getConfigurationElementsFor(
- QueryWidgetCompositeFactoryImpl.EXTENSION_POINT)) {
- this.extensions
- .put(element
- .getAttribute(QueryWidgetCompositeFactoryImpl.MANAGED_TYPE_NAME),
- null);
- }
- }
-
- return new LinkedList<String>(this.extensions.keySet());
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.InvalidRegistryObjectException; +import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Activator; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy; +import org.eclipse.papyrus.emf.facet.util.core.Logger; + +/** + * Implementation of the {@link IQueryWidgetCompositeFactoryFactory}. + */ +public class QueryWidgetCompositeFactoryImpl implements + IQueryWidgetCompositeFactoryFactory { + + private static final String EXTENSION_POINT = "org.eclipse.papyrus.emf.facet.efacet.sdk.ui.queryFactoryDialogRegistration"; //$NON-NLS-1$ + private static final String DIALOG_FACTORY = "dialogFactory"; //$NON-NLS-1$ + private static final String MANAGED_TYPE_NAME = "managedQueryTypeName"; //$NON-NLS-1$ + + private Map<String, IQueryDialogFactoryStrategy> extensions; + + public IQueryDialogFactoryStrategy getQueryDialogFactoryStrategy( + final String managedTypeName) { + // Lazy Loading, we only create the necessary instance. + for (final IConfigurationElement element : Platform + .getExtensionRegistry().getConfigurationElementsFor( + QueryWidgetCompositeFactoryImpl.EXTENSION_POINT)) { + final String elementName = element + .getAttribute(QueryWidgetCompositeFactoryImpl.MANAGED_TYPE_NAME); + if (elementName.equals(managedTypeName)) { + try { + final Object object = element + .createExecutableExtension(QueryWidgetCompositeFactoryImpl.DIALOG_FACTORY); + if (object instanceof IQueryDialogFactoryStrategy) { + final IQueryDialogFactoryStrategy strategy = (IQueryDialogFactoryStrategy) object; + this.extensions.put(elementName, strategy); + } else { + final String errorMsg = NLS + .bind("The attribut {0} must contains a class implementing {1}", //$NON-NLS-1$ + QueryWidgetCompositeFactoryImpl.DIALOG_FACTORY, + IQueryDialogFactoryStrategy.class + .getName()); + Logger.logError(errorMsg, Activator.getDefault()); + } + } catch (final InvalidRegistryObjectException e) { + Logger.logError(e, Activator.getDefault()); + } catch (final CoreException e) { + Logger.logError(e, Activator.getDefault()); + } + } + } + return this.extensions.get(managedTypeName); + } + + public List<String> getRegisteredQueryWidgetsComposite() { + if (this.extensions == null) { + this.extensions = new HashMap<String, IQueryDialogFactoryStrategy>(); + + for (final IConfigurationElement element : Platform + .getExtensionRegistry().getConfigurationElementsFor( + QueryWidgetCompositeFactoryImpl.EXTENSION_POINT)) { + this.extensions + .put(element + .getAttribute(QueryWidgetCompositeFactoryImpl.MANAGED_TYPE_NAME), + null); + } + } + + return new LinkedList<String>(this.extensions.keySet()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java index 2d59c48286e..fe67be5ff3a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java @@ -1,289 +1,289 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.UIUtils;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.WidgetProperties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Provide the composite for the query type selection.</p>
- *
- * Label : [ combobox ] [ TextField ]
- *
- * When the user select a {@link AbstractQueryDialogFactory}, the associated
- * dialog {@link GetQueryDialog} is created (with the method {@link #createQueryWidgetDialog(AbstractQueryDialogFactory)} using the
- * attributes of the query type) and displayed.
- *
- * @see Query
- * @see AbstractQueryDialogFactory
- * @see GetQueryDialog
- */
-public class SelectQueryTypeWidget extends AbstractWidget {
-
- private static final int COLUMN_NUMBER = 2;
- private Combo combobox;
- private final PropertyElement queryProp;
- private Text textField;
- private final GridLayout gridLayout;
- private String alertMessage;
- private final boolean comboboxEnabled;
- private final IQueryContext queryContext;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of the composite.
- * @param properties
- * the {@link WidgetProperties} of the parent.
- * @param queryProp
- * the property element that this composite will edit.
- */
- public SelectQueryTypeWidget(final Composite parent,
- final PropertyElement propertyElement,
- final IQueryContext queryContext) {
- this(parent, propertyElement, false, queryContext);
- }
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of the composite.
- * @param properties
- * the {@link WidgetProperties} of the parent.
- * @param queryProp
- * the property element that this composite will edit.
- */
- public SelectQueryTypeWidget(final Composite parent,
- final PropertyElement queryProperty, final boolean comboboxEnabled,
- final IQueryContext queryContext) {
- super(parent);
- this.queryProp = queryProperty;
- this.comboboxEnabled = comboboxEnabled;
- this.gridLayout = new GridLayout(COLUMN_NUMBER, false);
- this.gridLayout.marginWidth = 0;
- this.queryContext = queryContext;
- }
-
- @Override
- protected void addSubWidgets() {
- final Composite composite = new Composite(this, SWT.NONE);
- composite.setLayout(this.gridLayout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- boolean enabled = this.comboboxEnabled;
- if (!this.comboboxEnabled) {
- enabled = this.queryProp.getValue() != null;
- }
-
- final List<String> elements = new LinkedList<String>();
- elements.add(Messages.Select_query_type);
- elements.addAll(IQueryWidgetCompositeFactoryFactory.INSTANCE
- .getRegisteredQueryWidgetsComposite());
- final SelectionListener listener = new SelectionListener() {
-
- public void widgetSelected(final SelectionEvent event) {
- onSelection();
- }
-
- public void widgetDefaultSelected(final SelectionEvent event) {
- // NOTHING
- }
- };
- this.combobox = UIUtils.createCombobox(composite, enabled, elements,
- Messages.SelectQueryTypeWizardPage_Query_Type, listener);
- this.textField = UIUtils.createTextField(composite, "", false, null); //$NON-NLS-1$
- refresh();
- }
-
- /**
- * Select the item in the combobox with the name in parameter.
- *
- * @param selection
- * the name of the selection.
- */
- public IDialog<ICreateQueryWidget> selectQueryType(final String selection) {
- IDialog<ICreateQueryWidget> result = null;
- int index = 0;
- for (final String item : this.combobox.getItems()) {
- if (item.equals(selection)) {
- this.combobox.select(index);
- result = onSelection();
- break;
- }
- ++index;
- }
- return result;
- }
-
- @Override
- public String getError() {
- String result = null;
-
- if (this.queryProp.getValue() == null) {
- result = Messages.Facet_mustSelectQuery;
- }
-
- return result;
- }
-
- /**
- * This method check if the comboBox is enabled and set the default value if
- * not (combobox selection and textField alert message).
- */
- private void refresh() {
- this.combobox.select(0);
- if (this.combobox.isEnabled()) {
- if (this.queryProp.getValue() != null) {
- final Query query = (Query) this.queryProp.getValue();
- this.textField.setText(query.toString());
- }
- } else {
- this.queryProp.setValue(null);
- // The alert message has the default color because it's not possible
- // to change the text color if the text field is disabled.
- if (this.alertMessage != null) {
- this.textField.setText(this.alertMessage);
- }
- }
- }
-
- /**
- * @param enabled
- * set if the selection combobox is enabled or not.
- */
- public void setSelectionEnabled(final boolean enabled) {
- this.combobox.setEnabled(enabled);
- refresh();
- }
-
- /**
- * @return if the combobox is enabled or not.
- */
- public boolean isSelectionEnabled() {
- return this.combobox.isEnabled();
- }
-
- /**
- * Set the alert message that will be displayed if the checkbox is not
- * checked.
- *
- * @param alertMessage
- * the alertMessage to set
- */
- public void setAlertMessage(final String alertMessage) {
- this.alertMessage = alertMessage;
- }
-
- /**
- * The action when an element of the combobox is selected.</p>
- *
- * If the default element is selected, the property value is set to null.
- */
- protected IDialog<ICreateQueryWidget> onSelection() {
- IDialog<ICreateQueryWidget> result = null;
- final int selectionIndex = this.combobox.getSelectionIndex();
- if (selectionIndex == 0) {
- this.queryProp.setValue(null);
- this.textField.setText(this.alertMessage);
- } else {
- final String selectionName = this.combobox.getItem(selectionIndex);
- final IQueryDialogFactoryStrategy strategy = IQueryWidgetCompositeFactoryFactory.INSTANCE
- .getQueryDialogFactoryStrategy(selectionName);
- final IWithResultDialogCallback<IQueryCreationResult> callback = new IWithResultDialogCallback<IQueryCreationResult>() {
- public void commited(final IQueryCreationResult qcResult) {
- onDialogCommitted(qcResult);
- }
-
- public void canceled(final IQueryCreationResult qcResult) {
- checkQuery(null);
- }
- };
- final IDialog<ICreateQueryWidget> dialog = new GetQueryDialog(
- callback,
- strategy, this.queryContext);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- dialog.open();
- }
- });
- result = new SynchronizedAbstractDialog<ICreateQueryWidget>(dialog,
- Display.getDefault());
- }
- return result;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- /**
- * Action to do when the dialog opened with the button "..." is closed with
- * the "OK" button.
- */
- protected void onDialogCommitted(final IQueryCreationResult qcResult) {
- if (checkQuery(qcResult.getQuery()) && (qcResult.getLabel() != null)) {
- this.textField.setText(qcResult.getLabel());
- }
- }
-
- /**
- * Check if the query is the query exists.
- *
- * @param query
- *
- * @return true if the query exists.
- */
- protected boolean checkQuery(final Query query) {
- if (query == null) {
- this.combobox.select(0);
- if (this.alertMessage != null) {
- this.textField.setText(this.alertMessage);
- }
- }
- if (query != null) {
- this.queryProp.setValue(query);
- }
- return query != null;
- }
-
- /**
- * @return the text of the text associated with the query.
- */
- public String getText() {
- return this.textField.getText();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.query; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.papyrus.emf.facet.util.ui.utils.UIUtils; +import org.eclipse.papyrus.emf.facet.util.ui.utils.WidgetProperties; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Text; + +/** + * Provide the composite for the query type selection.</p> + * + * Label : [ combobox ] [ TextField ] + * + * When the user select a {@link AbstractQueryDialogFactory}, the associated + * dialog {@link GetQueryDialog} is created (with the method {@link #createQueryWidgetDialog(AbstractQueryDialogFactory)} using the + * attributes of the query type) and displayed. + * + * @see Query + * @see AbstractQueryDialogFactory + * @see GetQueryDialog + */ +public class SelectQueryTypeWidget extends AbstractWidget { + + private static final int COLUMN_NUMBER = 2; + private Combo combobox; + private final PropertyElement queryProp; + private Text textField; + private final GridLayout gridLayout; + private String alertMessage; + private final boolean comboboxEnabled; + private final IQueryContext queryContext; + + /** + * Constructor. + * + * @param parent + * the parent of the composite. + * @param properties + * the {@link WidgetProperties} of the parent. + * @param queryProp + * the property element that this composite will edit. + */ + public SelectQueryTypeWidget(final Composite parent, + final PropertyElement propertyElement, + final IQueryContext queryContext) { + this(parent, propertyElement, false, queryContext); + } + + /** + * Constructor. + * + * @param parent + * the parent of the composite. + * @param properties + * the {@link WidgetProperties} of the parent. + * @param queryProp + * the property element that this composite will edit. + */ + public SelectQueryTypeWidget(final Composite parent, + final PropertyElement queryProperty, final boolean comboboxEnabled, + final IQueryContext queryContext) { + super(parent); + this.queryProp = queryProperty; + this.comboboxEnabled = comboboxEnabled; + this.gridLayout = new GridLayout(COLUMN_NUMBER, false); + this.gridLayout.marginWidth = 0; + this.queryContext = queryContext; + } + + @Override + protected void addSubWidgets() { + final Composite composite = new Composite(this, SWT.NONE); + composite.setLayout(this.gridLayout); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + boolean enabled = this.comboboxEnabled; + if (!this.comboboxEnabled) { + enabled = this.queryProp.getValue() != null; + } + + final List<String> elements = new LinkedList<String>(); + elements.add(Messages.Select_query_type); + elements.addAll(IQueryWidgetCompositeFactoryFactory.INSTANCE + .getRegisteredQueryWidgetsComposite()); + final SelectionListener listener = new SelectionListener() { + + public void widgetSelected(final SelectionEvent event) { + onSelection(); + } + + public void widgetDefaultSelected(final SelectionEvent event) { + // NOTHING + } + }; + this.combobox = UIUtils.createCombobox(composite, enabled, elements, + Messages.SelectQueryTypeWizardPage_Query_Type, listener); + this.textField = UIUtils.createTextField(composite, "", false, null); //$NON-NLS-1$ + refresh(); + } + + /** + * Select the item in the combobox with the name in parameter. + * + * @param selection + * the name of the selection. + */ + public IDialog<ICreateQueryWidget> selectQueryType(final String selection) { + IDialog<ICreateQueryWidget> result = null; + int index = 0; + for (final String item : this.combobox.getItems()) { + if (item.equals(selection)) { + this.combobox.select(index); + result = onSelection(); + break; + } + ++index; + } + return result; + } + + @Override + public String getError() { + String result = null; + + if (this.queryProp.getValue() == null) { + result = Messages.Facet_mustSelectQuery; + } + + return result; + } + + /** + * This method check if the comboBox is enabled and set the default value if + * not (combobox selection and textField alert message). + */ + private void refresh() { + this.combobox.select(0); + if (this.combobox.isEnabled()) { + if (this.queryProp.getValue() != null) { + final Query query = (Query) this.queryProp.getValue(); + this.textField.setText(query.toString()); + } + } else { + this.queryProp.setValue(null); + // The alert message has the default color because it's not possible + // to change the text color if the text field is disabled. + if (this.alertMessage != null) { + this.textField.setText(this.alertMessage); + } + } + } + + /** + * @param enabled + * set if the selection combobox is enabled or not. + */ + public void setSelectionEnabled(final boolean enabled) { + this.combobox.setEnabled(enabled); + refresh(); + } + + /** + * @return if the combobox is enabled or not. + */ + public boolean isSelectionEnabled() { + return this.combobox.isEnabled(); + } + + /** + * Set the alert message that will be displayed if the checkbox is not + * checked. + * + * @param alertMessage + * the alertMessage to set + */ + public void setAlertMessage(final String alertMessage) { + this.alertMessage = alertMessage; + } + + /** + * The action when an element of the combobox is selected.</p> + * + * If the default element is selected, the property value is set to null. + */ + protected IDialog<ICreateQueryWidget> onSelection() { + IDialog<ICreateQueryWidget> result = null; + final int selectionIndex = this.combobox.getSelectionIndex(); + if (selectionIndex == 0) { + this.queryProp.setValue(null); + this.textField.setText(this.alertMessage); + } else { + final String selectionName = this.combobox.getItem(selectionIndex); + final IQueryDialogFactoryStrategy strategy = IQueryWidgetCompositeFactoryFactory.INSTANCE + .getQueryDialogFactoryStrategy(selectionName); + final IWithResultDialogCallback<IQueryCreationResult> callback = new IWithResultDialogCallback<IQueryCreationResult>() { + public void commited(final IQueryCreationResult qcResult) { + onDialogCommitted(qcResult); + } + + public void canceled(final IQueryCreationResult qcResult) { + checkQuery(null); + } + }; + final IDialog<ICreateQueryWidget> dialog = new GetQueryDialog( + callback, + strategy, this.queryContext); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + dialog.open(); + } + }); + result = new SynchronizedAbstractDialog<ICreateQueryWidget>(dialog, + Display.getDefault()); + } + return result; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + /** + * Action to do when the dialog opened with the button "..." is closed with + * the "OK" button. + */ + protected void onDialogCommitted(final IQueryCreationResult qcResult) { + if (checkQuery(qcResult.getQuery()) && (qcResult.getLabel() != null)) { + this.textField.setText(qcResult.getLabel()); + } + } + + /** + * Check if the query is the query exists. + * + * @param query + * + * @return true if the query exists. + */ + protected boolean checkQuery(final Query query) { + if (query == null) { + this.combobox.select(0); + if (this.alertMessage != null) { + this.textField.setText(this.alertMessage); + } + } + if (query != null) { + this.queryProp.setValue(query); + } + return query != null; + } + + /** + * @return the text of the text associated with the query. + */ + public String getText() { + return this.textField.getText(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetSetWidget.java index 152f0b614ec..03f5e6bf810 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetSetWidget.java @@ -1,100 +1,100 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class provide the selection or the creation of a FacetSet.</p>
- *
- * FaceSet : [ TextField ][...]</p>
- *
- * The {@link GetOrCreateFacetSetDialog} dialog will be displayed when the
- * button is pressed.
- *
- * @see GetOrCreateFacetSetDialog
- */
-public class GetOrCreateFacetSetWidget extends
- AbstractGetOrCreateElementWithDialogButtonWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>
- implements IGetOrCreateFacetSetWidget {
-
- private final EditingDomain editingdoamin;
- private final PropertyElement2<FacetSet> facetSetProperty;
- private final FacetSet reject;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param facetSetProperty
- * the property element that be edited with this composite.
- * @param properties
- * the map of properties of the parent.
- */
- public GetOrCreateFacetSetWidget(final Composite parent,
- final PropertyElement2<FacetSet> facetSetProperty,
- final EditingDomain editingDomain, final FacetSet reject) {
- super(parent, facetSetProperty);
- this.facetSetProperty = facetSetProperty;
- this.editingdoamin = editingDomain;
- this.reject = reject;
- }
-
- @Override
- protected IDialog<IGetOrCreateFilteredFacetSetWidget> getCreationDialog(
- final IWithResultDialogCallback<FacetSet> callback) {
- return new GetOrCreateFacetSetDialog(callback, this.editingdoamin,
- this.facetSetProperty, this.reject);
- }
-
- @Override
- protected String getLabel() {
- return Messages.FacetSet;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.FacetSet_mustSelectFacetSet;
- }
-
- @Override
- protected String getTextFieldInitialText() {
- return this.getPropertyElement().getValue2().getName();
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- public FacetSet getFacetSet() {
- return this.facetSetProperty.getValue2();
- }
-
- @Override
- protected void onCanceled() {
- // Nothing to do.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * This class provide the selection or the creation of a FacetSet.</p> + * + * FaceSet : [ TextField ][...]</p> + * + * The {@link GetOrCreateFacetSetDialog} dialog will be displayed when the + * button is pressed. + * + * @see GetOrCreateFacetSetDialog + */ +public class GetOrCreateFacetSetWidget extends + AbstractGetOrCreateElementWithDialogButtonWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> + implements IGetOrCreateFacetSetWidget { + + private final EditingDomain editingdoamin; + private final PropertyElement2<FacetSet> facetSetProperty; + private final FacetSet reject; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param facetSetProperty + * the property element that be edited with this composite. + * @param properties + * the map of properties of the parent. + */ + public GetOrCreateFacetSetWidget(final Composite parent, + final PropertyElement2<FacetSet> facetSetProperty, + final EditingDomain editingDomain, final FacetSet reject) { + super(parent, facetSetProperty); + this.facetSetProperty = facetSetProperty; + this.editingdoamin = editingDomain; + this.reject = reject; + } + + @Override + protected IDialog<IGetOrCreateFilteredFacetSetWidget> getCreationDialog( + final IWithResultDialogCallback<FacetSet> callback) { + return new GetOrCreateFacetSetDialog(callback, this.editingdoamin, + this.facetSetProperty, this.reject); + } + + @Override + protected String getLabel() { + return Messages.FacetSet; + } + + @Override + protected String getErrorMessage() { + return Messages.FacetSet_mustSelectFacetSet; + } + + @Override + protected String getTextFieldInitialText() { + return this.getPropertyElement().getValue2().getName(); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + public FacetSet getFacetSet() { + return this.facetSetProperty.getValue2(); + } + + @Override + protected void onCanceled() { + // Nothing to do. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetWidget.java index 1d77bbe720b..bf89989c6a1 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetWidget.java @@ -1,95 +1,95 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class provide the selection or the creation of a Facet.</p>
- *
- * Facet : [ TextField ][...]</p>
- *
- * The {@link GetOrCreateFacetDialog} dialog will be displayed when the button
- * is pressed.
- *
- * @see GetOrCreateFacetDialog
- */
-public class GetOrCreateFacetWidget extends
- AbstractGetOrCreateElementWithDialogButtonWidget<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> {
-
- private final EditingDomain editingDomain;
- private final FacetSet container;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param facetProperty
- * the property element that be edited with this composite.
- * @param container
- * @param properties
- * the map of properties of the parent.
- */
- public GetOrCreateFacetWidget(final Composite parent,
- final PropertyElement2<Facet> facetProperty,
- final EditingDomain editingDomain, final FacetSet container) {
- super(parent, facetProperty);
- this.editingDomain = editingDomain;
- this.container = container;
- }
-
- @Override
- protected String getLabel() {
- return Messages.Facet;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Facet_mustSelectFacet;
- }
-
- @Override
- protected IDialog<IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> getCreationDialog(
- final IWithResultDialogCallback<Facet> callback) {
- return new GetOrCreateFacetDialog(callback, this.editingDomain,
- this.container);
- }
-
- @Override
- protected String getTextFieldInitialText() {
- return ((Facet) this.getPropertyElement().getValue()).getName();
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- protected void onCanceled() {
- // Nothing to do.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * This class provide the selection or the creation of a Facet.</p> + * + * Facet : [ TextField ][...]</p> + * + * The {@link GetOrCreateFacetDialog} dialog will be displayed when the button + * is pressed. + * + * @see GetOrCreateFacetDialog + */ +public class GetOrCreateFacetWidget extends + AbstractGetOrCreateElementWithDialogButtonWidget<Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> { + + private final EditingDomain editingDomain; + private final FacetSet container; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param facetProperty + * the property element that be edited with this composite. + * @param container + * @param properties + * the map of properties of the parent. + */ + public GetOrCreateFacetWidget(final Composite parent, + final PropertyElement2<Facet> facetProperty, + final EditingDomain editingDomain, final FacetSet container) { + super(parent, facetProperty); + this.editingDomain = editingDomain; + this.container = container; + } + + @Override + protected String getLabel() { + return Messages.Facet; + } + + @Override + protected String getErrorMessage() { + return Messages.Facet_mustSelectFacet; + } + + @Override + protected IDialog<IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> getCreationDialog( + final IWithResultDialogCallback<Facet> callback) { + return new GetOrCreateFacetDialog(callback, this.editingDomain, + this.container); + } + + @Override + protected String getTextFieldInitialText() { + return ((Facet) this.getPropertyElement().getValue()).getName(); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + protected void onCanceled() { + // Nothing to do. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateOperationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateOperationWidget.java index 9f7132d4e4e..8819acd748e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateOperationWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateOperationWidget.java @@ -1,94 +1,94 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateOperationDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class provide the selection or the creation of a Operation.</p>
- *
- * Operation : [ TextField ][...]</p>
- *
- * The {@link GetOrCreateOperationDialog} dialog will be displayed when the
- * button is pressed.
- *
- * @see GetOrCreateOperationDialog
- */
-public class GetOrCreateOperationWidget extends
- AbstractGetOrCreateElementWithDialogButtonWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> {
-
- private final EditingDomain editingDomain;
- private final Facet context;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param facetOpProp
- * the property element that be edited with this composite.
- * @param properties
- * the map of properties of the parent.
- */
- public GetOrCreateOperationWidget(final Composite parent,
- final PropertyElement2<FacetOperation> facetOpProp,
- final EditingDomain editingDomain, final Facet context) {
- super(parent, facetOpProp);
- this.editingDomain = editingDomain;
- this.context = context;
- }
-
- @Override
- protected IDialog<IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> getCreationDialog(
- final IWithResultDialogCallback<FacetOperation> callback) {
- return new GetOrCreateOperationDialog(callback, this.editingDomain,
- this.context);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Operation;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Operation_mustSelectOperation;
- }
-
- @Override
- protected String getTextFieldInitialText() {
- return this.getPropertyElement().getValue2().getName();
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- protected void onCanceled() {
- // Nothing to do.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateOperationDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * This class provide the selection or the creation of a Operation.</p> + * + * Operation : [ TextField ][...]</p> + * + * The {@link GetOrCreateOperationDialog} dialog will be displayed when the + * button is pressed. + * + * @see GetOrCreateOperationDialog + */ +public class GetOrCreateOperationWidget extends + AbstractGetOrCreateElementWithDialogButtonWidget<FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> { + + private final EditingDomain editingDomain; + private final Facet context; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param facetOpProp + * the property element that be edited with this composite. + * @param properties + * the map of properties of the parent. + */ + public GetOrCreateOperationWidget(final Composite parent, + final PropertyElement2<FacetOperation> facetOpProp, + final EditingDomain editingDomain, final Facet context) { + super(parent, facetOpProp); + this.editingDomain = editingDomain; + this.context = context; + } + + @Override + protected IDialog<IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> getCreationDialog( + final IWithResultDialogCallback<FacetOperation> callback) { + return new GetOrCreateOperationDialog(callback, this.editingDomain, + this.context); + } + + @Override + protected String getLabel() { + return Messages.Operation; + } + + @Override + protected String getErrorMessage() { + return Messages.Operation_mustSelectOperation; + } + + @Override + protected String getTextFieldInitialText() { + return this.getPropertyElement().getValue2().getName(); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + protected void onCanceled() { + // Nothing to do. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetElementTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetElementTypeWidget.java index 97f79a919b5..0d4bf4da2b3 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetElementTypeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetElementTypeWidget.java @@ -1,79 +1,79 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * Concrete implementation of {@link AbstractGetMetaclassWidget} abstract
- * class.</p>
- *
- * Create a simple Label {@link #getLabel()}TextField and a button.</p> The type
- * used {@link ETypeSelectionOptions} depends of the element created.
- *
- * @see AddOperationInFacetWidget
- */
-public class GetElementTypeWidget extends
- AbstractGetMetaclassWidget<EClassifier> {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param propertyElement
- * the property element that will be edited by this composite.
- * @param facetSetProp
- * the property element to get the super, main, facetSet of the
- * model.
- * @param eTypeOption
- * @param eTypeOption
- * the type of the elements displayed in the selection wizard.
- */
- public GetElementTypeWidget(final Composite parent,
- final PropertyElement2<EClassifier> propertyElement,
- final PropertyElement2<FacetSet> facetSetProp,
- final Class<? extends EClassifier> eTypeOption) {
- super(parent, propertyElement, facetSetProp, eTypeOption);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Type;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Type_mustSelectType;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- protected EPackage getEPackage() {
-
- return null;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + + +/** + * Concrete implementation of {@link AbstractGetMetaclassWidget} abstract + * class.</p> + * + * Create a simple Label {@link #getLabel()}TextField and a button.</p> The type + * used {@link ETypeSelectionOptions} depends of the element created. + * + * @see AddOperationInFacetWidget + */ +public class GetElementTypeWidget extends + AbstractGetMetaclassWidget<EClassifier> { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param propertyElement + * the property element that will be edited by this composite. + * @param facetSetProp + * the property element to get the super, main, facetSet of the + * model. + * @param eTypeOption + * @param eTypeOption + * the type of the elements displayed in the selection wizard. + */ + public GetElementTypeWidget(final Composite parent, + final PropertyElement2<EClassifier> propertyElement, + final PropertyElement2<FacetSet> facetSetProp, + final Class<? extends EClassifier> eTypeOption) { + super(parent, propertyElement, facetSetProp, eTypeOption); + } + + @Override + protected String getLabel() { + return Messages.Type; + } + + @Override + protected String getErrorMessage() { + return Messages.Type_mustSelectType; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + protected EPackage getEPackage() { + + return null; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetExtendedMetaclassWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetExtendedMetaclassWidget.java index 4c043a5ca95..a2858674492 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetExtendedMetaclassWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetExtendedMetaclassWidget.java @@ -1,83 +1,83 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * Concrete implementation of {@link AbstractGetMetaclassWidget} abstract
- * class.</p>
- *
- * Create a simple Label {@link #getLabel()}TextField and a button.</p> This
- * class provide the selection the extended metaclass. The type used is {@link ETypeSelectionOptions#ECLASS}
- *
- * @see CreateFacetInFacetSetWidget
- * @since 0.3
- */
-public class GetExtendedMetaclassWidget extends
- AbstractGetMetaclassWidget<EClass> implements
- IGetExtendedMetaclassWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param editingDomain
- * the current editing domain.
- * @param propertyElement
- * the property element that will be edited by this composite.
- * @param facetSetProp
- * the property element to get the super, main, facetSet of the
- * model.
- */
- public GetExtendedMetaclassWidget(final Composite parent,
- final PropertyElement2<EClass> propertyElement,
- final PropertyElement2<FacetSet> facetSetProp) {
- super(parent, propertyElement, facetSetProp, EClass.class);
- }
-
- @Override
- protected String getLabel() {
- return Messages.ExtendedMetaClass;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Metaclass_mustSelectMetaclass;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- protected String getTextFieldInitialText() {
- return getPropertyElement().getValue2().getName();
- }
-
- @Override
- protected EPackage getEPackage() {
- return this.getEPackageProperty().getValue2();
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + + +/** + * Concrete implementation of {@link AbstractGetMetaclassWidget} abstract + * class.</p> + * + * Create a simple Label {@link #getLabel()}TextField and a button.</p> This + * class provide the selection the extended metaclass. The type used is {@link ETypeSelectionOptions#ECLASS} + * + * @see CreateFacetInFacetSetWidget + * @since 0.3 + */ +public class GetExtendedMetaclassWidget extends + AbstractGetMetaclassWidget<EClass> implements + IGetExtendedMetaclassWidget { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param editingDomain + * the current editing domain. + * @param propertyElement + * the property element that will be edited by this composite. + * @param facetSetProp + * the property element to get the super, main, facetSet of the + * model. + */ + public GetExtendedMetaclassWidget(final Composite parent, + final PropertyElement2<EClass> propertyElement, + final PropertyElement2<FacetSet> facetSetProp) { + super(parent, propertyElement, facetSetProp, EClass.class); + } + + @Override + protected String getLabel() { + return Messages.ExtendedMetaClass; + } + + @Override + protected String getErrorMessage() { + return Messages.Metaclass_mustSelectMetaclass; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + protected String getTextFieldInitialText() { + return getPropertyElement().getValue2().getName(); + } + + @Override + protected EPackage getEPackage() { + return this.getEPackageProperty().getValue2(); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetSubTypingTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetSubTypingTypeWidget.java index 966dff0a61d..4dcd082cc7b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetSubTypingTypeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetSubTypingTypeWidget.java @@ -1,88 +1,88 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetSubTypingTypeDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author amenager_stage
- *
- */
-public class GetSubTypingTypeWidget extends
- AbstractGetOrCreateElementWithDialogButtonWidget<ETypedElement, IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> {
-
- private final EditingDomain editingDoamin;
- private final EClass context;
- private final Facet facet;
-
- /**
- * @param parent
- * @param editingDomain
- * @param propertyElement
- */
- protected GetSubTypingTypeWidget(final Composite parent,
- final PropertyElement2<ETypedElement> propertyElement,
- final EditingDomain editingDomain, final EClass context,
- final Facet facet) {
- super(parent, propertyElement);
- this.editingDoamin = editingDomain;
- this.context = context;
- this.facet = facet;
- }
-
- @Override
- protected String getLabel() {
- return null;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Facet_mustSelectConformanceType;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- protected String getTextFieldInitialText() {
- return getPropertyElement().getValue2().getName();
- }
-
- @Override
- protected void onCanceled() {
- fireChanged();
- }
-
- // protected IDialog<GetFilteredSubTypingTypeWidget> getCreationDialog(
-
- @Override
- protected IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> getCreationDialog(
- final IWithResultDialogCallback<ETypedElement> callback) {
- return new GetSubTypingTypeDialog(callback, this.editingDoamin,
- this.facet, this.context);
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetSubTypingTypeDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * @author amenager_stage + * + */ +public class GetSubTypingTypeWidget extends + AbstractGetOrCreateElementWithDialogButtonWidget<ETypedElement, IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> { + + private final EditingDomain editingDoamin; + private final EClass context; + private final Facet facet; + + /** + * @param parent + * @param editingDomain + * @param propertyElement + */ + protected GetSubTypingTypeWidget(final Composite parent, + final PropertyElement2<ETypedElement> propertyElement, + final EditingDomain editingDomain, final EClass context, + final Facet facet) { + super(parent, propertyElement); + this.editingDoamin = editingDomain; + this.context = context; + this.facet = facet; + } + + @Override + protected String getLabel() { + return null; + } + + @Override + protected String getErrorMessage() { + return Messages.Facet_mustSelectConformanceType; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + protected String getTextFieldInitialText() { + return getPropertyElement().getValue2().getName(); + } + + @Override + protected void onCanceled() { + fireChanged(); + } + + // protected IDialog<GetFilteredSubTypingTypeWidget> getCreationDialog( + + @Override + protected IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> getCreationDialog( + final IWithResultDialogCallback<ETypedElement> callback) { + return new GetSubTypingTypeDialog(callback, this.editingDoamin, + this.facet, this.context); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/SelectSubTypingTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/SelectSubTypingTypeWidget.java index 7f84b5a6fad..b9c3a1e11f4 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/SelectSubTypingTypeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/SelectSubTypingTypeWidget.java @@ -1,161 +1,161 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class provide the composite:</p>
- *
- * Label : [x] [/TextField/] [...]</p>
- *
- * The text field is not directly editable by will be edit by the result of the
- * type selection. The {@link GetConformanceMetaclassWidget} composite is used
- * in this composite.</p>
- *
- * When the checkbox is selected, the button for the conformance type selection
- * is enabled.
- *
- * @see GetConformanceMetaclassWidget
- */
-public class SelectSubTypingTypeWidget extends AbstractWidget {
-
- private static final int COLUMN_NUMBER = 2;
- private final PropertyElement2<ETypedElement> propertyElement;
- private GetSubTypingTypeWidget conformanceWidget;
- private Button checkbox;
- private final EditingDomain editingDomain;
- private final EClass context;
- private final Facet facet;
-
- public SelectSubTypingTypeWidget(final Composite parent,
- final PropertyElement2<ETypedElement> propertyElement,
- final EditingDomain editingDomain, final EClass context,
- final Facet facet) {
- super(parent);
- this.setLayout(new GridLayout(COLUMN_NUMBER, false));
- this.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- this.propertyElement = propertyElement;
- this.editingDomain = editingDomain;
- this.context = context;
- this.facet = facet;
- }
-
- /**
- * @return the checkbox
- */
- public Button getCheckbox() {
- return this.checkbox;
- }
-
- @Override
- protected void addSubWidgets() {
- boolean enabled = false;
- if (this.propertyElement.getValue() != null) {
- enabled = true;
- }
- createCheckbox(enabled);
- this.conformanceWidget = new GetSubTypingTypeWidget(this,
- this.propertyElement, this.editingDomain, this.context,
- this.facet);
- addSubWidget(this.conformanceWidget);
- }
-
- /**
- * Create a checkbox in the composite. When the checkbox is selected, the
- * button for the conformance type selection is enabled.
- *
- * @param enabled
- */
- private void createCheckbox(final boolean enabled) {
- final Composite composite = new Composite(this, SWT.NONE);
- final GridLayout gridLayout = new GridLayout(COLUMN_NUMBER, false);
- gridLayout.marginWidth = 0;
- composite.setLayout(gridLayout);
-
- UIUtils.createLabel(composite,
- Messages.CreateFacetInFacetSetWizardPage_Sub_Typing_Facet);
-
- final SelectionListener selectionListener = new SelectionListener() {
-
- public void widgetSelected(final SelectionEvent event) {
- onWidgetSelected();
- }
-
- public void widgetDefaultSelected(final SelectionEvent event) {
- // NOTHING
- }
- };
- this.checkbox = UIUtils.createCheckbox(composite, true, enabled,
- selectionListener);
- }
-
- @Override
- public String getError() {
- String error = null;
-
- if (SelectSubTypingTypeWidget.this.getCheckbox().getSelection()) {
- error = this.conformanceWidget.getError();
- }
-
- return error;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- /**
- * Set the value of the checkbox.
- *
- * @param selected
- * the value of the selection.
- */
- public void setSelection(final boolean selected) {
- this.checkbox.setSelection(selected);
- onWidgetSelected();
- }
-
- public IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressButton() {
- return this.conformanceWidget.pressButton();
- }
-
- public String getSubTypingText() {
- return this.conformanceWidget.getText();
- }
-
- protected void onWidgetSelected() {
- SelectSubTypingTypeWidget.this.conformanceWidget.getButton()
- .setEnabled(
- SelectSubTypingTypeWidget.this.getCheckbox()
- .getSelection());
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.papyrus.emf.facet.util.ui.utils.UIUtils; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; + +/** + * This class provide the composite:</p> + * + * Label : [x] [/TextField/] [...]</p> + * + * The text field is not directly editable by will be edit by the result of the + * type selection. The {@link GetConformanceMetaclassWidget} composite is used + * in this composite.</p> + * + * When the checkbox is selected, the button for the conformance type selection + * is enabled. + * + * @see GetConformanceMetaclassWidget + */ +public class SelectSubTypingTypeWidget extends AbstractWidget { + + private static final int COLUMN_NUMBER = 2; + private final PropertyElement2<ETypedElement> propertyElement; + private GetSubTypingTypeWidget conformanceWidget; + private Button checkbox; + private final EditingDomain editingDomain; + private final EClass context; + private final Facet facet; + + public SelectSubTypingTypeWidget(final Composite parent, + final PropertyElement2<ETypedElement> propertyElement, + final EditingDomain editingDomain, final EClass context, + final Facet facet) { + super(parent); + this.setLayout(new GridLayout(COLUMN_NUMBER, false)); + this.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + this.propertyElement = propertyElement; + this.editingDomain = editingDomain; + this.context = context; + this.facet = facet; + } + + /** + * @return the checkbox + */ + public Button getCheckbox() { + return this.checkbox; + } + + @Override + protected void addSubWidgets() { + boolean enabled = false; + if (this.propertyElement.getValue() != null) { + enabled = true; + } + createCheckbox(enabled); + this.conformanceWidget = new GetSubTypingTypeWidget(this, + this.propertyElement, this.editingDomain, this.context, + this.facet); + addSubWidget(this.conformanceWidget); + } + + /** + * Create a checkbox in the composite. When the checkbox is selected, the + * button for the conformance type selection is enabled. + * + * @param enabled + */ + private void createCheckbox(final boolean enabled) { + final Composite composite = new Composite(this, SWT.NONE); + final GridLayout gridLayout = new GridLayout(COLUMN_NUMBER, false); + gridLayout.marginWidth = 0; + composite.setLayout(gridLayout); + + UIUtils.createLabel(composite, + Messages.CreateFacetInFacetSetWizardPage_Sub_Typing_Facet); + + final SelectionListener selectionListener = new SelectionListener() { + + public void widgetSelected(final SelectionEvent event) { + onWidgetSelected(); + } + + public void widgetDefaultSelected(final SelectionEvent event) { + // NOTHING + } + }; + this.checkbox = UIUtils.createCheckbox(composite, true, enabled, + selectionListener); + } + + @Override + public String getError() { + String error = null; + + if (SelectSubTypingTypeWidget.this.getCheckbox().getSelection()) { + error = this.conformanceWidget.getError(); + } + + return error; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + /** + * Set the value of the checkbox. + * + * @param selected + * the value of the selection. + */ + public void setSelection(final boolean selected) { + this.checkbox.setSelection(selected); + onWidgetSelected(); + } + + public IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressButton() { + return this.conformanceWidget.pressButton(); + } + + public String getSubTypingText() { + return this.conformanceWidget.getText(); + } + + protected void onWidgetSelected() { + SelectSubTypingTypeWidget.this.conformanceWidget.getButton() + .setEnabled( + SelectSubTypingTypeWidget.this.getCheckbox() + .getSelection()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetChangeableWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetChangeableWidget.java index d7d0d555762..7edd3f3bce2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetChangeableWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetChangeableWidget.java @@ -1,57 +1,57 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * Changeable property.
- */
-public class GetChangeableWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetChangeableWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Changeable;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * Changeable property. + */ +public class GetChangeableWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetChangeableWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Changeable; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetDerivedWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetDerivedWidget.java index bd1fb9e09b0..286c0f32fb6 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetDerivedWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetDerivedWidget.java @@ -1,57 +1,57 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * Derived property.
- */
-public class GetDerivedWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetDerivedWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Derived;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * Derived property. + */ +public class GetDerivedWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetDerivedWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Derived; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetOrderedWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetOrderedWidget.java index 2627b4badec..84e03a1ff20 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetOrderedWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetOrderedWidget.java @@ -1,57 +1,57 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the Ordered
- * property.
- */
-public class GetOrderedWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetOrderedWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Ordered;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the Ordered + * property. + */ +public class GetOrderedWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetOrderedWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Ordered; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetTransientWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetTransientWidget.java index 18220e85222..0e002910954 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetTransientWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetTransientWidget.java @@ -1,57 +1,57 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * Transient property.
- */
-public class GetTransientWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetTransientWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Transient;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * Transient property. + */ +public class GetTransientWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetTransientWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Transient; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetUniqueWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetUniqueWidget.java index 7c8e0b5f59c..3cf76c394e1 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetUniqueWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetUniqueWidget.java @@ -1,59 +1,59 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * Unique property.
- */
-public class GetUniqueWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param editingDomain
- * the current editing domain.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetUniqueWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Unique;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * Unique property. + */ +public class GetUniqueWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param editingDomain + * the current editing domain. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetUniqueWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Unique; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetVolatileWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetVolatileWidget.java index 072f77898ba..d594ce8ebd8 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetVolatileWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetVolatileWidget.java @@ -1,57 +1,57 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * Volatile property.
- */
-public class GetVolatileWidget extends AbstractGetPropertyWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetVolatileWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Volatile;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * Volatile property. + */ +public class GetVolatileWidget extends AbstractGetPropertyWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetVolatileWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Volatile; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetLowerBoundWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetLowerBoundWidget.java index d7e93046030..407d43138f3 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetLowerBoundWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetLowerBoundWidget.java @@ -1,56 +1,56 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetBoundsWidget} for the
- * LowerBound.
- */
-public class GetLowerBoundWidget extends AbstractGetBoundsWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetLowerBoundWidget(final Composite parent,
- final PropertyElement2<Integer> propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Lower_bound;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a Spinner, the default value of a Spinner is "0"
- // so the value can't be null.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetBoundsWidget} for the + * LowerBound. + */ +public class GetLowerBoundWidget extends AbstractGetBoundsWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetLowerBoundWidget(final Composite parent, + final PropertyElement2<Integer> propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Lower_bound; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a Spinner, the default value of a Spinner is "0" + // so the value can't be null. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetUpperBoundWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetUpperBoundWidget.java index ee86d115805..a052e2165a7 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetUpperBoundWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/bounds/GetUpperBoundWidget.java @@ -1,56 +1,56 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetBoundsWidget} for the
- * UpperBound.
- */
-public class GetUpperBoundWidget extends AbstractGetBoundsWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent containing this composite.
- * @param style
- * the style of the composite.
- * @param propertyElement
- * the property element that this composite will edit.
- */
- public GetUpperBoundWidget(final Composite parent,
- final PropertyElement2<Integer> propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Upper_bound;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a Spinner, the default value of a Spinner is "0"
- // so the value can't be null.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetBoundsWidget} for the + * UpperBound. + */ +public class GetUpperBoundWidget extends AbstractGetBoundsWidget { + + /** + * Constructor. + * + * @param parent + * the parent containing this composite. + * @param style + * the style of the composite. + * @param propertyElement + * the property element that this composite will edit. + */ + public GetUpperBoundWidget(final Composite parent, + final PropertyElement2<Integer> propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Upper_bound; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a Spinner, the default value of a Spinner is "0" + // so the value can't be null. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetAttributeNameWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetAttributeNameWidget.java index f2965a29773..a6a40d4db7a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetAttributeNameWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetAttributeNameWidget.java @@ -1,56 +1,56 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The concrete implementation of {@link AbstractGetElementNameWidget} for the
- * Attribute Name.
- *
- * @see AbstractGetElementNameWidget
- */
-public class GetAttributeNameWidget extends AbstractGetElementNameWidget {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param propertyElement
- * the property element that be edited with this composite.
- */
- public GetAttributeNameWidget(final Composite parent,
- final PropertyElement2<String> propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Attribute_name;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Facet_mustGiveAttributeName;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * The concrete implementation of {@link AbstractGetElementNameWidget} for the + * Attribute Name. + * + * @see AbstractGetElementNameWidget + */ +public class GetAttributeNameWidget extends AbstractGetElementNameWidget { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param propertyElement + * the property element that be edited with this composite. + */ + public GetAttributeNameWidget(final Composite parent, + final PropertyElement2<String> propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Attribute_name; + } + + @Override + protected String getErrorMessage() { + return Messages.Facet_mustGiveAttributeName; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetOperationNameWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetOperationNameWidget.java index 9678a2db6ea..a18151f591e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetOperationNameWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetOperationNameWidget.java @@ -1,47 +1,47 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The concrete implementation of {@link AbstractGetElementNameWidget} for the
- * Operation Name.
- *
- * @see AbstractGetElementNameWidget
- */
-public class GetOperationNameWidget extends AbstractGetElementNameWidget {
-
- public GetOperationNameWidget(final Composite parent,
- final PropertyElement2<String> propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Operation_name;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Facet_mustGiveOperationName;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * The concrete implementation of {@link AbstractGetElementNameWidget} for the + * Operation Name. + * + * @see AbstractGetElementNameWidget + */ +public class GetOperationNameWidget extends AbstractGetElementNameWidget { + + public GetOperationNameWidget(final Composite parent, + final PropertyElement2<String> propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Operation_name; + } + + @Override + protected String getErrorMessage() { + return Messages.Facet_mustGiveOperationName; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetReferenceNameWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetReferenceNameWidget.java index 0810046181e..e1d06fc1a70 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetReferenceNameWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/name/GetReferenceNameWidget.java @@ -1,48 +1,48 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The concrete implementation of {@link AbstractGetElementNameWidget} for the
- * Reference Name.
- *
- * @see AbstractGetElementNameWidget
- */
-public class GetReferenceNameWidget extends AbstractGetElementNameWidget {
-
- public GetReferenceNameWidget(final Composite parent,
- final PropertyElement2<String> propertyElement) {
- super(parent, propertyElement);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Reference_name;
- }
-
- @Override
- protected String getErrorMessage() {
- return Messages.Facet_mustGiveReferenceName;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * The concrete implementation of {@link AbstractGetElementNameWidget} for the + * Reference Name. + * + * @see AbstractGetElementNameWidget + */ +public class GetReferenceNameWidget extends AbstractGetElementNameWidget { + + public GetReferenceNameWidget(final Composite parent, + final PropertyElement2<String> propertyElement) { + super(parent, propertyElement); + } + + @Override + protected String getLabel() { + return Messages.Reference_name; + } + + @Override + protected String getErrorMessage() { + return Messages.Facet_mustGiveReferenceName; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/CreateQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/CreateQueryWidget.java index a84e75e330d..5d73c7d4d2f 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/CreateQueryWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/CreateQueryWidget.java @@ -1,105 +1,105 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query.AbstractQueryDialogFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This widget is the base of the query creation widget.</p>
- *
- * The name, canBeCashed and canHavSideEffects are originally present and the
- * others properties needed by the query are returned by the concrete widget
- * returned by {@link AbstractQueryDialogFactory#createWidget()}.
- *
- * @see AbstractQueryDialogFactory
- */
-public class CreateQueryWidget extends AbstractCommandWidget implements
- ICreateQueryWidget {
-
- private final IQueryDialogFactoryStrategy strategy;
- // Widgets
- private GetCanBeCachedWidget canBeCachedWidget;
- private GetCanHaveSideEffectsWidget sideEffectsWidget;
- private IAbstractWidget queryWidget;
- // Properties
- private final PropertyElement canBeCachedProp;
- private final PropertyElement sideEffectsProp;
- private final IQueryContext queryContext;
-
-
- public CreateQueryWidget(final Composite parent,
- final IQueryDialogFactoryStrategy strategy,
- final PropertyElement canBeCachedProp,
- final PropertyElement sideEffectsProp,
- final IQueryContext queryContext) {
- super(parent);
- this.strategy = strategy;
- this.canBeCachedProp = canBeCachedProp;
- this.sideEffectsProp = sideEffectsProp;
- this.queryContext = queryContext;
- }
-
- @Override
- public Command getCommand() {
- return null;
- }
-
- @Override
- protected void addSubWidgets() {
- this.canBeCachedWidget = new GetCanBeCachedWidget(this,
- this.canBeCachedProp);
- addSubWidget(this.canBeCachedWidget);
- this.sideEffectsWidget = new GetCanHaveSideEffectsWidget(this,
- this.sideEffectsProp);
- addSubWidget(this.sideEffectsWidget);
- this.queryWidget = this.strategy.createWidget(this, this.queryContext);
- addSubWidget(this.queryWidget);
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
- /**
- * @return CanBeCached value.
- */
- public boolean isCanBeCached() {
- return this.canBeCachedWidget.isSelected();
- }
-
- /**
- * @return HasSideEffect value.
- */
- public boolean isHasSideEffect() {
- return this.sideEffectsWidget.isSelected();
- }
-
- public IAbstractWidget getCreateQueryWidget() {
- return this.queryWidget;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query.AbstractQueryDialogFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * This widget is the base of the query creation widget.</p> + * + * The name, canBeCashed and canHavSideEffects are originally present and the + * others properties needed by the query are returned by the concrete widget + * returned by {@link AbstractQueryDialogFactory#createWidget()}. + * + * @see AbstractQueryDialogFactory + */ +public class CreateQueryWidget extends AbstractCommandWidget implements + ICreateQueryWidget { + + private final IQueryDialogFactoryStrategy strategy; + // Widgets + private GetCanBeCachedWidget canBeCachedWidget; + private GetCanHaveSideEffectsWidget sideEffectsWidget; + private IAbstractWidget queryWidget; + // Properties + private final PropertyElement canBeCachedProp; + private final PropertyElement sideEffectsProp; + private final IQueryContext queryContext; + + + public CreateQueryWidget(final Composite parent, + final IQueryDialogFactoryStrategy strategy, + final PropertyElement canBeCachedProp, + final PropertyElement sideEffectsProp, + final IQueryContext queryContext) { + super(parent); + this.strategy = strategy; + this.canBeCachedProp = canBeCachedProp; + this.sideEffectsProp = sideEffectsProp; + this.queryContext = queryContext; + } + + @Override + public Command getCommand() { + return null; + } + + @Override + protected void addSubWidgets() { + this.canBeCachedWidget = new GetCanBeCachedWidget(this, + this.canBeCachedProp); + addSubWidget(this.canBeCachedWidget); + this.sideEffectsWidget = new GetCanHaveSideEffectsWidget(this, + this.sideEffectsProp); + addSubWidget(this.sideEffectsWidget); + this.queryWidget = this.strategy.createWidget(this, this.queryContext); + addSubWidget(this.queryWidget); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } + + /** + * @return CanBeCached value. + */ + public boolean isCanBeCached() { + return this.canBeCachedWidget.isSelected(); + } + + /** + * @return HasSideEffect value. + */ + public boolean isHasSideEffect() { + return this.sideEffectsWidget.isSelected(); + } + + public IAbstractWidget getCreateQueryWidget() { + return this.queryWidget; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanBeCachedWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanBeCachedWidget.java index 58239d0ccce..4651a983e57 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanBeCachedWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanBeCachedWidget.java @@ -1,50 +1,50 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the can be
- * cached property.
- */
-public class GetCanBeCachedWidget extends AbstractGetPropertyWidget {
-
- private static final int LABEL_WIDTH_HINT = 110;
-
- public GetCanBeCachedWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- setLabelWidthHint(LABEL_WIDTH_HINT);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Query_Can_be_cached;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the can be + * cached property. + */ +public class GetCanBeCachedWidget extends AbstractGetPropertyWidget { + + private static final int LABEL_WIDTH_HINT = 110; + + public GetCanBeCachedWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + setLabelWidthHint(LABEL_WIDTH_HINT); + } + + @Override + protected String getLabel() { + return Messages.Query_Can_be_cached; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanHaveSideEffectsWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanHaveSideEffectsWidget.java index a5afe974f8b..351d3d23155 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanHaveSideEffectsWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanHaveSideEffectsWidget.java @@ -1,50 +1,50 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetPropertyWidget} for the
- * can have side effects property.
- */
-public class GetCanHaveSideEffectsWidget extends AbstractGetPropertyWidget {
-
- private static final int LABEL_WIDTH_HINT = 110;
-
- public GetCanHaveSideEffectsWidget(final Composite parent,
- final PropertyElement propertyElement) {
- super(parent, propertyElement);
- setLabelWidthHint(LABEL_WIDTH_HINT);
- }
-
- @Override
- protected String getLabel() {
- return Messages.Query_has_side_effect;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public String getError() {
- // A property widget is a checkbox, so the values can be "true" or
- // "false" so, no error can be throws because a value will be always
- // put.
- return null;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.query; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetPropertyWidget} for the + * can have side effects property. + */ +public class GetCanHaveSideEffectsWidget extends AbstractGetPropertyWidget { + + private static final int LABEL_WIDTH_HINT = 110; + + public GetCanHaveSideEffectsWidget(final Composite parent, + final PropertyElement propertyElement) { + super(parent, propertyElement); + setLabelWidthHint(LABEL_WIDTH_HINT); + } + + @Override + protected String getLabel() { + return Messages.Query_has_side_effect; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public String getError() { + // A property widget is a checkbox, so the values can be "true" or + // "false" so, no error can be throws because a value will be always + // put. + return null; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractDerivedTypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractDerivedTypedElementWidget.java index db04ece62c1..2b5983174f4 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractDerivedTypedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractDerivedTypedElementWidget.java @@ -1,184 +1,184 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query.SelectQueryTypeWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.emf.core.ModelUtils;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Abstract Widget implementing {@link IDerivedTypedElementWidget}.
- */
-public abstract class AbstractDerivedTypedElementWidget<T extends DerivedTypedElement>
- extends
- AbstractETypedElementWidget<T, Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>>
- implements
- IDerivedTypedElementWidget {
-
- private SelectQueryTypeWidget queryTypeWidget;
- private final Facet facet;
-
- private final PropertyElement2<Query> queryProperty;
-
- public AbstractDerivedTypedElementWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty) {
- super(parent, editingDomain, facetProperty, nameProperty,
- lowerBdProperty,
- upperBdProperty, typeProperty, orderedProperty, uniqueProperty);
- this.facet = facetProperty.getValue2();
- this.queryProperty = queryProperty;
- }
-
- @Override
- protected void addSubWidgets() {
- super.addSubWidgets();
- // Query
- this.queryTypeWidget = new SelectQueryTypeWidget(this,
- this.queryProperty, this.getQueryContext());
- this.queryTypeWidget
- .setAlertMessage(Messages.Query_Select_Name_And_Type);
- addSubWidget(this.queryTypeWidget);
- }
-
- protected final IQueryContext getQueryContext() {
- return new QueryContext(this);
- }
-
- public SelectQueryTypeWidget getQueryTypeWidgetComposite() {
- return this.queryTypeWidget;
- }
-
- @Override
- protected GetOrCreateFacetWidget createGetOrCreateElementWidgetComposite() {
- return new GetOrCreateFacetWidget(this, this.getContainerPropery(),
- this.getEditingDomain(), (FacetSet) this.getContainerPropery()
- .getValue2().eContainer());
- }
-
- @Override
- public void notifyChanged() {
- final Object name = this.getElementNameProperty().getValue();
- final Object type = this.getTypeProperty().getValue();
- final boolean enable = !("".equals(name) || "".equals(type) || type == null); //$NON-NLS-1$ //$NON-NLS-2$
- this.getQueryTypeWidgetComposite().setSelectionEnabled(enable);
- }
-
- /**
- * @return the queryProperty
- */
- public PropertyElement2<Query> getQueryProperty() {
- return this.queryProperty;
- }
-
- public Query getQueryPropertyValue() {
- return (Query) this.queryProperty.getValue();
- }
-
- public boolean isQueryEnable() {
- return this.queryTypeWidget.isSelectionEnabled();
- }
-
- public IDialog<ICreateQueryWidget> selectQueryType(final String queryName) {
- return this.queryTypeWidget.selectQueryType(queryName);
- }
-
- public String getQueryText() {
- return this.queryTypeWidget.getText();
- }
-
- public Query getQuery() {
- return (Query) this.queryProperty.getValue();
- }
-
- public void setQuery(final Query value) {
- this.queryProperty.setValue(value);
- }
-
- public Facet getFacet() {
- return this.facet;
- }
-
- private class QueryContext implements IQueryContext {
-
- private final AbstractDerivedTypedElementWidget<T> widget;
-
- public QueryContext(final AbstractDerivedTypedElementWidget<T> widget) {
- this.widget = widget;
- }
-
- public int getUpperBound() {
- return this.widget.getUpperBoundProperty().getValue2().intValue();
- }
-
- public EClassifier getReturnType() {
- return this.widget.getEType();
- }
-
- public Resource getResource() {
- return this.widget.getFacet().eResource();
- }
-
- public Query getQuery() {
- return this.widget.getQueryPropertyValue();
- }
-
- public IProject getProject() {
- return ModelUtils.getProject(this.widget.getFacet());
- }
-
- public EObject getIntermediateEObject() {
- return null;
- }
-
- public Facet getFacet() {
- return this.widget.getFacet();
- }
-
- public EClassifier getExtendedEClass() {
- return FacetUtils.getExtendedMetaclass(this.widget.getFacet());
- }
-
- public String getDerivedTypedElementName() {
- return this.widget.getElementNamePropertyValue();
- }
-
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.core.resources.IProject; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.query.SelectQueryTypeWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetWidget; +import org.eclipse.papyrus.emf.facet.util.emf.core.ModelUtils; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Abstract Widget implementing {@link IDerivedTypedElementWidget}. + */ +public abstract class AbstractDerivedTypedElementWidget<T extends DerivedTypedElement> + extends + AbstractETypedElementWidget<T, Facet, IGetOrCreateFilteredElementCommmandWidget<Facet, IFacetWidget>> + implements + IDerivedTypedElementWidget { + + private SelectQueryTypeWidget queryTypeWidget; + private final Facet facet; + + private final PropertyElement2<Query> queryProperty; + + public AbstractDerivedTypedElementWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty) { + super(parent, editingDomain, facetProperty, nameProperty, + lowerBdProperty, + upperBdProperty, typeProperty, orderedProperty, uniqueProperty); + this.facet = facetProperty.getValue2(); + this.queryProperty = queryProperty; + } + + @Override + protected void addSubWidgets() { + super.addSubWidgets(); + // Query + this.queryTypeWidget = new SelectQueryTypeWidget(this, + this.queryProperty, this.getQueryContext()); + this.queryTypeWidget + .setAlertMessage(Messages.Query_Select_Name_And_Type); + addSubWidget(this.queryTypeWidget); + } + + protected final IQueryContext getQueryContext() { + return new QueryContext(this); + } + + public SelectQueryTypeWidget getQueryTypeWidgetComposite() { + return this.queryTypeWidget; + } + + @Override + protected GetOrCreateFacetWidget createGetOrCreateElementWidgetComposite() { + return new GetOrCreateFacetWidget(this, this.getContainerPropery(), + this.getEditingDomain(), (FacetSet) this.getContainerPropery() + .getValue2().eContainer()); + } + + @Override + public void notifyChanged() { + final Object name = this.getElementNameProperty().getValue(); + final Object type = this.getTypeProperty().getValue(); + final boolean enable = !("".equals(name) || "".equals(type) || type == null); //$NON-NLS-1$ //$NON-NLS-2$ + this.getQueryTypeWidgetComposite().setSelectionEnabled(enable); + } + + /** + * @return the queryProperty + */ + public PropertyElement2<Query> getQueryProperty() { + return this.queryProperty; + } + + public Query getQueryPropertyValue() { + return (Query) this.queryProperty.getValue(); + } + + public boolean isQueryEnable() { + return this.queryTypeWidget.isSelectionEnabled(); + } + + public IDialog<ICreateQueryWidget> selectQueryType(final String queryName) { + return this.queryTypeWidget.selectQueryType(queryName); + } + + public String getQueryText() { + return this.queryTypeWidget.getText(); + } + + public Query getQuery() { + return (Query) this.queryProperty.getValue(); + } + + public void setQuery(final Query value) { + this.queryProperty.setValue(value); + } + + public Facet getFacet() { + return this.facet; + } + + private class QueryContext implements IQueryContext { + + private final AbstractDerivedTypedElementWidget<T> widget; + + public QueryContext(final AbstractDerivedTypedElementWidget<T> widget) { + this.widget = widget; + } + + public int getUpperBound() { + return this.widget.getUpperBoundProperty().getValue2().intValue(); + } + + public EClassifier getReturnType() { + return this.widget.getEType(); + } + + public Resource getResource() { + return this.widget.getFacet().eResource(); + } + + public Query getQuery() { + return this.widget.getQueryPropertyValue(); + } + + public IProject getProject() { + return ModelUtils.getProject(this.widget.getFacet()); + } + + public EObject getIntermediateEObject() { + return null; + } + + public Facet getFacet() { + return this.widget.getFacet(); + } + + public EClassifier getExtendedEClass() { + return FacetUtils.getExtendedMetaclass(this.widget.getFacet()); + } + + public String getDerivedTypedElementName() { + return this.widget.getElementNamePropertyValue(); + } + + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractENamedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractENamedElementWidget.java index 65eb85e562d..3df88bf08eb 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractENamedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractENamedElementWidget.java @@ -1,124 +1,124 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.core.IFacetCommandFactory;
-import org.eclipse.papyrus.emf.facet.efacet.core.IFacetCommandFactoryFactory;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Abstract widget implementing {@link IENamedElementWidget}.
- *
- * @param C
- * container
- * @param T
- * type of edited element
- * @param CW
- * the type of the widget contained by the dialog open to edit the
- * container field
- *
- * */
-public abstract class AbstractENamedElementWidget<T extends ENamedElement, C extends EObject, CW extends Object>
- extends AbstractCommandWidget implements IENamedElementWidget<C, CW> {
-
- private final PropertyElement2<C> containerProperty;
- private final PropertyElement2<String> nameProperty;
-
- private IAbstractGetOrCreateElementWithButtonWidget<IDialog<CW>> containerWidget;
- private IAbstractGetOrCreateElementWidget elementNameSubWC;
- private final IFacetCommandFactory commandFatory;
- private final EditingDomain editingDomain;
-
- public AbstractENamedElementWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<C> facetProperty,
- final PropertyElement2<String> nameProperty) {
- super(parent);
- this.containerProperty = facetProperty;
- this.nameProperty = nameProperty;
- this.editingDomain = editingDomain;
- this.commandFatory = IFacetCommandFactoryFactory.DEFAULT
- .createCommandFactory(editingDomain);
- }
-
- @Override
- protected void addSubWidgets() {
- this.containerWidget = createGetOrCreateElementWidgetComposite();
- addSubWidget(this.containerWidget);
- this.elementNameSubWC = createGetElementNameSubWidgetComposite();
- addSubWidget(this.elementNameSubWC);
- }
-
- /**
- * @return the sub widget composite for the creation of the element.
- */
- protected abstract IAbstractGetOrCreateElementWithButtonWidget<IDialog<CW>> createGetOrCreateElementWidgetComposite();
-
- /**
- * @return the sub widget composite for the get of the element name.
- */
- protected abstract IAbstractGetOrCreateElementWidget createGetElementNameSubWidgetComposite();
-
- /**
- *
- * @return the facetProperty
- */
- public PropertyElement2<C> getContainerPropery() {
- return this.containerProperty;
- }
-
- /**
- * @return the elementNameProperty
- */
- public PropertyElement2<String> getElementNameProperty() {
- return this.nameProperty;
- }
-
- public String getElementNamePropertyValue() {
- return this.nameProperty.getValue2();
- }
-
- public IDialog<CW> pressParentButton() {
- return this.containerWidget.pressButton();
- }
-
- public String getElementName() {
- return this.elementNameSubWC.getText();
- }
-
- public void setName(final String value) {
- this.elementNameSubWC.setText(value);
- }
-
- public C getContainer() {
- return this.containerProperty.getValue2();
- }
-
- protected final IFacetCommandFactory getCommandFactory() {
- return this.commandFatory;
- }
-
- protected final EditingDomain getEditingDomain() {
- return this.editingDomain;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetCommandFactory; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetCommandFactoryFactory; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Abstract widget implementing {@link IENamedElementWidget}. + * + * @param C + * container + * @param T + * type of edited element + * @param CW + * the type of the widget contained by the dialog open to edit the + * container field + * + * */ +public abstract class AbstractENamedElementWidget<T extends ENamedElement, C extends EObject, CW extends Object> + extends AbstractCommandWidget implements IENamedElementWidget<C, CW> { + + private final PropertyElement2<C> containerProperty; + private final PropertyElement2<String> nameProperty; + + private IAbstractGetOrCreateElementWithButtonWidget<IDialog<CW>> containerWidget; + private IAbstractGetOrCreateElementWidget elementNameSubWC; + private final IFacetCommandFactory commandFatory; + private final EditingDomain editingDomain; + + public AbstractENamedElementWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<C> facetProperty, + final PropertyElement2<String> nameProperty) { + super(parent); + this.containerProperty = facetProperty; + this.nameProperty = nameProperty; + this.editingDomain = editingDomain; + this.commandFatory = IFacetCommandFactoryFactory.DEFAULT + .createCommandFactory(editingDomain); + } + + @Override + protected void addSubWidgets() { + this.containerWidget = createGetOrCreateElementWidgetComposite(); + addSubWidget(this.containerWidget); + this.elementNameSubWC = createGetElementNameSubWidgetComposite(); + addSubWidget(this.elementNameSubWC); + } + + /** + * @return the sub widget composite for the creation of the element. + */ + protected abstract IAbstractGetOrCreateElementWithButtonWidget<IDialog<CW>> createGetOrCreateElementWidgetComposite(); + + /** + * @return the sub widget composite for the get of the element name. + */ + protected abstract IAbstractGetOrCreateElementWidget createGetElementNameSubWidgetComposite(); + + /** + * + * @return the facetProperty + */ + public PropertyElement2<C> getContainerPropery() { + return this.containerProperty; + } + + /** + * @return the elementNameProperty + */ + public PropertyElement2<String> getElementNameProperty() { + return this.nameProperty; + } + + public String getElementNamePropertyValue() { + return this.nameProperty.getValue2(); + } + + public IDialog<CW> pressParentButton() { + return this.containerWidget.pressButton(); + } + + public String getElementName() { + return this.elementNameSubWC.getText(); + } + + public void setName(final String value) { + this.elementNameSubWC.setText(value); + } + + public C getContainer() { + return this.containerProperty.getValue2(); + } + + protected final IFacetCommandFactory getCommandFactory() { + return this.commandFatory; + } + + protected final EditingDomain getEditingDomain() { + return this.editingDomain; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractEStructuralFeatureWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractEStructuralFeatureWidget.java index 43e1cfed37d..a6634ec20af 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractEStructuralFeatureWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractEStructuralFeatureWidget.java @@ -1,137 +1,137 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetChangeableWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetDerivedWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetTransientWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetVolatileWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Abstract widget implementing {@link IEStructuralFeatureWidget}.
- */
-public abstract class AbstractEStructuralFeatureWidget<T extends DerivedTypedElement>
- extends AbstractDerivedTypedElementWidget<T> implements
- IEStructuralFeatureWidget {
-
- private final DerivedTypedElement dte;
- private final PropertyElement2<Boolean> volatileProperty;
- private final PropertyElement2<Boolean> changeProperty;
- private final PropertyElement2<Boolean> derivedProperty;
- private final PropertyElement2<Boolean> transientProperty;
-
- private GetVolatileWidget volatileWidget;
- private GetChangeableWidget changeableWidget;
- private GetDerivedWidget derivedWidget;
- private GetTransientWidget transientWidget;
-
- public AbstractEStructuralFeatureWidget(final DerivedTypedElement dte,
- final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty,
- final PropertyElement2<Boolean> volatileProperty,
- final PropertyElement2<Boolean> changeProperty,
- final PropertyElement2<Boolean> derivedProperty,
- final PropertyElement2<Boolean> transientProperty) {
- super(parent, editingDomain, facetProperty, nameProperty,
- lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty, queryProperty);
- this.dte = dte;
- this.volatileProperty = volatileProperty;
- this.changeProperty = changeProperty;
- this.derivedProperty = derivedProperty;
- this.transientProperty = transientProperty;
- }
-
- @Override
- protected void addSubWidgets() {
- super.addSubWidgets();
- this.volatileWidget = new GetVolatileWidget(getComposite(),
- this.volatileProperty);
- addSubWidget(this.volatileWidget);
- this.changeableWidget = new GetChangeableWidget(getComposite(),
- this.changeProperty);
- addSubWidget(this.changeableWidget);
- this.derivedWidget = new GetDerivedWidget(getComposite(),
- this.derivedProperty);
- addSubWidget(this.derivedWidget);
- this.transientWidget = new GetTransientWidget(getComposite(),
- this.transientProperty);
- addSubWidget(this.transientWidget);
- }
-
- @Override
- public Command getCommand() {
- return this.getCommandFactory()
- .createEditFacetStructuralFeatureCommand(this.dte,
- this.getContainer(), this.getElementName(),
- this.getLowerBoundProperty().getValue2().intValue(),
- this.getUpperBoundProperty().getValue2().intValue(),
- this.getTypeProperty().getValue2(),
- this.getOrderedProperty().getValue2().booleanValue(),
- this.getUniqueProperty().getValue2().booleanValue(),
- this.getQueryPropertyValue(),
- this.volatileProperty.getValue2().booleanValue(),
- this.changeProperty.getValue2().booleanValue(),
- this.derivedProperty.getValue2().booleanValue(),
- this.transientProperty.getValue2().booleanValue());
- }
-
- public boolean isTransient() {
- return this.transientWidget.isSelected();
- }
-
- public void setTransient(final boolean value) {
- this.transientWidget.setPropertyEnabled(value);
- }
-
- public boolean isVolatile() {
- return this.volatileWidget.isSelected();
- }
-
- public void setVolatile(final boolean value) {
- this.volatileWidget.setPropertyEnabled(value);
- }
-
- public boolean isChangeable() {
- return this.changeableWidget.isSelected();
- }
-
- public void setChangeable(final boolean value) {
- this.changeableWidget.setPropertyEnabled(value);
- }
-
- public boolean isDerived() {
- return this.derivedWidget.isSelected();
- }
-
- public void setDerived(final boolean value) {
- this.derivedWidget.setPropertyEnabled(value);
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetChangeableWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetDerivedWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetTransientWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetVolatileWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Abstract widget implementing {@link IEStructuralFeatureWidget}. + */ +public abstract class AbstractEStructuralFeatureWidget<T extends DerivedTypedElement> + extends AbstractDerivedTypedElementWidget<T> implements + IEStructuralFeatureWidget { + + private final DerivedTypedElement dte; + private final PropertyElement2<Boolean> volatileProperty; + private final PropertyElement2<Boolean> changeProperty; + private final PropertyElement2<Boolean> derivedProperty; + private final PropertyElement2<Boolean> transientProperty; + + private GetVolatileWidget volatileWidget; + private GetChangeableWidget changeableWidget; + private GetDerivedWidget derivedWidget; + private GetTransientWidget transientWidget; + + public AbstractEStructuralFeatureWidget(final DerivedTypedElement dte, + final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty, + final PropertyElement2<Boolean> volatileProperty, + final PropertyElement2<Boolean> changeProperty, + final PropertyElement2<Boolean> derivedProperty, + final PropertyElement2<Boolean> transientProperty) { + super(parent, editingDomain, facetProperty, nameProperty, + lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty, queryProperty); + this.dte = dte; + this.volatileProperty = volatileProperty; + this.changeProperty = changeProperty; + this.derivedProperty = derivedProperty; + this.transientProperty = transientProperty; + } + + @Override + protected void addSubWidgets() { + super.addSubWidgets(); + this.volatileWidget = new GetVolatileWidget(getComposite(), + this.volatileProperty); + addSubWidget(this.volatileWidget); + this.changeableWidget = new GetChangeableWidget(getComposite(), + this.changeProperty); + addSubWidget(this.changeableWidget); + this.derivedWidget = new GetDerivedWidget(getComposite(), + this.derivedProperty); + addSubWidget(this.derivedWidget); + this.transientWidget = new GetTransientWidget(getComposite(), + this.transientProperty); + addSubWidget(this.transientWidget); + } + + @Override + public Command getCommand() { + return this.getCommandFactory() + .createEditFacetStructuralFeatureCommand(this.dte, + this.getContainer(), this.getElementName(), + this.getLowerBoundProperty().getValue2().intValue(), + this.getUpperBoundProperty().getValue2().intValue(), + this.getTypeProperty().getValue2(), + this.getOrderedProperty().getValue2().booleanValue(), + this.getUniqueProperty().getValue2().booleanValue(), + this.getQueryPropertyValue(), + this.volatileProperty.getValue2().booleanValue(), + this.changeProperty.getValue2().booleanValue(), + this.derivedProperty.getValue2().booleanValue(), + this.transientProperty.getValue2().booleanValue()); + } + + public boolean isTransient() { + return this.transientWidget.isSelected(); + } + + public void setTransient(final boolean value) { + this.transientWidget.setPropertyEnabled(value); + } + + public boolean isVolatile() { + return this.volatileWidget.isSelected(); + } + + public void setVolatile(final boolean value) { + this.volatileWidget.setPropertyEnabled(value); + } + + public boolean isChangeable() { + return this.changeableWidget.isSelected(); + } + + public void setChangeable(final boolean value) { + this.changeableWidget.setPropertyEnabled(value); + } + + public boolean isDerived() { + return this.derivedWidget.isSelected(); + } + + public void setDerived(final boolean value) { + this.derivedWidget.setPropertyEnabled(value); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractETypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractETypedElementWidget.java index 8b9606ba25b..46ca36cf2da 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractETypedElementWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractETypedElementWidget.java @@ -1,188 +1,188 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetElementTypeWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetOrderedWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetUniqueWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetLowerBoundWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetUpperBoundWidget;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Abstract widget implement {@link IETypedElementWidget}.
- */
-public abstract class AbstractETypedElementWidget<T extends ETypedElement, C extends EObject, CW extends Object>
- extends AbstractENamedElementWidget<T, C, CW>
- implements
- IETypedElementWidget<C, CW> {
-
- private static final int HORIZ_SPACING = 110;
- private static final int COLUMN_NUMBER = 3;
-
- private final PropertyElement2<Integer> lowerBdProperty;
- private final PropertyElement2<Integer> upperBdProperty;
- private final PropertyElement2<EClassifier> typeProperty;
- private final PropertyElement2<Boolean> orderedProperty;
- private final PropertyElement2<Boolean> uniqueProperty;
-
- private GetLowerBoundWidget lowerBoundWidget;
- private GetUpperBoundWidget upperBoundWidget;
- private GetElementTypeWidget elementTypeWidget;
- private GetOrderedWidget orderedWidget;
- private GetUniqueWidget uniqueWidget;
- private Composite composite;
-
- public AbstractETypedElementWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<C> containerProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty) {
- super(parent, editingDomain, containerProperty, nameProperty);
- this.lowerBdProperty = lowerBdProperty;
- this.upperBdProperty = upperBdProperty;
- this.typeProperty = typeProperty;
- this.orderedProperty = orderedProperty;
- this.uniqueProperty = uniqueProperty;
- }
-
- @Override
- protected void addSubWidgets() {
- super.addSubWidgets();
- this.lowerBoundWidget = new GetLowerBoundWidget(this,
- this.lowerBdProperty);
- addSubWidget(this.lowerBoundWidget);
- this.upperBoundWidget = new GetUpperBoundWidget(this,
- this.upperBdProperty);
- addSubWidget(this.upperBoundWidget);
- this.elementTypeWidget = new GetElementTypeWidget(this,
- this.typeProperty, null, this.getETypeSelectionOption());
- addSubWidget(this.elementTypeWidget);
- this.composite = new Composite(this, SWT.NONE);
- final GridLayout gridLayout = new GridLayout(COLUMN_NUMBER, false);
- gridLayout.horizontalSpacing = HORIZ_SPACING;
- gridLayout.marginWidth = 0;
- this.composite.setLayout(gridLayout);
- this.orderedWidget = new GetOrderedWidget(this.composite,
- this.orderedProperty);
- addSubWidget(this.orderedWidget);
- this.uniqueWidget = new GetUniqueWidget(this.composite,
- this.uniqueProperty);
- addSubWidget(this.uniqueWidget);
- }
-
- protected final Composite getComposite() {
- return this.composite;
- }
-
- /**
- * @return the type selection option.
- */
- protected abstract Class<? extends EClassifier> getETypeSelectionOption();
-
- /**
- * @return the lowerBoundProperty
- */
- protected final PropertyElement2<Integer> getLowerBoundProperty() {
- return this.lowerBdProperty;
- }
-
- /**
- * @return the upperBoundProperty
- */
- protected final PropertyElement2<Integer> getUpperBoundProperty() {
- return this.upperBdProperty;
- }
-
- /**
- * @return the typeProperty
- */
- protected final PropertyElement2<EClassifier> getTypeProperty() {
- return this.typeProperty;
- }
-
- /**
- * @return the orderedProperty
- */
- protected final PropertyElement2<Boolean> getOrderedProperty() {
- return this.orderedProperty;
- }
-
- /**
- * @return the uniqueProperty
- */
- protected final PropertyElement2<Boolean> getUniqueProperty() {
- return this.uniqueProperty;
- }
-
- public boolean isOrdered() {
- return this.orderedWidget.isSelected();
- }
-
- public void setOrdered(final boolean value) {
- this.orderedWidget.setPropertyEnabled(value);
- }
-
- public boolean isUnique() {
- return this.uniqueWidget.isSelected();
- }
-
- public void setUnique(final boolean value) {
- this.uniqueWidget.setPropertyEnabled(value);
- }
-
- public int getLowerBound() {
- return this.lowerBoundWidget.getBoundValue();
- }
-
- public void setLowerBound(final int value) {
- this.lowerBoundWidget.setBoundValue(value);
- }
-
- public int getUpperBound() {
- return this.upperBoundWidget.getBoundValue();
- }
-
- public void setUpperBound(final int value) {
- this.upperBoundWidget.setBoundValue(value);
- }
-
- public EClassifier getEType() {
- return this.typeProperty.getValue2();
- }
-
- public void setEType(final EClassifier value) {
- this.typeProperty.setValue(value);
- }
-
- public ISelectETypeWizard<EClassifier> pressTypeButton() {
- return this.elementTypeWidget.pressButton();
- }
-
- public String getElementTypeName() {
- return this.elementTypeWidget.getText();
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetElementTypeWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetOrderedWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetUniqueWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetLowerBoundWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetUpperBoundWidget; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; + +/** + * Abstract widget implement {@link IETypedElementWidget}. + */ +public abstract class AbstractETypedElementWidget<T extends ETypedElement, C extends EObject, CW extends Object> + extends AbstractENamedElementWidget<T, C, CW> + implements + IETypedElementWidget<C, CW> { + + private static final int HORIZ_SPACING = 110; + private static final int COLUMN_NUMBER = 3; + + private final PropertyElement2<Integer> lowerBdProperty; + private final PropertyElement2<Integer> upperBdProperty; + private final PropertyElement2<EClassifier> typeProperty; + private final PropertyElement2<Boolean> orderedProperty; + private final PropertyElement2<Boolean> uniqueProperty; + + private GetLowerBoundWidget lowerBoundWidget; + private GetUpperBoundWidget upperBoundWidget; + private GetElementTypeWidget elementTypeWidget; + private GetOrderedWidget orderedWidget; + private GetUniqueWidget uniqueWidget; + private Composite composite; + + public AbstractETypedElementWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<C> containerProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty) { + super(parent, editingDomain, containerProperty, nameProperty); + this.lowerBdProperty = lowerBdProperty; + this.upperBdProperty = upperBdProperty; + this.typeProperty = typeProperty; + this.orderedProperty = orderedProperty; + this.uniqueProperty = uniqueProperty; + } + + @Override + protected void addSubWidgets() { + super.addSubWidgets(); + this.lowerBoundWidget = new GetLowerBoundWidget(this, + this.lowerBdProperty); + addSubWidget(this.lowerBoundWidget); + this.upperBoundWidget = new GetUpperBoundWidget(this, + this.upperBdProperty); + addSubWidget(this.upperBoundWidget); + this.elementTypeWidget = new GetElementTypeWidget(this, + this.typeProperty, null, this.getETypeSelectionOption()); + addSubWidget(this.elementTypeWidget); + this.composite = new Composite(this, SWT.NONE); + final GridLayout gridLayout = new GridLayout(COLUMN_NUMBER, false); + gridLayout.horizontalSpacing = HORIZ_SPACING; + gridLayout.marginWidth = 0; + this.composite.setLayout(gridLayout); + this.orderedWidget = new GetOrderedWidget(this.composite, + this.orderedProperty); + addSubWidget(this.orderedWidget); + this.uniqueWidget = new GetUniqueWidget(this.composite, + this.uniqueProperty); + addSubWidget(this.uniqueWidget); + } + + protected final Composite getComposite() { + return this.composite; + } + + /** + * @return the type selection option. + */ + protected abstract Class<? extends EClassifier> getETypeSelectionOption(); + + /** + * @return the lowerBoundProperty + */ + protected final PropertyElement2<Integer> getLowerBoundProperty() { + return this.lowerBdProperty; + } + + /** + * @return the upperBoundProperty + */ + protected final PropertyElement2<Integer> getUpperBoundProperty() { + return this.upperBdProperty; + } + + /** + * @return the typeProperty + */ + protected final PropertyElement2<EClassifier> getTypeProperty() { + return this.typeProperty; + } + + /** + * @return the orderedProperty + */ + protected final PropertyElement2<Boolean> getOrderedProperty() { + return this.orderedProperty; + } + + /** + * @return the uniqueProperty + */ + protected final PropertyElement2<Boolean> getUniqueProperty() { + return this.uniqueProperty; + } + + public boolean isOrdered() { + return this.orderedWidget.isSelected(); + } + + public void setOrdered(final boolean value) { + this.orderedWidget.setPropertyEnabled(value); + } + + public boolean isUnique() { + return this.uniqueWidget.isSelected(); + } + + public void setUnique(final boolean value) { + this.uniqueWidget.setPropertyEnabled(value); + } + + public int getLowerBound() { + return this.lowerBoundWidget.getBoundValue(); + } + + public void setLowerBound(final int value) { + this.lowerBoundWidget.setBoundValue(value); + } + + public int getUpperBound() { + return this.upperBoundWidget.getBoundValue(); + } + + public void setUpperBound(final int value) { + this.upperBoundWidget.setBoundValue(value); + } + + public EClassifier getEType() { + return this.typeProperty.getValue2(); + } + + public void setEType(final EClassifier value) { + this.typeProperty.setValue(value); + } + + public ISelectETypeWizard<EClassifier> pressTypeButton() { + return this.elementTypeWidget.pressButton(); + } + + public String getElementTypeName() { + return this.elementTypeWidget.getText(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddOperationInFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddOperationInFacetWidget.java index 2429b4eb91b..99e2a6e6020 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddOperationInFacetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddOperationInFacetWidget.java @@ -1,104 +1,104 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * Concrete implementation of {@link AbstractAddElementWidget} for the creation
- * of an operation in a facet.
- */
-public class AddOperationInFacetWidget extends
- AbstractDerivedTypedElementWidget<FacetOperation> {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- * @param facet
- */
- public AddOperationInFacetWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty) {
- super(parent, editingDomain, facetProperty,
- nameProperty, lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty, queryProperty);
- }
-
- @Override
- public Command getCommand() {
- final Facet facet = this.getContainerPropery().getValue2();
- final FacetOperation facetOperation = createFacetOperation();
- return this.getCommandFactory().createAddOperationInFacetCommand(facet,
- facetOperation);
- }
-
- protected FacetOperation createFacetOperation() {
- final FacetOperation facetOperation = getFacetOperation();
- facetOperation.setName(getElementNamePropertyValue());
- facetOperation.setLowerBound(getLowerBoundProperty().getValue2()
- .intValue());
- facetOperation.setUpperBound(getUpperBoundProperty().getValue2()
- .intValue());
- facetOperation.setEType(getTypeProperty().getValue2());
- facetOperation.setOrdered(getOrderedProperty().getValue2()
- .booleanValue());
- facetOperation
- .setUnique(getUniqueProperty().getValue2().booleanValue());
- facetOperation.setQuery(getQueryProperty().getValue2());
- return facetOperation;
- }
-
- @SuppressWarnings("static-method")
- // @SuppressWarnings("static-method") This method cannot be static because it is overrode by EditFacetWidget.
- protected FacetOperation getFacetOperation() {
- return EFacetFactory.eINSTANCE.createFacetOperation();
- }
-
- @Override
- protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() {
- return new GetOperationNameWidget(this, this.getElementNameProperty());
- }
-
- @Override
- protected Class<EClassifier> getETypeSelectionOption() {
- return EClassifier.class;
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + + +/** + * Concrete implementation of {@link AbstractAddElementWidget} for the creation + * of an operation in a facet. + */ +public class AddOperationInFacetWidget extends + AbstractDerivedTypedElementWidget<FacetOperation> { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + * @param facet + */ + public AddOperationInFacetWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty) { + super(parent, editingDomain, facetProperty, + nameProperty, lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty, queryProperty); + } + + @Override + public Command getCommand() { + final Facet facet = this.getContainerPropery().getValue2(); + final FacetOperation facetOperation = createFacetOperation(); + return this.getCommandFactory().createAddOperationInFacetCommand(facet, + facetOperation); + } + + protected FacetOperation createFacetOperation() { + final FacetOperation facetOperation = getFacetOperation(); + facetOperation.setName(getElementNamePropertyValue()); + facetOperation.setLowerBound(getLowerBoundProperty().getValue2() + .intValue()); + facetOperation.setUpperBound(getUpperBoundProperty().getValue2() + .intValue()); + facetOperation.setEType(getTypeProperty().getValue2()); + facetOperation.setOrdered(getOrderedProperty().getValue2() + .booleanValue()); + facetOperation + .setUnique(getUniqueProperty().getValue2().booleanValue()); + facetOperation.setQuery(getQueryProperty().getValue2()); + return facetOperation; + } + + @SuppressWarnings("static-method") + // @SuppressWarnings("static-method") This method cannot be static because it is overrode by EditFacetWidget. + protected FacetOperation getFacetOperation() { + return EFacetFactory.eINSTANCE.createFacetOperation(); + } + + @Override + protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() { + return new GetOperationNameWidget(this, this.getElementNameProperty()); + } + + @Override + protected Class<EClassifier> getETypeSelectionOption() { + return EClassifier.class; + } + + @Override + public void onDialogValidation() { + // Nothing. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddParameterInOperationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddParameterInOperationWidget.java index 5cd39cb0f68..00359156cd6 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddParameterInOperationWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddParameterInOperationWidget.java @@ -1,119 +1,119 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateOperationWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithButtonWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractAddElementWidget} for the creation
- * of an parameter in a operation.
- */
-public class AddParameterInOperationWidget extends
- AbstractETypedElementWidget<EParameter, FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- */
- public AddParameterInOperationWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<FacetOperation> containerProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty) {
- super(parent, editingDomain, containerProperty, nameProperty,
- lowerBdProperty,
- upperBdProperty, typeProperty, orderedProperty, uniqueProperty);
- }
-
- @Override
- public Command getCommand() {
- final FacetOperation facetOperation = this.getContainerPropery()
- .getValue2();
- final EParameter operationParam = createOperationParameter();
- return this.getCommandFactory()
- .createAddParameterInOperationCommand(facetOperation,
- operationParam);
- }
-
- protected EParameter createOperationParameter() {
- final EParameter operationParam = getOperationParameter();
- operationParam.setName(getElementNamePropertyValue());
- operationParam.setLowerBound(getLowerBoundProperty().getValue2()
- .intValue());
- operationParam.setUpperBound(getUpperBoundProperty().getValue2()
- .intValue());
- operationParam.setEType(getTypeProperty().getValue2());
- operationParam.setOrdered(getOrderedProperty().getValue2()
- .booleanValue());
- operationParam
- .setUnique(getUniqueProperty().getValue2().booleanValue());
- return operationParam;
- }
-
- @SuppressWarnings("static-method")
- // @SuppressWarnings("static-method") This method cannot be static because it is overrode by EditFacetWidget.
- protected EParameter getOperationParameter() {
- return EcoreFactory.eINSTANCE.createEParameter();
- }
-
- @Override
- protected GetOperationNameWidget createGetElementNameSubWidgetComposite() {
- return new GetOperationNameWidget(this, this.getElementNameProperty());
- }
-
- @Override
- protected AbstractGetOrCreateElementWithButtonWidget<FacetOperation, IDialog<IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> createGetOrCreateElementWidgetComposite() {
- final Facet context = (Facet) this.getContainerPropery().getValue2()
- .eContainer();
- return new GetOrCreateOperationWidget(this, this.getContainerPropery(),
- this.getEditingDomain(), context);
- }
-
- @Override
- protected Class<EClassifier> getETypeSelectionOption() {
- return EClassifier.class;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateOperationWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithButtonWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractAddElementWidget} for the creation + * of an parameter in a operation. + */ +public class AddParameterInOperationWidget extends + AbstractETypedElementWidget<EParameter, FacetOperation, IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>> { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + */ + public AddParameterInOperationWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<FacetOperation> containerProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty) { + super(parent, editingDomain, containerProperty, nameProperty, + lowerBdProperty, + upperBdProperty, typeProperty, orderedProperty, uniqueProperty); + } + + @Override + public Command getCommand() { + final FacetOperation facetOperation = this.getContainerPropery() + .getValue2(); + final EParameter operationParam = createOperationParameter(); + return this.getCommandFactory() + .createAddParameterInOperationCommand(facetOperation, + operationParam); + } + + protected EParameter createOperationParameter() { + final EParameter operationParam = getOperationParameter(); + operationParam.setName(getElementNamePropertyValue()); + operationParam.setLowerBound(getLowerBoundProperty().getValue2() + .intValue()); + operationParam.setUpperBound(getUpperBoundProperty().getValue2() + .intValue()); + operationParam.setEType(getTypeProperty().getValue2()); + operationParam.setOrdered(getOrderedProperty().getValue2() + .booleanValue()); + operationParam + .setUnique(getUniqueProperty().getValue2().booleanValue()); + return operationParam; + } + + @SuppressWarnings("static-method") + // @SuppressWarnings("static-method") This method cannot be static because it is overrode by EditFacetWidget. + protected EParameter getOperationParameter() { + return EcoreFactory.eINSTANCE.createEParameter(); + } + + @Override + protected GetOperationNameWidget createGetElementNameSubWidgetComposite() { + return new GetOperationNameWidget(this, this.getElementNameProperty()); + } + + @Override + protected AbstractGetOrCreateElementWithButtonWidget<FacetOperation, IDialog<IGetOrCreateFilteredElementCommmandWidget<FacetOperation, IDerivedTypedElementWidget>>> createGetOrCreateElementWidgetComposite() { + final Facet context = (Facet) this.getContainerPropery().getValue2() + .eContainer(); + return new GetOrCreateOperationWidget(this, this.getContainerPropery(), + this.getEditingDomain(), context); + } + + @Override + protected Class<EClassifier> getETypeSelectionOption() { + return EClassifier.class; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetFilteredSubTypingTypeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetFilteredSubTypingTypeWidget.java index 349e08c7365..608f82573cc 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetFilteredSubTypingTypeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetFilteredSubTypingTypeWidget.java @@ -1,153 +1,153 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EOperation;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the selection and/or creation of an element in a list.
- */
-public class GetFilteredSubTypingTypeWidget extends
- AbstractGetOrCreateFilteredElementCommandWidget<ETypedElement, Object> {
-
- private final EClass context;
- private final Facet facet;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this widget.
- * @param properties
- * the properties.
- */
- public GetFilteredSubTypingTypeWidget(final Composite parent, final EClass context,
- final Facet facet) {
- super(parent);
- this.context = context;
- this.facet = facet;
- }
-
- @Override
- protected Map<String, ETypedElement> getElements() {
- final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>();
- if (this.context != null) {
- allElements.putAll(getAttributes(this.context));
- allElements.putAll(getOperations(this.context.getEAllOperations()));
- }
- if (this.facet != null) {
- allElements.putAll(getFacetAttributes(this.facet));
- allElements.putAll(getOperations(this.facet.getFacetOperations()));
- }
- return allElements;
- }
-
- /**
- * @param facet
- * @return
- */
- private static Map<String, ETypedElement> getFacetAttributes(
- final Facet facet) {
- final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>();
- for (final EStructuralFeature element : facet.getFacetElements()) {
- final EClassifier eType = element.getEType();
- if ((element instanceof FacetAttribute)
- && eType.equals(
- EcorePackage.eINSTANCE.getEBoolean())) {
- allElements.put(element.getName(), element);
- }
- }
- return allElements;
- }
-
- /**
- * @param context
- * @return
- */
- private static Map<String, ETypedElement> getOperations(
- final List<? extends EOperation> elements) {
- final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>();
- for (final EOperation operation : elements) {
- // Get all the operations returning a boolean and without any
- // parameter.
- if (operation.getEType().equals(
- EcorePackage.eINSTANCE.getEBoolean())
- && (operation.getEParameters().size() == 0)) {
- allElements.put(operation.getName(), operation);
- }
- }
- return allElements;
- }
-
- /**
- * @param context
- * @return
- */
- private static Map<String, ETypedElement> getAttributes(
- final EClass context) {
- final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>();
- for (final EAttribute attribute : context.getEAllAttributes()) {
- if (attribute.getEType().equals(
- EcorePackage.eINSTANCE.getEBoolean())) {
- allElements.put(attribute.getName(), attribute);
- }
- }
- return allElements;
- }
-
- @Override
- protected IDialog<Object> createDialog() {
- // No element can be created.
- return null;
- }
-
- /**
- * @return the selected element in the filtredList.
- */
- public ETypedElement getSubTypeSelected() {
- return getElementSelected();
- }
-
- @Override
- public Command getCommand() {
- // Here, this widget only return a selected element so, no command is
- // returned.
- return null;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the selection and/or creation of an element in a list. + */ +public class GetFilteredSubTypingTypeWidget extends + AbstractGetOrCreateFilteredElementCommandWidget<ETypedElement, Object> { + + private final EClass context; + private final Facet facet; + + /** + * Constructor. + * + * @param parent + * the parent of this widget. + * @param properties + * the properties. + */ + public GetFilteredSubTypingTypeWidget(final Composite parent, final EClass context, + final Facet facet) { + super(parent); + this.context = context; + this.facet = facet; + } + + @Override + protected Map<String, ETypedElement> getElements() { + final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>(); + if (this.context != null) { + allElements.putAll(getAttributes(this.context)); + allElements.putAll(getOperations(this.context.getEAllOperations())); + } + if (this.facet != null) { + allElements.putAll(getFacetAttributes(this.facet)); + allElements.putAll(getOperations(this.facet.getFacetOperations())); + } + return allElements; + } + + /** + * @param facet + * @return + */ + private static Map<String, ETypedElement> getFacetAttributes( + final Facet facet) { + final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>(); + for (final EStructuralFeature element : facet.getFacetElements()) { + final EClassifier eType = element.getEType(); + if ((element instanceof FacetAttribute) + && eType.equals( + EcorePackage.eINSTANCE.getEBoolean())) { + allElements.put(element.getName(), element); + } + } + return allElements; + } + + /** + * @param context + * @return + */ + private static Map<String, ETypedElement> getOperations( + final List<? extends EOperation> elements) { + final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>(); + for (final EOperation operation : elements) { + // Get all the operations returning a boolean and without any + // parameter. + if (operation.getEType().equals( + EcorePackage.eINSTANCE.getEBoolean()) + && (operation.getEParameters().size() == 0)) { + allElements.put(operation.getName(), operation); + } + } + return allElements; + } + + /** + * @param context + * @return + */ + private static Map<String, ETypedElement> getAttributes( + final EClass context) { + final Map<String, ETypedElement> allElements = new HashMap<String, ETypedElement>(); + for (final EAttribute attribute : context.getEAllAttributes()) { + if (attribute.getEType().equals( + EcorePackage.eINSTANCE.getEBoolean())) { + allElements.put(attribute.getName(), attribute); + } + } + return allElements; + } + + @Override + protected IDialog<Object> createDialog() { + // No element can be created. + return null; + } + + /** + * @return the selected element in the filtredList. + */ + public ETypedElement getSubTypeSelected() { + return getElementSelected(); + } + + @Override + public Command getCommand() { + // Here, this widget only return a selected element so, no command is + // returned. + return null; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetSetWidget.java index 011fd350b44..54c22310ac9 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetSetWidget.java @@ -1,142 +1,142 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p>
- *
- * This class allows to select a FacetSet or create a new one.
- */
-public class GetOrCreateFiltredFacetSetWidget
- extends
- AbstractGetOrCreateFilteredElementCommandWidget<
- FacetSet,
- IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>
- >
- implements IGetOrCreateFilteredFacetSetWidget {
-
- private final EditingDomain editingDomain;
- private final PropertyElement2<FacetSet> parentFSProp;
- private final FacetSet reject;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this widget.
- * @param properties
- * the properties.
- * @param reject
- * @param recursiveCreation
- * if the creation of the FacetSet can be recursive.
- */
- public GetOrCreateFiltredFacetSetWidget(final Composite parent,
- final EditingDomain editingDomain,
- final PropertyElement2<FacetSet> parentFSProp, final FacetSet reject) {
- super(parent);
- this.editingDomain = editingDomain;
- this.parentFSProp = parentFSProp;
- this.reject = reject;
- }
-
- /**
- * @return the selected facetSet in the filtredList.
- */
- public FacetSet getFacetSetSelected() {
- return getElementSelected();
- }
-
- @Override
- protected Map<String, FacetSet> getElements() {
- final FacetSet containingFS = FacetUtils
- .getRootFacetSet(this.parentFSProp.getValue2());
- final Map<String, FacetSet> allFacets = getAllFacetSets(containingFS);
- allFacets.remove(this.parentFSProp.getName());
- return allFacets;
- }
-
- @Override
- protected IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> createDialog() {
- return new CreateFacetSetInFacetSetDialog(
- this.parentFSProp.getValue2(), this.editingDomain);
- }
-
- /**
- * Return all the facetSets parent if the element in parameter.
- *
- * @param element
- * where to begin.
- * @return the list of facetSet.
- */
- public Map<String, FacetSet> getAllSuperFacetSets(final FacetSet element) {
- final Map<String, FacetSet> facetSets = new HashMap<String, FacetSet>();
- facetSets.put(element.getName(), element);
- final FacetSet parent = (FacetSet) element.getESuperPackage();
- if (parent != null) {
- facetSets.putAll(getAllSuperFacetSets(parent));
- }
- return facetSets;
- }
-
- /**
- * Return all the facetSets of the model.
- *
- * @param parent
- * the first FacetSet of the model.
- * @return the list of facetSet.
- */
- private Map<String, FacetSet> getAllFacetSets(final FacetSet parent) {
- final Map<String, FacetSet> facetSets = new HashMap<String, FacetSet>();
- if (parent != this.reject) {
- facetSets.put(parent.getName(), parent);
- for (final EPackage element : parent.getESubpackages()) {
- facetSets.putAll(getAllFacetSets((FacetSet) element));
- }
- }
- return facetSets;
- }
-
- @Override
- public Command getCommand() {
- // Here, this widget only return a selected element so, no command is
- // returned.
- return null;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p> + * + * This class allows to select a FacetSet or create a new one. + */ +public class GetOrCreateFiltredFacetSetWidget + extends + AbstractGetOrCreateFilteredElementCommandWidget< + FacetSet, + IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget> + > + implements IGetOrCreateFilteredFacetSetWidget { + + private final EditingDomain editingDomain; + private final PropertyElement2<FacetSet> parentFSProp; + private final FacetSet reject; + + /** + * Constructor. + * + * @param parent + * the parent of this widget. + * @param properties + * the properties. + * @param reject + * @param recursiveCreation + * if the creation of the FacetSet can be recursive. + */ + public GetOrCreateFiltredFacetSetWidget(final Composite parent, + final EditingDomain editingDomain, + final PropertyElement2<FacetSet> parentFSProp, final FacetSet reject) { + super(parent); + this.editingDomain = editingDomain; + this.parentFSProp = parentFSProp; + this.reject = reject; + } + + /** + * @return the selected facetSet in the filtredList. + */ + public FacetSet getFacetSetSelected() { + return getElementSelected(); + } + + @Override + protected Map<String, FacetSet> getElements() { + final FacetSet containingFS = FacetUtils + .getRootFacetSet(this.parentFSProp.getValue2()); + final Map<String, FacetSet> allFacets = getAllFacetSets(containingFS); + allFacets.remove(this.parentFSProp.getName()); + return allFacets; + } + + @Override + protected IDialog<IENamedElementWidget<FacetSet, IGetOrCreateFilteredFacetSetWidget>> createDialog() { + return new CreateFacetSetInFacetSetDialog( + this.parentFSProp.getValue2(), this.editingDomain); + } + + /** + * Return all the facetSets parent if the element in parameter. + * + * @param element + * where to begin. + * @return the list of facetSet. + */ + public Map<String, FacetSet> getAllSuperFacetSets(final FacetSet element) { + final Map<String, FacetSet> facetSets = new HashMap<String, FacetSet>(); + facetSets.put(element.getName(), element); + final FacetSet parent = (FacetSet) element.getESuperPackage(); + if (parent != null) { + facetSets.putAll(getAllSuperFacetSets(parent)); + } + return facetSets; + } + + /** + * Return all the facetSets of the model. + * + * @param parent + * the first FacetSet of the model. + * @return the list of facetSet. + */ + private Map<String, FacetSet> getAllFacetSets(final FacetSet parent) { + final Map<String, FacetSet> facetSets = new HashMap<String, FacetSet>(); + if (parent != this.reject) { + facetSets.put(parent.getName(), parent); + for (final EPackage element : parent.getESubpackages()) { + facetSets.putAll(getAllFacetSets((FacetSet) element)); + } + } + return facetSets; + } + + @Override + public Command getCommand() { + // Here, this widget only return a selected element so, no command is + // returned. + return null; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetWidget.java index 342180b41da..1fc4062cd84 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetWidget.java @@ -1,96 +1,96 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import java.util.Map;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p>
- *
- * This class allows to select a Facet or create a new one.
- */
-public class GetOrCreateFiltredFacetWidget extends
- AbstractGetOrCreateFilteredElementCommandWidget<Facet, IFacetWidget> {
-
- private final EditingDomain editingDomain;
- private final FacetSet container;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this widget.
- * @param properties
- * the properties.
- */
- public GetOrCreateFiltredFacetWidget(final Composite parent,
- final EditingDomain editingDomain, final FacetSet container) {
- super(parent);
- this.editingDomain = editingDomain;
- this.container = container;
- }
-
- @Override
- protected Map<String, Facet> getElements() {
- final FacetSet parent = FacetUtils
- .getContainingFacetSet(this.container);
- final Map<String, Facet> allFacets = FacetUtils
- .getAllFacetsByName(parent);
- final Object name = this.container.getName();
- allFacets.remove(name);
- return allFacets;
- }
-
- @Override
- protected IDialog<IFacetWidget> createDialog() {
- return new CreateFacetInFacetSetDialog(this.container,
- this.editingDomain);
- }
-
- /**
- * @return the selected facet in the filtredList.
- */
- public Facet getFacetSelected() {
- return getElementSelected();
- }
-
- @Override
- public Command getCommand() {
- // Here, this widget only return a selected element so, no command is
- // returned.
- return null;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import java.util.Map; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p> + * + * This class allows to select a Facet or create a new one. + */ +public class GetOrCreateFiltredFacetWidget extends + AbstractGetOrCreateFilteredElementCommandWidget<Facet, IFacetWidget> { + + private final EditingDomain editingDomain; + private final FacetSet container; + + /** + * Constructor. + * + * @param parent + * the parent of this widget. + * @param properties + * the properties. + */ + public GetOrCreateFiltredFacetWidget(final Composite parent, + final EditingDomain editingDomain, final FacetSet container) { + super(parent); + this.editingDomain = editingDomain; + this.container = container; + } + + @Override + protected Map<String, Facet> getElements() { + final FacetSet parent = FacetUtils + .getContainingFacetSet(this.container); + final Map<String, Facet> allFacets = FacetUtils + .getAllFacetsByName(parent); + final Object name = this.container.getName(); + allFacets.remove(name); + return allFacets; + } + + @Override + protected IDialog<IFacetWidget> createDialog() { + return new CreateFacetInFacetSetDialog(this.container, + this.editingDomain); + } + + /** + * @return the selected facet in the filtredList. + */ + public Facet getFacetSelected() { + return getElementSelected(); + } + + @Override + public Command getCommand() { + // Here, this widget only return a selected element so, no command is + // returned. + return null; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredOperationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredOperationWidget.java index 3bc3c9580bf..2662d5ec54a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredOperationWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredOperationWidget.java @@ -1,93 +1,93 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation;
-
-import java.util.Map;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p>
- *
- * This class allows to select an Operation or create a new one.
- */
-public class GetOrCreateFiltredOperationWidget extends
- AbstractGetOrCreateFilteredElementCommandWidget<FacetOperation, IDerivedTypedElementWidget> {
-
- private final EditingDomain editingDomain;
- private final Facet context;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this widget.
- * @param properties
- * the properties.
- */
- public GetOrCreateFiltredOperationWidget(final Composite parent,
- final EditingDomain editingDomain, final Facet context) {
- super(parent);
- this.editingDomain = editingDomain;
- this.context = context;
- }
-
- @Override
- protected Map<String, FacetOperation> getElements() {
- final FacetSet parent = FacetUtils.getContainingFacetSet(this.context);
- final Map<String, FacetOperation> allOperations = FacetUtils
- .getAllOperationsByName(parent);
- return allOperations;
- }
-
- @Override
- protected IDialog<IDerivedTypedElementWidget> createDialog() {
- final Facet container = this.context;
- return new AddOperationInFacetDialog(container, this.editingDomain);
- }
-
- /**
- * @return the selected operation in the filtredList.
- */
- public FacetOperation getFacetOperationSelected() {
- return getElementSelected();
- }
-
- @Override
- public Command getCommand() {
- // Here, this widget only return a selected element so, no command is
- // returned.
- return null;
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation; + +import java.util.Map; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.core.FacetUtils; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget; +import org.eclipse.swt.widgets.Composite; + +/** + * Concrete implementation of {@link AbstractGetOrCreateElementWidget}.</p> + * + * This class allows to select an Operation or create a new one. + */ +public class GetOrCreateFiltredOperationWidget extends + AbstractGetOrCreateFilteredElementCommandWidget<FacetOperation, IDerivedTypedElementWidget> { + + private final EditingDomain editingDomain; + private final Facet context; + + /** + * Constructor. + * + * @param parent + * the parent of this widget. + * @param properties + * the properties. + */ + public GetOrCreateFiltredOperationWidget(final Composite parent, + final EditingDomain editingDomain, final Facet context) { + super(parent); + this.editingDomain = editingDomain; + this.context = context; + } + + @Override + protected Map<String, FacetOperation> getElements() { + final FacetSet parent = FacetUtils.getContainingFacetSet(this.context); + final Map<String, FacetOperation> allOperations = FacetUtils + .getAllOperationsByName(parent); + return allOperations; + } + + @Override + protected IDialog<IDerivedTypedElementWidget> createDialog() { + final Facet container = this.context; + return new AddOperationInFacetDialog(container, this.editingDomain); + } + + /** + * @return the selected operation in the filtredList. + */ + public FacetOperation getFacetOperationSelected() { + return getElementSelected(); + } + + @Override + public Command getCommand() { + // Here, this widget only return a selected element so, no command is + // returned. + return null; + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetAttributeWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetAttributeWidget.java index 86dca25ee50..0dd42dc5ae2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetAttributeWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetAttributeWidget.java @@ -1,81 +1,81 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetAttributeNameWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link FacetAttribute}.
- */
-public class EditFacetAttributeWidget extends
- AbstractEStructuralFeatureWidget<FacetAttribute> {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- * @param initialAttribut
- * the {@link FacetAttribute} to edit.
- */
- public EditFacetAttributeWidget(final Composite parent,
- final FacetAttribute initialAttribut,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty,
- final PropertyElement2<Boolean> volatileProperty,
- final PropertyElement2<Boolean> changeProperty,
- final PropertyElement2<Boolean> derivedProperty,
- final PropertyElement2<Boolean> transientProperty) {
- super(initialAttribut, parent, editingDomain, facetProperty,
- nameProperty,
- lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty, queryProperty,
- volatileProperty, changeProperty, derivedProperty,
- transientProperty);
- }
-
- @Override
- protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() {
- return new GetAttributeNameWidget(this, this.getElementNameProperty());
- }
-
- @Override
- protected Class<? extends EClassifier> getETypeSelectionOption() {
- return EDataType.class;
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetAttributeNameWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link FacetAttribute}. + */ +public class EditFacetAttributeWidget extends + AbstractEStructuralFeatureWidget<FacetAttribute> { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + * @param initialAttribut + * the {@link FacetAttribute} to edit. + */ + public EditFacetAttributeWidget(final Composite parent, + final FacetAttribute initialAttribut, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty, + final PropertyElement2<Boolean> volatileProperty, + final PropertyElement2<Boolean> changeProperty, + final PropertyElement2<Boolean> derivedProperty, + final PropertyElement2<Boolean> transientProperty) { + super(initialAttribut, parent, editingDomain, facetProperty, + nameProperty, + lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty, queryProperty, + volatileProperty, changeProperty, derivedProperty, + transientProperty); + } + + @Override + protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() { + return new GetAttributeNameWidget(this, this.getElementNameProperty()); + } + + @Override + protected Class<? extends EClassifier> getETypeSelectionOption() { + return EDataType.class; + } + + @Override + public void onDialogValidation() { + // Nothing. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationParameterWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationParameterWidget.java index 418cd7a7cc8..90f12597eff 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationParameterWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationParameterWidget.java @@ -1,72 +1,72 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link EParameter}.
- */
-public class EditFacetOperationParameterWidget extends
- AddParameterInOperationWidget {
-
- private final EParameter initialParameter;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param editingDomain
- * the current editing domain.
- * @param properties
- * the properties.
- * @param initialParameter
- * the {@link EParameter} to edit.
- */
- public EditFacetOperationParameterWidget(final Composite parent,
- final EParameter initialParameter,
- final EditingDomain editingDomain,
- final PropertyElement2<FacetOperation> containerProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty) {
- super(parent, editingDomain, containerProperty, nameProperty,
- lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty);
- this.initialParameter = initialParameter;
- }
-
- @Override
- protected EParameter getOperationParameter() {
- return this.initialParameter;
- }
-
- @Override
- public Command getCommand() {
- return this.getCommandFactory().createEditOperationParameterCommand(
- this.initialParameter, this.getContainer(), this.getElementName(),
- this.getLowerBound(), this.getLowerBound(), this.getEType(),
- this.isOrdered(), this.isUnique());
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link EParameter}. + */ +public class EditFacetOperationParameterWidget extends + AddParameterInOperationWidget { + + private final EParameter initialParameter; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param editingDomain + * the current editing domain. + * @param properties + * the properties. + * @param initialParameter + * the {@link EParameter} to edit. + */ + public EditFacetOperationParameterWidget(final Composite parent, + final EParameter initialParameter, + final EditingDomain editingDomain, + final PropertyElement2<FacetOperation> containerProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty) { + super(parent, editingDomain, containerProperty, nameProperty, + lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty); + this.initialParameter = initialParameter; + } + + @Override + protected EParameter getOperationParameter() { + return this.initialParameter; + } + + @Override + public Command getCommand() { + return this.getCommandFactory().createEditOperationParameterCommand( + this.initialParameter, this.getContainer(), this.getElementName(), + this.getLowerBound(), this.getLowerBound(), this.getEType(), + this.isOrdered(), this.isUnique()); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationWidget.java index 628856b5b98..b3e2cc1af6e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationWidget.java @@ -1,78 +1,78 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link FacetOperation}.
- */
-public class EditFacetOperationWidget extends AddOperationInFacetWidget {
-
- private final FacetOperation initialFacetOpe;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- * @param initialFacetOpe
- * the {@link FacetOperation} to edit.
- * @param facet
- */
- public EditFacetOperationWidget(final Composite parent,
- final FacetOperation initialFacetOpe,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty) {
- super(parent, editingDomain, facetProperty, nameProperty,
- lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty, queryProperty);
- this.initialFacetOpe = initialFacetOpe;
- }
-
- @Override
- protected FacetOperation getFacetOperation() {
- return this.initialFacetOpe;
- }
-
- @Override
- public Command getCommand() {
- final Facet facetContainer = this.getContainerPropery()
- .getValue2();
- final FacetOperation facetElement = createFacetOperation();
- return this.getCommandFactory().createEditFacetOperationCommand(
- facetElement, facetContainer, getElementName(), getLowerBound(),
- getUpperBound(), getTypeProperty().getValue2(),
- getOrderedProperty().getValue2().booleanValue(),
- getUniqueProperty().getValue2().booleanValue(),
- getQueryProperty().getValue2());
-
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link FacetOperation}. + */ +public class EditFacetOperationWidget extends AddOperationInFacetWidget { + + private final FacetOperation initialFacetOpe; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + * @param initialFacetOpe + * the {@link FacetOperation} to edit. + * @param facet + */ + public EditFacetOperationWidget(final Composite parent, + final FacetOperation initialFacetOpe, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty) { + super(parent, editingDomain, facetProperty, nameProperty, + lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty, queryProperty); + this.initialFacetOpe = initialFacetOpe; + } + + @Override + protected FacetOperation getFacetOperation() { + return this.initialFacetOpe; + } + + @Override + public Command getCommand() { + final Facet facetContainer = this.getContainerPropery() + .getValue2(); + final FacetOperation facetElement = createFacetOperation(); + return this.getCommandFactory().createEditFacetOperationCommand( + facetElement, facetContainer, getElementName(), getLowerBound(), + getUpperBound(), getTypeProperty().getValue2(), + getOrderedProperty().getValue2().booleanValue(), + getUniqueProperty().getValue2().booleanValue(), + getQueryProperty().getValue2()); + + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetReferenceWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetReferenceWidget.java index 6572d8d0573..790c2b7235b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetReferenceWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetReferenceWidget.java @@ -1,81 +1,81 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetReferenceNameWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link FacetReference}.
- */
-public class EditFacetReferenceWidget extends
- AbstractEStructuralFeatureWidget<FacetReference> {
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- * @param initialFacetRef
- * the {@link FacetReference} to edit.
- * @param facet
- */
- public EditFacetReferenceWidget(final Composite parent,
- final FacetReference initialFacetRef,
- final EditingDomain editingDomain,
- final PropertyElement2<Facet> facetProperty,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<Integer> lowerBdProperty,
- final PropertyElement2<Integer> upperBdProperty,
- final PropertyElement2<EClassifier> typeProperty,
- final PropertyElement2<Boolean> orderedProperty,
- final PropertyElement2<Boolean> uniqueProperty,
- final PropertyElement2<Query> queryProperty,
- final PropertyElement2<Boolean> volatileProperty,
- final PropertyElement2<Boolean> changeProperty,
- final PropertyElement2<Boolean> derivedProperty,
- final PropertyElement2<Boolean> transientProperty) {
- super(initialFacetRef, parent, editingDomain, facetProperty,
- nameProperty, lowerBdProperty, upperBdProperty, typeProperty,
- orderedProperty, uniqueProperty, queryProperty,
- volatileProperty, changeProperty, derivedProperty,
- transientProperty);
- }
-
- @Override
- protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() {
- return new GetReferenceNameWidget(this, this.getElementNameProperty());
- }
-
- @Override
- protected Class<? extends EClassifier> getETypeSelectionOption() {
- return EClass.class;
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetReferenceNameWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link FacetReference}. + */ +public class EditFacetReferenceWidget extends + AbstractEStructuralFeatureWidget<FacetReference> { + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + * @param initialFacetRef + * the {@link FacetReference} to edit. + * @param facet + */ + public EditFacetReferenceWidget(final Composite parent, + final FacetReference initialFacetRef, + final EditingDomain editingDomain, + final PropertyElement2<Facet> facetProperty, + final PropertyElement2<String> nameProperty, + final PropertyElement2<Integer> lowerBdProperty, + final PropertyElement2<Integer> upperBdProperty, + final PropertyElement2<EClassifier> typeProperty, + final PropertyElement2<Boolean> orderedProperty, + final PropertyElement2<Boolean> uniqueProperty, + final PropertyElement2<Query> queryProperty, + final PropertyElement2<Boolean> volatileProperty, + final PropertyElement2<Boolean> changeProperty, + final PropertyElement2<Boolean> derivedProperty, + final PropertyElement2<Boolean> transientProperty) { + super(initialFacetRef, parent, editingDomain, facetProperty, + nameProperty, lowerBdProperty, upperBdProperty, typeProperty, + orderedProperty, uniqueProperty, queryProperty, + volatileProperty, changeProperty, derivedProperty, + transientProperty); + } + + @Override + protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() { + return new GetReferenceNameWidget(this, this.getElementNameProperty()); + } + + @Override + protected Class<? extends EClassifier> getETypeSelectionOption() { + return EClass.class; + } + + @Override + public void onDialogValidation() { + // Nothing. + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetSetWidget.java index a27cf520eaf..87e60385627 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetSetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetSetWidget.java @@ -1,113 +1,113 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link FacetSet}.
- */
-public class EditFacetSetWidget
- extends
- AbstractENamedElementWidget<FacetSet, FacetSet, IGetOrCreateFilteredFacetSetWidget> {
-
- private final PropertyElement2<FacetSet> containerProperty;
- private final FacetSet editedFacetSet;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param properties
- * the properties.
- * @param editedFacetSet
- * the {@link FacetSet} to edit.
- * @param nameProperty
- * @param containerProp
- */
- public EditFacetSetWidget(final Composite parent,
- final FacetSet editedFacetSet, final EditingDomain editingDomain,
- final PropertyElement2<String> nameProperty,
- final PropertyElement2<FacetSet> containerProp) {
- super(parent, editingDomain, containerProp, nameProperty);
- this.containerProperty = containerProp;
- this.editedFacetSet = editedFacetSet;
- }
-
- @Override
- public Command getCommand() {
- final FacetSet container = this.containerProperty.getValue2();
- return this.getCommandFactory().createEditFacetSetCommand(
- this.editedFacetSet, container,
- this.getElementNamePropertyValue());
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
-
- @Override
- protected IGetOrCreateFacetSetWidget createGetOrCreateElementWidgetComposite() {
- return new GetOrCreateFacetSetWidget(this, this.containerProperty,
- this.getEditingDomain(), null);
- }
-
- @Override
- protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() {
- final AbstractGetElementNameWidget widget = new AbstractGetElementNameWidget(
- this, this.getElementNameProperty()) {
- @Override
- protected String getErrorMessage() {
- return ""; //$NON-NLS-1$
- }
-
- @Override
- protected String getLabel() {
- return Messages.EditFacetSetWidget_FacetSetName;
- }
-
- @Override
- public void notifyChanged() {
- // Noting to do
- }
-
- };
- return widget;
- }
-
-
- protected final PropertyElement getContainerProperty() {
- return this.containerProperty;
- }
-
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link FacetSet}. + */ +public class EditFacetSetWidget + extends + AbstractENamedElementWidget<FacetSet, FacetSet, IGetOrCreateFilteredFacetSetWidget> { + + private final PropertyElement2<FacetSet> containerProperty; + private final FacetSet editedFacetSet; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param properties + * the properties. + * @param editedFacetSet + * the {@link FacetSet} to edit. + * @param nameProperty + * @param containerProp + */ + public EditFacetSetWidget(final Composite parent, + final FacetSet editedFacetSet, final EditingDomain editingDomain, + final PropertyElement2<String> nameProperty, + final PropertyElement2<FacetSet> containerProp) { + super(parent, editingDomain, containerProp, nameProperty); + this.containerProperty = containerProp; + this.editedFacetSet = editedFacetSet; + } + + @Override + public Command getCommand() { + final FacetSet container = this.containerProperty.getValue2(); + return this.getCommandFactory().createEditFacetSetCommand( + this.editedFacetSet, container, + this.getElementNamePropertyValue()); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } + + + @Override + protected IGetOrCreateFacetSetWidget createGetOrCreateElementWidgetComposite() { + return new GetOrCreateFacetSetWidget(this, this.containerProperty, + this.getEditingDomain(), null); + } + + @Override + protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() { + final AbstractGetElementNameWidget widget = new AbstractGetElementNameWidget( + this, this.getElementNameProperty()) { + @Override + protected String getErrorMessage() { + return ""; //$NON-NLS-1$ + } + + @Override + protected String getLabel() { + return Messages.EditFacetSetWidget_FacetSetName; + } + + @Override + public void notifyChanged() { + // Noting to do + } + + }; + return widget; + } + + + protected final PropertyElement getContainerProperty() { + return this.containerProperty; + } + + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetWidget.java index 76d6a242d88..44d0ca4c211 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetWidget.java @@ -1,172 +1,172 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetExtendedMetaclassWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.SelectSubTypingTypeWidget;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
-import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Widget for the edition of a {@link Facet}.
- */
-public class EditFacetWidget
- extends
- AbstractENamedElementWidget<Facet, FacetSet, IGetOrCreateFilteredFacetSetWidget> implements IFacetWidget {
-
- private final Facet initialFacet;
- private final PropertyElement2<String> facetNameProperty;
- private final PropertyElement2<EClass> facetMetaclass;
- private final PropertyElement2<ETypedElement> conformProperty;
- private SelectSubTypingTypeWidget subTypingTypeW;
- private GetExtendedMetaclassWidget extMetaclassW;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent of this composite.
- * @param editingDomain
- * the current editing domain.
- * @param properties
- * the properties.
- * @param initialFacet
- * the {@link Facet} to edit.
- * @param facetNameProperty
- * @param containerProperty
- * @param conformProperty
- * @param facetMetaclass
- */
- public EditFacetWidget(final Composite parent,
- final Facet initialFacet, final EditingDomain editingDomain,
- final PropertyElement2<String> facetNameProperty,
- final PropertyElement2<FacetSet> facetSetProperty,
- final PropertyElement2<ETypedElement> conformProperty,
- final PropertyElement2<EClass> facetMetaclass) {
- super(parent, editingDomain, facetSetProperty, facetNameProperty);
- this.facetNameProperty = facetNameProperty;
- this.facetMetaclass = facetMetaclass;
- this.conformProperty = conformProperty;
- this.initialFacet = initialFacet;
- }
-
- @Override
- public Command getCommand() {
- return this.getCommandFactory().createEditFacetCommand(
- this.initialFacet, this.getContainerPropery().getValue2(),
- this.facetNameProperty.getValue2(),
- this.conformProperty.getValue2(),
- this.facetMetaclass.getValue2(), null);
- }
-
- @Override
- protected void addSubWidgets() {
- super.addSubWidgets();
- this.extMetaclassW = new GetExtendedMetaclassWidget(this,
- this.facetMetaclass, this.getContainerPropery());
- addSubWidget(this.extMetaclassW);
- this.subTypingTypeW = new SelectSubTypingTypeWidget(this,
- this.conformProperty, this.getEditingDomain(),
- this.facetMetaclass.getValue2(), this.initialFacet);
- addSubWidget(this.subTypingTypeW);
- }
-
- @Override
- public void notifyChanged() {
- // No action has to be done if a change appends.
- }
-
- @Override
- public void onDialogValidation() {
- // Nothing.
- }
-
- public IAbstractWidget getSelectSubTypingTypeWidget() {
- return this.subTypingTypeW;
- }
-
- public IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget() {
- return new SynchronizedGetExtendedMetaclassWidget(this.extMetaclassW,
- this.extMetaclassW.getDisplay());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.IFacetWidget#setSubTypingFacetSelection(boolean)
- */
- public void setSubTypingFacetSelection(final boolean enable) {
- this.subTypingTypeW.setSelection(enable);
- }
-
- public String getSubTypingFacet() {
- return this.subTypingTypeW.getSubTypingText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.IFacetWidget#pressSubTypingButton()
- */
- public IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton() {
- return this.subTypingTypeW.pressButton();
- }
-
- @Override
- protected IGetOrCreateFacetSetWidget createGetOrCreateElementWidgetComposite() {
- return new GetOrCreateFacetSetWidget(this, this.getContainerPropery(),
- this.getEditingDomain(), null);
- }
-
- @Override
- protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() {
- final AbstractGetElementNameWidget widget = new AbstractGetElementNameWidget(
- this, this.facetNameProperty) {
- @Override
- protected String getErrorMessage() {
- return ""; //$NON-NLS-1$
- }
-
- @Override
- protected String getLabel() {
- return Messages.EditFacetWidget_FacetName;
- }
-
- @Override
- public void notifyChanged() {
- // Noting to do
- }
-
- };
- return widget;
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetExtendedMetaclassWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.SelectSubTypingTypeWidget; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.dialog.IDialog; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.widget.IAbstractWidget; +import org.eclipse.papyrus.emf.facet.util.ui.utils.PropertyElement2; +import org.eclipse.swt.widgets.Composite; + +/** + * Widget for the edition of a {@link Facet}. + */ +public class EditFacetWidget + extends + AbstractENamedElementWidget<Facet, FacetSet, IGetOrCreateFilteredFacetSetWidget> implements IFacetWidget { + + private final Facet initialFacet; + private final PropertyElement2<String> facetNameProperty; + private final PropertyElement2<EClass> facetMetaclass; + private final PropertyElement2<ETypedElement> conformProperty; + private SelectSubTypingTypeWidget subTypingTypeW; + private GetExtendedMetaclassWidget extMetaclassW; + + /** + * Constructor. + * + * @param parent + * the parent of this composite. + * @param editingDomain + * the current editing domain. + * @param properties + * the properties. + * @param initialFacet + * the {@link Facet} to edit. + * @param facetNameProperty + * @param containerProperty + * @param conformProperty + * @param facetMetaclass + */ + public EditFacetWidget(final Composite parent, + final Facet initialFacet, final EditingDomain editingDomain, + final PropertyElement2<String> facetNameProperty, + final PropertyElement2<FacetSet> facetSetProperty, + final PropertyElement2<ETypedElement> conformProperty, + final PropertyElement2<EClass> facetMetaclass) { + super(parent, editingDomain, facetSetProperty, facetNameProperty); + this.facetNameProperty = facetNameProperty; + this.facetMetaclass = facetMetaclass; + this.conformProperty = conformProperty; + this.initialFacet = initialFacet; + } + + @Override + public Command getCommand() { + return this.getCommandFactory().createEditFacetCommand( + this.initialFacet, this.getContainerPropery().getValue2(), + this.facetNameProperty.getValue2(), + this.conformProperty.getValue2(), + this.facetMetaclass.getValue2(), null); + } + + @Override + protected void addSubWidgets() { + super.addSubWidgets(); + this.extMetaclassW = new GetExtendedMetaclassWidget(this, + this.facetMetaclass, this.getContainerPropery()); + addSubWidget(this.extMetaclassW); + this.subTypingTypeW = new SelectSubTypingTypeWidget(this, + this.conformProperty, this.getEditingDomain(), + this.facetMetaclass.getValue2(), this.initialFacet); + addSubWidget(this.subTypingTypeW); + } + + @Override + public void notifyChanged() { + // No action has to be done if a change appends. + } + + @Override + public void onDialogValidation() { + // Nothing. + } + + public IAbstractWidget getSelectSubTypingTypeWidget() { + return this.subTypingTypeW; + } + + public IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget() { + return new SynchronizedGetExtendedMetaclassWidget(this.extMetaclassW, + this.extMetaclassW.getDisplay()); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.IFacetWidget#setSubTypingFacetSelection(boolean) + */ + public void setSubTypingFacetSelection(final boolean enable) { + this.subTypingTypeW.setSelection(enable); + } + + public String getSubTypingFacet() { + return this.subTypingTypeW.getSubTypingText(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.widget.edition.IFacetWidget#pressSubTypingButton() + */ + public IDialog<IGetOrCreateFilteredElementCommmandWidget<ETypedElement, Object>> pressSubTypingButton() { + return this.subTypingTypeW.pressButton(); + } + + @Override + protected IGetOrCreateFacetSetWidget createGetOrCreateElementWidgetComposite() { + return new GetOrCreateFacetSetWidget(this, this.getContainerPropery(), + this.getEditingDomain(), null); + } + + @Override + protected AbstractGetElementNameWidget createGetElementNameSubWidgetComposite() { + final AbstractGetElementNameWidget widget = new AbstractGetElementNameWidget( + this, this.facetNameProperty) { + @Override + protected String getErrorMessage() { + return ""; //$NON-NLS-1$ + } + + @Override + protected String getLabel() { + return Messages.EditFacetWidget_FacetName; + } + + @Override + public void notifyChanged() { + // Noting to do + } + + }; + return widget; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java index 54745e8c2a3..4001f10ab6c 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java @@ -1,238 +1,238 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.emf.facet.efacet.core.IFacetActions;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Activator;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.WorkbenchUtils;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedCreateFacetSetWizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedFacetSetPropertyWizardPage;
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Wizard for the creation of the "ecore" file with the main facetSet.
- */
-public class CreateFacetSetWizard extends Wizard implements INewWizard,
- IExtendedWizard {
-
- private WizardDialog dialog;
-
- private IStructuredSelection selection;
- private IWorkbench workbench;
- private final ICreateFacetSetWizardPage facetSetWizard;
- private final IFacetSetPropertyWizardPage propertyWizard;
-
- private boolean openFacetSet = true;
-
- public CreateFacetSetWizard() {
- this(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getSelectionService().getSelection());
- }
-
- public CreateFacetSetWizard(final ISelection selection,
- final boolean openFacetSet) {
- this(selection);
- this.openFacetSet = openFacetSet;
- }
-
- public CreateFacetSetWizard(final ISelection selection) {
- super();
- if (selection instanceof IStructuredSelection) {
- this.selection = (IStructuredSelection) selection;
- }
- setWindowTitle(Messages.Create_FacetSet_Model);
-
- this.facetSetWizard = new CreateFacetSetWizardPage("Whatever", this.selection); //$NON-NLS-1$
- this.propertyWizard = new FacetSetPropertyWizardPage("Whatever"); //$NON-NLS-1$
-
- }
-
- @Override
- public void addPages() {
- addPage(this.facetSetWizard);
- addPage(this.propertyWizard);
- }
-
- public int open() {
- this.dialog = new WizardDialog(Display.getDefault().getShells()[0],
- this);
- int result = Window.CANCEL;
-
- if (this.dialog != null) {
- result = this.dialog.open();
- }
- return result;
- }
-
- @Override
- public boolean performFinish() {
- boolean result = false;
-
- if (this.propertyWizard.isPageComplete()) {
- try {
- // Remember the file.
- final IFile modelFile = getModelFile();
-
- // Do the work within an operation.
- final WorkspaceModifyOperation operation = createOperation(modelFile);
-
- getContainer().run(false, false, operation);
-
- if (this.openFacetSet) {
- // Select the new file resource in the current view.
- final IWorkbenchWindow workbenchWindow = selectWorkbenchWindow();
- final IWorkbenchPage page = WorkbenchUtils.selectNewFile(
- modelFile,
- workbenchWindow);
-
- WorkbenchUtils.openNewFile(modelFile, this.workbench,
- workbenchWindow,
- page);
- }
-
- result = true;
- } catch (final Exception exception) {
- Logger.logError(exception, Activator.getDefault());
- }
- }
-
- return result;
- }
-
- protected IWorkbenchWindow selectWorkbenchWindow() {
- if (this.workbench == null) {
- this.workbench = PlatformUI.getWorkbench();
- }
- final IWorkbenchWindow workbenchWindow = this.workbench
- .getActiveWorkbenchWindow();
- return workbenchWindow;
- }
-
- protected WorkspaceModifyOperation createOperation(final IFile modelFile) {
- final WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
- @Override
- protected void execute(final IProgressMonitor progressMonitor) {
- try {
- final FacetSet facetSet = createInitialFacet();
- IFacetActions.INSTANCE.saveFacetSet(facetSet, modelFile);
- } catch (final Exception exception) {
- Logger.logError(exception, Activator.getDefault());
- } finally {
- progressMonitor.done();
- }
- }
- };
- return operation;
- }
-
-
-
- @Override
- public boolean canFinish() {
- return (getContainer().getCurrentPage() == this.propertyWizard)
- && this.propertyWizard.isPageComplete();
- }
-
- public void init(final IWorkbench newWorkbench,
- final IStructuredSelection newSelection) {
- this.workbench = newWorkbench;
- this.selection = newSelection;
- }
-
- protected FacetSet createInitialFacet() {
- final FacetSet facetSet = EFacetPackage.eINSTANCE.getEFacetFactory()
- .createFacetSet();
- final String modelFacetSetName = getModelFile().getName().replaceAll(".efacet", ""); //$NON-NLS-1$ //$NON-NLS-2$
- facetSet.setName(modelFacetSetName);
- facetSet.setNsURI(this.propertyWizard.getNsUri());
- facetSet.setNsPrefix(this.propertyWizard.getPrefix());
- return facetSet;
- }
-
- public IFile getModelFile() {
- return this.facetSetWizard.getModelFile();
- }
-
- public IFacetSetPropertyWizardPage getPropertyWizard() {
- return this.propertyWizard;
- }
-
- public IWizardPage next() {
- final IWizardPage nextPage = getNextPage(getContainer()
- .getCurrentPage());
- this.dialog.showPage(nextPage);
- return getSynchronizedPage(nextPage);
-
- }
-
- public IWizardPage previous() {
- final IWizardPage previousPage = getPreviousPage(getContainer()
- .getCurrentPage());
- this.dialog.showPage(previousPage);
- return getSynchronizedPage(previousPage);
- }
-
- public boolean finish() {
- final boolean result = performFinish();
- dispose();
- setContainer(null);
- getDialog().close();
- return result;
- }
-
- public ICreateFacetSetWizardPage getFacetSetWizard() {
- return this.facetSetWizard;
- }
-
- public WizardDialog getDialog() {
- return this.dialog;
- }
-
- public IWizardPage getCurrentPage() {
- return getSynchronizedPage(getContainer().getCurrentPage());
- }
-
- private static IWizardPage getSynchronizedPage(final IWizardPage page) {
- IWizardPage result = null;
- if (page instanceof ICreateFacetSetWizardPage) {
- result = new SynchronizedCreateFacetSetWizardPage(
- (ICreateFacetSetWizardPage) page, Display.getDefault());
- } else if (page instanceof IFacetSetPropertyWizardPage) {
- result = new SynchronizedFacetSetPropertyWizardPage(
- (IFacetSetPropertyWizardPage) page, Display.getDefault());
- }
- return result;
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetActions; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage; +import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Activator; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.WorkbenchUtils; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedCreateFacetSetWizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedFacetSetPropertyWizardPage; +import org.eclipse.papyrus.emf.facet.util.core.Logger; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +/** + * Wizard for the creation of the "ecore" file with the main facetSet. + */ +public class CreateFacetSetWizard extends Wizard implements INewWizard, + IExtendedWizard { + + private WizardDialog dialog; + + private IStructuredSelection selection; + private IWorkbench workbench; + private final ICreateFacetSetWizardPage facetSetWizard; + private final IFacetSetPropertyWizardPage propertyWizard; + + private boolean openFacetSet = true; + + public CreateFacetSetWizard() { + this(PlatformUI.getWorkbench().getActiveWorkbenchWindow() + .getSelectionService().getSelection()); + } + + public CreateFacetSetWizard(final ISelection selection, + final boolean openFacetSet) { + this(selection); + this.openFacetSet = openFacetSet; + } + + public CreateFacetSetWizard(final ISelection selection) { + super(); + if (selection instanceof IStructuredSelection) { + this.selection = (IStructuredSelection) selection; + } + setWindowTitle(Messages.Create_FacetSet_Model); + + this.facetSetWizard = new CreateFacetSetWizardPage("Whatever", this.selection); //$NON-NLS-1$ + this.propertyWizard = new FacetSetPropertyWizardPage("Whatever"); //$NON-NLS-1$ + + } + + @Override + public void addPages() { + addPage(this.facetSetWizard); + addPage(this.propertyWizard); + } + + public int open() { + this.dialog = new WizardDialog(Display.getDefault().getShells()[0], + this); + int result = Window.CANCEL; + + if (this.dialog != null) { + result = this.dialog.open(); + } + return result; + } + + @Override + public boolean performFinish() { + boolean result = false; + + if (this.propertyWizard.isPageComplete()) { + try { + // Remember the file. + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + final WorkspaceModifyOperation operation = createOperation(modelFile); + + getContainer().run(false, false, operation); + + if (this.openFacetSet) { + // Select the new file resource in the current view. + final IWorkbenchWindow workbenchWindow = selectWorkbenchWindow(); + final IWorkbenchPage page = WorkbenchUtils.selectNewFile( + modelFile, + workbenchWindow); + + WorkbenchUtils.openNewFile(modelFile, this.workbench, + workbenchWindow, + page); + } + + result = true; + } catch (final Exception exception) { + Logger.logError(exception, Activator.getDefault()); + } + } + + return result; + } + + protected IWorkbenchWindow selectWorkbenchWindow() { + if (this.workbench == null) { + this.workbench = PlatformUI.getWorkbench(); + } + final IWorkbenchWindow workbenchWindow = this.workbench + .getActiveWorkbenchWindow(); + return workbenchWindow; + } + + protected WorkspaceModifyOperation createOperation(final IFile modelFile) { + final WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { + @Override + protected void execute(final IProgressMonitor progressMonitor) { + try { + final FacetSet facetSet = createInitialFacet(); + IFacetActions.INSTANCE.saveFacetSet(facetSet, modelFile); + } catch (final Exception exception) { + Logger.logError(exception, Activator.getDefault()); + } finally { + progressMonitor.done(); + } + } + }; + return operation; + } + + + + @Override + public boolean canFinish() { + return (getContainer().getCurrentPage() == this.propertyWizard) + && this.propertyWizard.isPageComplete(); + } + + public void init(final IWorkbench newWorkbench, + final IStructuredSelection newSelection) { + this.workbench = newWorkbench; + this.selection = newSelection; + } + + protected FacetSet createInitialFacet() { + final FacetSet facetSet = EFacetPackage.eINSTANCE.getEFacetFactory() + .createFacetSet(); + final String modelFacetSetName = getModelFile().getName().replaceAll(".efacet", ""); //$NON-NLS-1$ //$NON-NLS-2$ + facetSet.setName(modelFacetSetName); + facetSet.setNsURI(this.propertyWizard.getNsUri()); + facetSet.setNsPrefix(this.propertyWizard.getPrefix()); + return facetSet; + } + + public IFile getModelFile() { + return this.facetSetWizard.getModelFile(); + } + + public IFacetSetPropertyWizardPage getPropertyWizard() { + return this.propertyWizard; + } + + public IWizardPage next() { + final IWizardPage nextPage = getNextPage(getContainer() + .getCurrentPage()); + this.dialog.showPage(nextPage); + return getSynchronizedPage(nextPage); + + } + + public IWizardPage previous() { + final IWizardPage previousPage = getPreviousPage(getContainer() + .getCurrentPage()); + this.dialog.showPage(previousPage); + return getSynchronizedPage(previousPage); + } + + public boolean finish() { + final boolean result = performFinish(); + dispose(); + setContainer(null); + getDialog().close(); + return result; + } + + public ICreateFacetSetWizardPage getFacetSetWizard() { + return this.facetSetWizard; + } + + public WizardDialog getDialog() { + return this.dialog; + } + + public IWizardPage getCurrentPage() { + return getSynchronizedPage(getContainer().getCurrentPage()); + } + + private static IWizardPage getSynchronizedPage(final IWizardPage page) { + IWizardPage result = null; + if (page instanceof ICreateFacetSetWizardPage) { + result = new SynchronizedCreateFacetSetWizardPage( + (ICreateFacetSetWizardPage) page, Display.getDefault()); + } else if (page instanceof IFacetSetPropertyWizardPage) { + result = new SynchronizedFacetSetPropertyWizardPage( + (IFacetSetPropertyWizardPage) page, Display.getDefault()); + } + return result; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java index 132a4995f8d..4cf85834aef 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java @@ -1,40 +1,40 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.IWizardFactory;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.wizard.SynchronizedWizard;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Concrete implementation of {@link IWizardFactory}.
- *
- * @see IWizardFactory
- */
-public class WizardFactory implements IWizardFactory {
-
- public IExtendedWizard createCreateFacetSetWizard(
- final ISelection selection) {
- final CreateFacetSetWizard wizard = new CreateFacetSetWizard(
- selection);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- wizard.open();
- }
- });
- return new SynchronizedWizard<IExtendedWizard>(wizard,
- Display.getDefault());
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.IWizardFactory; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.util.wizard.SynchronizedWizard; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard; +import org.eclipse.swt.widgets.Display; + +/** + * Concrete implementation of {@link IWizardFactory}. + * + * @see IWizardFactory + */ +public class WizardFactory implements IWizardFactory { + + public IExtendedWizard createCreateFacetSetWizard( + final ISelection selection) { + final CreateFacetSetWizard wizard = new CreateFacetSetWizard( + selection); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + wizard.open(); + } + }); + return new SynchronizedWizard<IExtendedWizard>(wizard, + Display.getDefault()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java index cece86b9fad..215bfe3be1c 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java @@ -1,104 +1,104 @@ -/**
- * Copyright (c) 2011 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:
- * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
- * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-public class CreateFacetSetWizardPage extends WizardNewFileCreationPage
- implements ICreateFacetSetWizardPage {
-
- private static final String FILE_EXTENSION = "efacet"; //$NON-NLS-1$
- private static final String MODEL_BASE = "My"; //$NON-NLS-1$
-
- public CreateFacetSetWizardPage(final String pageId,
- final IStructuredSelection selection) {
- super(pageId, selection);
- setTitle(Messages.CreateFacetSetWizardImpl_FacetModel);
- setDescription(Messages.CreateFacetSetWizardImpl_Create_new_facet_Set);
- setFileName(MODEL_BASE + "." + CreateFacetSetWizardPage.FILE_EXTENSION); //$NON-NLS-1$
- // Try and get the resource selection to determine a current directory
- // for the file dialog.
- if ((selection != null) && !selection.isEmpty()) {
- // Get the resource...
- getResource(selection);
- }
- }
-
- private void getResource(final IStructuredSelection selection) {
- final Object selectedElement = selection.iterator().next();
- if (selectedElement instanceof IResource) {
- // Get the resource parent, if its a file.
- IResource selectedResource = (IResource) selectedElement;
- if (selectedResource.getType() == IResource.FILE) {
- selectedResource = selectedResource.getParent();
- }
- // This gives us a directory...
- if ((selectedResource instanceof IFolder)
- || (selectedResource instanceof IProject)) {
- // Set this for the container.
- setContainerFullPath(selectedResource.getFullPath());
- // Make up a unique new name here.
- final String modelFileExt = CreateFacetSetWizardPage.FILE_EXTENSION;
- String modelFilename = MODEL_BASE + "." + modelFileExt; //$NON-NLS-1$
- for (int i = 1; ((IContainer) selectedResource)
- .findMember(modelFilename) != null; ++i) {
- modelFilename = MODEL_BASE + i + "." + modelFileExt; //$NON-NLS-1$
- }
- setFileName(modelFilename);
- }
- }
- }
-
- @Override
- protected boolean validatePage() {
- boolean valid = super.validatePage();
-
- if (valid) {
- final String extension = new Path(getFileName()).getFileExtension();
- if ((extension == null)
- || !CreateFacetSetWizardPage.FILE_EXTENSION
- .equalsIgnoreCase(extension)) {
- setErrorMessage(Messages.CreateFacetSetWizardImpl_File_extension_restriction);
- valid = false;
- }
- final IPath containerFullPath = getContainerFullPath();
- // try {
- // if (!PluginUtils.isInPluginProject(containerFullPath)) {
- // setMessage(
- // Messages.CreateFacetSetWizardPage_Not_a_Plugin_project,
- // IMessageProvider.WARNING);
- // }
- // } catch (final CoreException e) {
- // Logger.logError(e, Activator.getDefault());
- // }
- }
-
- return valid;
- }
-
- public IFile getModelFile() {
- return ResourcesPlugin.getWorkspace().getRoot()
- .getFile(getContainerFullPath().append(getFileName()));
- }
-}
+/** + * Copyright (c) 2011 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: + * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor + * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +public class CreateFacetSetWizardPage extends WizardNewFileCreationPage + implements ICreateFacetSetWizardPage { + + private static final String FILE_EXTENSION = "efacet"; //$NON-NLS-1$ + private static final String MODEL_BASE = "My"; //$NON-NLS-1$ + + public CreateFacetSetWizardPage(final String pageId, + final IStructuredSelection selection) { + super(pageId, selection); + setTitle(Messages.CreateFacetSetWizardImpl_FacetModel); + setDescription(Messages.CreateFacetSetWizardImpl_Create_new_facet_Set); + setFileName(MODEL_BASE + "." + CreateFacetSetWizardPage.FILE_EXTENSION); //$NON-NLS-1$ + // Try and get the resource selection to determine a current directory + // for the file dialog. + if ((selection != null) && !selection.isEmpty()) { + // Get the resource... + getResource(selection); + } + } + + private void getResource(final IStructuredSelection selection) { + final Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + IResource selectedResource = (IResource) selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + // This gives us a directory... + if ((selectedResource instanceof IFolder) + || (selectedResource instanceof IProject)) { + // Set this for the container. + setContainerFullPath(selectedResource.getFullPath()); + // Make up a unique new name here. + final String modelFileExt = CreateFacetSetWizardPage.FILE_EXTENSION; + String modelFilename = MODEL_BASE + "." + modelFileExt; //$NON-NLS-1$ + for (int i = 1; ((IContainer) selectedResource) + .findMember(modelFilename) != null; ++i) { + modelFilename = MODEL_BASE + i + "." + modelFileExt; //$NON-NLS-1$ + } + setFileName(modelFilename); + } + } + } + + @Override + protected boolean validatePage() { + boolean valid = super.validatePage(); + + if (valid) { + final String extension = new Path(getFileName()).getFileExtension(); + if ((extension == null) + || !CreateFacetSetWizardPage.FILE_EXTENSION + .equalsIgnoreCase(extension)) { + setErrorMessage(Messages.CreateFacetSetWizardImpl_File_extension_restriction); + valid = false; + } + final IPath containerFullPath = getContainerFullPath(); + // try { + // if (!PluginUtils.isInPluginProject(containerFullPath)) { + // setMessage( + // Messages.CreateFacetSetWizardPage_Not_a_Plugin_project, + // IMessageProvider.WARNING); + // } + // } catch (final CoreException e) { + // Logger.logError(e, Activator.getDefault()); + // } + } + + return valid; + } + + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot() + .getFile(getContainerFullPath().append(getFileName())); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java index 9162294f910..94178256632 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java @@ -1,120 +1,120 @@ -/**
- * Copyright (c) 2011 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:
- * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
- * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
- */
-package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Wizard page to enter a NsURI, a prefix and an extended EPackage to a facetSet
- */
-public class FacetSetPropertyWizardPage extends WizardPage
- implements IFacetSetPropertyWizardPage {
-
- private transient Text nsUriTextField;
- private transient Text prefixTextField;
-
- public FacetSetPropertyWizardPage(final String pageName) {
- super(pageName);
-
- setTitle(Messages.FacetSetPropertyWizardPage_facet_properties);
- }
-
- public void createControl(final Composite parent) {
-
- final Composite nsURiContainer = new Composite(parent, SWT.NONE);
- nsURiContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- nsURiContainer.setLayout(new GridLayout(2, false));
-
- // NsURI
- final Label nsUriLabel = new Label(nsURiContainer, SWT.NONE);
- nsUriLabel.setText(Messages.Enter_a_nsUri);
- this.nsUriTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE);
- this.nsUriTextField
- .setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- this.nsUriTextField.addListener(SWT.Modify, new Listener() {
- public void handleEvent(final Event event) {
- updateButtons();
- }
- });
-
- // PREFIX
- final Label prefixLabel = new Label(nsURiContainer, SWT.NONE);
- prefixLabel.setText(Messages.Enter_a_prefix);
- this.prefixTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE);
- this.prefixTextField.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
- this.prefixTextField.addListener(SWT.Modify, new Listener() {
- public void handleEvent(final Event event) {
- updateButtons();
- }
- });
-
- setControl(nsURiContainer);
- }
-
- @Override
- public boolean isPageComplete() {
- boolean result = false;
-
- if (this.nsUriTextField.getText().length() == 0) {
- setErrorMessage(Messages.Please_enter_nsUri);
- }
-
- if (this.prefixTextField.getText().length() == 0) {
- setErrorMessage(Messages.Please_enter_prefix);
- }
-
- if (super.isPageComplete()) {
- setErrorMessage(null);
- result = true;
- } else {
- setErrorMessage(Messages.Please_select_EPackage);
- }
-
- return result;
- }
-
- public void setIsPageComplete(final boolean complete) {
- this.setPageComplete(complete);
- }
-
- protected void updateButtons() {
- getContainer().updateButtons();
- }
-
- public void setNsUri(final String nsUri) {
- this.nsUriTextField.setText(nsUri);
- }
-
- public void setPrefix(final String prefix) {
- this.prefixTextField.setText(prefix);
- }
-
- public String getNsUri() {
- return this.nsUriTextField.getText();
- }
-
- public String getPrefix() {
- return this.prefixTextField.getText();
- }
-}
+/** + * Copyright (c) 2011 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: + * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor + * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors + */ +package org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page; + +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Text; + +/** + * Wizard page to enter a NsURI, a prefix and an extended EPackage to a facetSet + */ +public class FacetSetPropertyWizardPage extends WizardPage + implements IFacetSetPropertyWizardPage { + + private transient Text nsUriTextField; + private transient Text prefixTextField; + + public FacetSetPropertyWizardPage(final String pageName) { + super(pageName); + + setTitle(Messages.FacetSetPropertyWizardPage_facet_properties); + } + + public void createControl(final Composite parent) { + + final Composite nsURiContainer = new Composite(parent, SWT.NONE); + nsURiContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + nsURiContainer.setLayout(new GridLayout(2, false)); + + // NsURI + final Label nsUriLabel = new Label(nsURiContainer, SWT.NONE); + nsUriLabel.setText(Messages.Enter_a_nsUri); + this.nsUriTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE); + this.nsUriTextField + .setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + this.nsUriTextField.addListener(SWT.Modify, new Listener() { + public void handleEvent(final Event event) { + updateButtons(); + } + }); + + // PREFIX + final Label prefixLabel = new Label(nsURiContainer, SWT.NONE); + prefixLabel.setText(Messages.Enter_a_prefix); + this.prefixTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE); + this.prefixTextField.setLayoutData(new GridData( + GridData.FILL_HORIZONTAL)); + this.prefixTextField.addListener(SWT.Modify, new Listener() { + public void handleEvent(final Event event) { + updateButtons(); + } + }); + + setControl(nsURiContainer); + } + + @Override + public boolean isPageComplete() { + boolean result = false; + + if (this.nsUriTextField.getText().length() == 0) { + setErrorMessage(Messages.Please_enter_nsUri); + } + + if (this.prefixTextField.getText().length() == 0) { + setErrorMessage(Messages.Please_enter_prefix); + } + + if (super.isPageComplete()) { + setErrorMessage(null); + result = true; + } else { + setErrorMessage(Messages.Please_select_EPackage); + } + + return result; + } + + public void setIsPageComplete(final boolean complete) { + this.setPageComplete(complete); + } + + protected void updateButtons() { + getContainer().updateButtons(); + } + + public void setNsUri(final String nsUri) { + this.nsUriTextField.setText(nsUri); + } + + public void setPrefix(final String prefix) { + this.prefixTextField.setText(prefix); + } + + public String getNsUri() { + return this.nsUriTextField.getText(); + } + + public String getPrefix() { + return this.prefixTextField.getText(); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java index af90f0a9c2d..4900b209af7 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java @@ -1,70 +1,70 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Synchronized class for safe run.
- */
-public class SynchronizedCreateFacetSetWizardPage extends
- SynchronizedWizardPage<ICreateFacetSetWizardPage> implements
- ICreateFacetSetWizardPage {
-
- /**
- * Constructor.
- *
- * @param object
- * the to synchronized.
- * @param display
- * the display.
- */
- public SynchronizedCreateFacetSetWizardPage(
- final ICreateFacetSetWizardPage object, final Display display) {
- super(object, display);
- }
-
- public IFile getModelFile() {
- return this.safeSyncExec(new AbstractExceptionFreeRunnable<IFile>() {
- @Override
- public IFile safeRun() {
- return SynchronizedCreateFacetSetWizardPage.this
- .getSynchronizedObject().getModelFile();
- }
- });
- }
-
- public String getFileName() {
- return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
- @Override
- public String safeRun() {
- return SynchronizedCreateFacetSetWizardPage.this
- .getSynchronizedObject().getFileName();
- }
- });
- }
-
- public void setFileName(final String fileName) {
- this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
- @Override
- public void voidSafeRun() {
- SynchronizedCreateFacetSetWizardPage.this
- .getSynchronizedObject().setFileName(fileName);
- }
- });
- }
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page; + +import org.eclipse.core.resources.IFile; +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable; +import org.eclipse.swt.widgets.Display; + +/** + * Synchronized class for safe run. + */ +public class SynchronizedCreateFacetSetWizardPage extends + SynchronizedWizardPage<ICreateFacetSetWizardPage> implements + ICreateFacetSetWizardPage { + + /** + * Constructor. + * + * @param object + * the to synchronized. + * @param display + * the display. + */ + public SynchronizedCreateFacetSetWizardPage( + final ICreateFacetSetWizardPage object, final Display display) { + super(object, display); + } + + public IFile getModelFile() { + return this.safeSyncExec(new AbstractExceptionFreeRunnable<IFile>() { + @Override + public IFile safeRun() { + return SynchronizedCreateFacetSetWizardPage.this + .getSynchronizedObject().getModelFile(); + } + }); + } + + public String getFileName() { + return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() { + @Override + public String safeRun() { + return SynchronizedCreateFacetSetWizardPage.this + .getSynchronizedObject().getFileName(); + } + }); + } + + public void setFileName(final String fileName) { + this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() { + @Override + public void voidSafeRun() { + SynchronizedCreateFacetSetWizardPage.this + .getSynchronizedObject().setFileName(fileName); + } + }); + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java index c509a7e02d8..b2ac083afaa 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java @@ -1,80 +1,80 @@ -/**
- * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page;
-
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
-import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
-import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Synchronized class for safe run.
- */
-public class SynchronizedFacetSetPropertyWizardPage extends
- SynchronizedWizardPage<IFacetSetPropertyWizardPage> implements
- IFacetSetPropertyWizardPage {
-
- /**
- * Constructor.
- *
- * @param object
- * the to synchronized.
- * @param display
- * the display.
- */
- public SynchronizedFacetSetPropertyWizardPage(
- final IFacetSetPropertyWizardPage object, final Display display) {
- super(object, display);
- }
-
- public String getNsUri() {
- return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
- @Override
- public String safeRun() {
- return SynchronizedFacetSetPropertyWizardPage.this
- .getSynchronizedObject().getNsUri();
- }
- });
- }
-
- public void setNsUri(final String nsUri) {
- this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
- @Override
- public void voidSafeRun() {
- SynchronizedFacetSetPropertyWizardPage.this
- .getSynchronizedObject().setNsUri(nsUri);
- }
- });
- }
-
- public String getPrefix() {
- return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
- @Override
- public String safeRun() {
- return SynchronizedFacetSetPropertyWizardPage.this
- .getSynchronizedObject().getPrefix();
- }
- });
- }
-
- public void setPrefix(final String prefix) {
- this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
- @Override
- public void voidSafeRun() {
- SynchronizedFacetSetPropertyWizardPage.this
- .getSynchronizedObject().setPrefix(prefix);
- }
- });
- }
-
-}
+/** + * 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.papyrus.emf.facet.efacet.sdk.ui.internal.wizard.page; + +import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage; +import org.eclipse.papyrus.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable; +import org.eclipse.papyrus.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable; +import org.eclipse.swt.widgets.Display; + +/** + * Synchronized class for safe run. + */ +public class SynchronizedFacetSetPropertyWizardPage extends + SynchronizedWizardPage<IFacetSetPropertyWizardPage> implements + IFacetSetPropertyWizardPage { + + /** + * Constructor. + * + * @param object + * the to synchronized. + * @param display + * the display. + */ + public SynchronizedFacetSetPropertyWizardPage( + final IFacetSetPropertyWizardPage object, final Display display) { + super(object, display); + } + + public String getNsUri() { + return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() { + @Override + public String safeRun() { + return SynchronizedFacetSetPropertyWizardPage.this + .getSynchronizedObject().getNsUri(); + } + }); + } + + public void setNsUri(final String nsUri) { + this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() { + @Override + public void voidSafeRun() { + SynchronizedFacetSetPropertyWizardPage.this + .getSynchronizedObject().setNsUri(nsUri); + } + }); + } + + public String getPrefix() { + return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() { + @Override + public String safeRun() { + return SynchronizedFacetSetPropertyWizardPage.this + .getSynchronizedObject().getPrefix(); + } + }); + } + + public void setPrefix(final String prefix) { + this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() { + @Override + public void voidSafeRun() { + SynchronizedFacetSetPropertyWizardPage.this + .getSynchronizedObject().setPrefix(prefix); + } + }); + } + +} |