Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java129
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java224
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Startup.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java71
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java68
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java179
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java184
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/AbstractComandExecDialog.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetDialog.java108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateFacetSetDialog.java103
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetOrCreateOperationDialog.java114
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/composite/GetSubTypingTypeDialog.java88
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractDerivedTypedElementDialog.java44
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractENamedElementDialog.java39
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractEStructuralFeatureDialog.java77
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AbstractETypedElementDialog.java78
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddAttributeInFacetDialog.java66
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddOperationInFacetDialog.java74
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddParameterInOperationDialog.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/AddReferenceInFacetDialog.java69
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetInFacetSetDialog.java83
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/creation/CreateFacetSetInFacetSetDialog.java78
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetAttributeDialog.java73
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetDialog.java91
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationDialog.java75
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetOperationParameterDialog.java74
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetReferenceDialog.java74
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/edition/EditFacetSetDialog.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java38
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/dialog/query/IQueryDialogFactory.java27
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IDerivedTypedElementWidget.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IENamedElementWidget.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IEStructuralFeatureWidget.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IETypedElementWidget.java56
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/IFacetWidget.java32
-rw-r--r--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.java35
-rw-r--r--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.java21
-rw-r--r--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.java31
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/ICreateFacetInFacetSetWidget.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/widget/creation/IGetOrCreateFilteredFacetSetWidget.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/IWizardFactory.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/ICreateFacetSetWizardPage.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/wizard/page/IFacetSetPropertyWizardPage.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddAttributeInFacetHandler.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddOperationInFacetHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddParameterInOperationHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/AddReferenceInFacetHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetInFacetSetHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/creation/CreateFacetSetInFacetSetHandler.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties177
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java253
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java164
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java53
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java91
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java290
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedCreateQueryWidget.java114
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedDerivedTypedElementWidget.java276
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedENamedElementWidget.java123
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedEStructuralFeatureWidget.java348
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedETypedElementWidget.java231
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedFacetWidget.java161
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetExtendedMetaclassWidget.java98
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredElementCommmandWidget.java143
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredFacetSetWidget.java126
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetSetWidget.java100
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateFacetWidget.java95
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/getorcreate/GetOrCreateOperationWidget.java94
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetElementTypeWidget.java79
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetExtendedMetaclassWidget.java84
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/GetSubTypingTypeWidget.java88
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/metaclass/SelectSubTypingTypeWidget.java161
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetChangeableWidget.java57
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetDerivedWidget.java57
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetOrderedWidget.java57
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetTransientWidget.java57
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetUniqueWidget.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/properties/GetVolatileWidget.java57
-rw-r--r--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.java56
-rw-r--r--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.java56
-rw-r--r--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.java56
-rw-r--r--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.java47
-rw-r--r--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.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/CreateQueryWidget.java105
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanBeCachedWidget.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/component/query/GetCanHaveSideEffectsWidget.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractDerivedTypedElementWidget.java184
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractENamedElementWidget.java125
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractEStructuralFeatureWidget.java135
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AbstractETypedElementWidget.java188
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddOperationInFacetWidget.java104
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/AddParameterInOperationWidget.java119
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetFilteredSubTypingTypeWidget.java153
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetSetWidget.java142
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredFacetWidget.java96
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/creation/GetOrCreateFiltredOperationWidget.java93
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetAttributeWidget.java81
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationParameterWidget.java72
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetOperationWidget.java78
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetReferenceWidget.java81
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetSetWidget.java113
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/widget/edition/EditFacetWidget.java168
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java240
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java109
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java120
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java80
118 files changed, 10402 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/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
new file mode 100644
index 00000000000..9b6e3bcb54d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/dialog/IFacetDialogFactory.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.dialog;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.FacetDialogFactoryImpl;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.SynchronizedFacetDialogFactory;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..5defa8d21d9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Activator.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+// Copied from org.eclipse.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
new file mode 100644
index 00000000000..9ca73bf4e59
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Messages.java
@@ -0,0 +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.emf.facet.infra.query.ui.Messages
+ * Nicolas Bros (Mia-Software) - copied from org.eclipse.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.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.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.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.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/Startup.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Startup.java
new file mode 100644
index 00000000000..8636cdb684b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/Startup.java
@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal;
+
+import org.eclipse.ui.IStartup;
+
+public class Startup implements IStartup {
+
+ public void earlyStartup() {
+ // Nothing.
+ }
+
+}
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
new file mode 100644
index 00000000000..eec19a94a0a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/WorkbenchUtils.java
@@ -0,0 +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
+ */
+package org.eclipse.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
new file mode 100644
index 00000000000..45630c83ab9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractComandMainDialog.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exception.SdkUiRuntimeException;
+import org.eclipse.emf.facet.util.core.DebugUtils;
+import org.eclipse.emf.facet.util.emf.core.EmfDebugUtils;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.AbstractMainDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.osgi.util.NLS;
+
+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
new file mode 100644
index 00000000000..9bb76eab1ea
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/AbstractCommandDialog.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.facet.util.emf.ui.util.EditingUtil;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..04e288a1138
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/FacetDialogFactoryImpl.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddAttributeInFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddParameterInOperationDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddReferenceInFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetAttributeDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetOperationParameterDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetReferenceDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.edition.EditFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.emf.ui.util.EditingUtil;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.handler.HandlerUtils;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..c91b3a8cdee
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/dialog/SynchronizedFacetDialogFactory.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.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
new file mode 100644
index 00000000000..aa7b714e0af
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.AbstractDialogWithCallback;
+import org.eclipse.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
new file mode 100644
index 00000000000..404a8a537b7
--- /dev/null
+++ 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
@@ -0,0 +1,108 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..31649fae646
--- /dev/null
+++ 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
@@ -0,0 +1,103 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.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
new file mode 100644
index 00000000000..ba13e6e30b9
--- /dev/null
+++ 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
@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.GetOrCreateFiltredOperationWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..772dca6bc44
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.GetFilteredSubTypingTypeWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.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
new file mode 100644
index 00000000000..4de5e906bbe
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..24d79d191bf
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.sdk.ui.internal.dialog.AbstractComandMainDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..1cc026071ee
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..7fff790a568
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..08f54888606
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..716c1257cc1
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..0e818b45c21
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..d0c113dd1ca
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..f0d98b9bf62
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..be4062cbf4b
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.creation;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..897f9f67722
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.edition;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetAttributeWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..2c114965123
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..76a74b868dc
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.edition;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractDerivedTypedElementDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..59763d4c2a7
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.edition;
+
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractETypedElementDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetOperationParameterWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..3cd58618f10
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.edition;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractEStructuralFeatureDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetReferenceWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..b0ddc2c8d56
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.dialog.edition;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AbstractENamedElementDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.edition.EditFacetSetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..c42fc6d9144
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exception/SdkUiRuntimeException.java
@@ -0,0 +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.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
new file mode 100644
index 00000000000..5e83738bf48
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryContext.java
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.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
new file mode 100644
index 00000000000..ba508fe53da
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/exported/IQueryDialogFactoryStrategy.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.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
new file mode 100644
index 00000000000..2d104eb90fa
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.dialog.query;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.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
new file mode 100644
index 00000000000..f55e71f11e8
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..29461d77a10
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..7c2c88259ca
--- /dev/null
+++ 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
@@ -0,0 +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.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
new file mode 100644
index 00000000000..6c4a447c489
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.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
new file mode 100644
index 00000000000..58925808da0
--- /dev/null
+++ 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
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget;
+
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..8aec91428b3
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..3bcaf9a1b96
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard;
+import org.eclipse.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
new file mode 100644
index 00000000000..c1f69d284f1
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..fd6c2ac049f
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget.creation;
+
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..5d815d3e30c
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.widget.creation;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..f13680a4a23
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.wizard;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.WizardFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
+import org.eclipse.jface.viewers.ISelection;
+
+/**
+ * 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
new file mode 100644
index 00000000000..fd012fe918e
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.wizard.page;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage;
+import org.eclipse.jface.wizard.IWizardPage;
+
+/**
+ * @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
new file mode 100644
index 00000000000..4737b30d0cd
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.exported.wizard.page;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage;
+import org.eclipse.jface.wizard.IWizardPage;
+
+/**
+ * @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
new file mode 100644
index 00000000000..f837ea6b862
--- /dev/null
+++ 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
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the 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
new file mode 100644
index 00000000000..5a317dd1b73
--- /dev/null
+++ 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
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the 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
new file mode 100644
index 00000000000..62475914c49
--- /dev/null
+++ 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
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the 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
new file mode 100644
index 00000000000..583bec3707f
--- /dev/null
+++ 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
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the 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
new file mode 100644
index 00000000000..358eed92ac9
--- /dev/null
+++ 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
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.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
new file mode 100644
index 00000000000..4911708f66c
--- /dev/null
+++ 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
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.creation;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.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
new file mode 100644
index 00000000000..3cdd66195d7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetAttributeHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetAttribute}
+ */
+public class EditFacetAttributeHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetAttribute.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetAttributeDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java
new file mode 100644
index 00000000000..b32023cf797
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link Facet}
+ */
+public class EditFacetHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return Facet.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java
new file mode 100644
index 00000000000..7478fe4a700
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetOperation}
+ */
+public class EditFacetOperationHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetOperation.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetOperationDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java
new file mode 100644
index 00000000000..319b18e038b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetOperationParameterHandler.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link EParameter}
+ */
+public class EditFacetOperationParameterHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return EParameter.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE
+ .openEditFacetOperationParameterDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java
new file mode 100644
index 00000000000..f1556e0009d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetReferenceHandler.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+
+/**
+ * Handler for the edition of a {@link FacetReference}
+ */
+public class EditFacetReferenceHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetReference.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetReferenceDialog();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java
new file mode 100644
index 00000000000..c0b6bd5028f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/handler/edition/EditFacetSetHandler.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.handler.edition;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.handler.HandlerUtils;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+public class EditFacetSetHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ public boolean isEnabled() {
+ boolean isEnabled = false;
+ final IStructuredSelection selection = HandlerUtils
+ .getStructuredSelection();
+ if (selection != null) {
+ final FacetSet facetSet = (FacetSet) HandlerUtils
+ .getStructuredSelection().getFirstElement();
+ isEnabled = facetSet.eContainer() != null;
+ }
+ return isEnabled && super.isEnabled();
+ }
+
+ @Override
+ protected Class<?> getSelectionExpectedType() {
+ return FacetSet.class;
+ }
+
+ public Object execute(final ExecutionEvent event) {
+ return IFacetDialogFactory.INSTANCE.openEditFacetSetDialog();
+ }
+}
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
new file mode 100644
index 00000000000..0e123e17984
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/messages.properties
@@ -0,0 +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.emf.facet.infra.query.ui/src/org/eclipse/emf/facet/infra/query/ui/messages.properties
+# Nicolas Bros (Mia-Software) - copied from /org.eclipse.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.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.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
new file mode 100644
index 00000000000..6d7007cf89f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/AbstractQueryDialogFactory.java
@@ -0,0 +1,253 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.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.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.ExtensiblePackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.dialog.query.IQueryDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.query.AbstractQueryWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.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
new file mode 100644
index 00000000000..44a6506af6d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/GetQueryDialog.java
@@ -0,0 +1,164 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.query;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.AbstractCommandDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedCreateQueryWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.query.CreateQueryWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.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
new file mode 100644
index 00000000000..fcee9108cd2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryCreationResult.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.query;
+
+import org.eclipse.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
new file mode 100644
index 00000000000..3c536f711c0
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/IQueryWidgetCompositeFactoryFactory.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.query;
+
+import java.util.List;
+
+import org.eclipse.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
new file mode 100644
index 00000000000..11ebc80654a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/QueryWidgetCompositeFactoryImpl.java
@@ -0,0 +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.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.emf.facet.efacet.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Implementation of the {@link IQueryWidgetCompositeFactoryFactory}.
+ */
+public class QueryWidgetCompositeFactoryImpl implements
+ IQueryWidgetCompositeFactoryFactory {
+
+ private static final String EXTENSION_POINT = "org.eclipse.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
new file mode 100644
index 00000000000..6d357a80e5d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/query/SelectQueryTypeWidget.java
@@ -0,0 +1,290 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.query;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.emf.facet.util.ui.utils.UIUtils;
+import org.eclipse.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/sync/generated/SynchronizedCreateQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedCreateQueryWidget.java
new file mode 100644
index 00000000000..a7c518d905f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedCreateQueryWidget.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedCreateQueryWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget {
+
+ public SynchronizedCreateQueryWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedCreateQueryWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedCreateQueryWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedCreateQueryWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedCreateQueryWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedCreateQueryWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedCreateQueryWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedCreateQueryWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final java.lang.Object getCreateQueryWidget() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedCreateQueryWidget.this.getSynchronizedObject().getCreateQueryWidget();
+ }
+ });
+ }
+
+ public final boolean isCanBeCached() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedCreateQueryWidget.this.getSynchronizedObject().isCanBeCached());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isHasSideEffect() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedCreateQueryWidget.this.getSynchronizedObject().isHasSideEffect());
+ }
+ }).booleanValue();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedDerivedTypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedDerivedTypedElementWidget.java
new file mode 100644
index 00000000000..dea0b8a51e4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedDerivedTypedElementWidget.java
@@ -0,0 +1,276 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedDerivedTypedElementWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget {
+
+ public SynchronizedDerivedTypedElementWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet getContainer() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getContainer();
+ }
+ });
+ }
+
+ public final java.lang.String getElementName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getElementName();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>> pressParentButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>> safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().pressParentButton();
+ }
+ });
+ }
+
+ public final void setName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setName(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.ecore.EClassifier getEType() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.ecore.EClassifier>() {
+ @Override
+ public org.eclipse.emf.ecore.EClassifier safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getEType();
+ }
+ });
+ }
+
+ public final java.lang.String getElementTypeName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getElementTypeName();
+ }
+ });
+ }
+
+ public final int getLowerBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getLowerBound());
+ }
+ }).intValue();
+ }
+
+ public final int getUpperBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getUpperBound());
+ }
+ }).intValue();
+ }
+
+ public final boolean isOrdered() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().isOrdered());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isUnique() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().isUnique());
+ }
+ }).booleanValue();
+ }
+
+ public final org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> pressTypeButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier>>() {
+ @Override
+ public org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().pressTypeButton();
+ }
+ });
+ }
+
+ public final void setEType(final org.eclipse.emf.ecore.EClassifier parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setEType(parm0);
+ }
+ });
+ }
+
+ public final void setLowerBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setLowerBound(parm0);
+ }
+ });
+ }
+
+ public final void setOrdered(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setOrdered(parm0);
+ }
+ });
+ }
+
+ public final void setUnique(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setUnique(parm0);
+ }
+ });
+ }
+
+ public final void setUpperBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setUpperBound(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query getQuery() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getQuery();
+ }
+ });
+ }
+
+ public final java.lang.String getQueryText() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().getQueryText();
+ }
+ });
+ }
+
+ public final boolean isQueryEnable() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().isQueryEnable());
+ }
+ }).booleanValue();
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget> selectQueryType(final java.lang.String parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget> safeRun() {
+ return SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().selectQueryType(parm0);
+ }
+ });
+ }
+
+ public final void setQuery(final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedDerivedTypedElementWidget.this.getSynchronizedObject().setQuery(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedENamedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedENamedElementWidget.java
new file mode 100644
index 00000000000..af6cfaea0d1
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedENamedElementWidget.java
@@ -0,0 +1,123 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedENamedElementWidget <C extends org.eclipse.emf.ecore.EObject, CW extends java.lang.Object> extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget <C, CW>> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget <C, CW> {
+
+ public SynchronizedENamedElementWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget <C, CW> object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedENamedElementWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedENamedElementWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedENamedElementWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedENamedElementWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final C getContainer() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<C>() {
+ @Override
+ public C safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().getContainer();
+ }
+ });
+ }
+
+ public final java.lang.String getElementName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().getElementName();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW> pressParentButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW> safeRun() {
+ return SynchronizedENamedElementWidget.this.getSynchronizedObject().pressParentButton();
+ }
+ });
+ }
+
+ public final void setName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedENamedElementWidget.this.getSynchronizedObject().setName(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedEStructuralFeatureWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedEStructuralFeatureWidget.java
new file mode 100644
index 00000000000..c624d1db102
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedEStructuralFeatureWidget.java
@@ -0,0 +1,348 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedEStructuralFeatureWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget {
+
+ public SynchronizedEStructuralFeatureWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet getContainer() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getContainer();
+ }
+ });
+ }
+
+ public final java.lang.String getElementName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getElementName();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>> pressParentButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget>> safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().pressParentButton();
+ }
+ });
+ }
+
+ public final void setName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setName(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.ecore.EClassifier getEType() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.ecore.EClassifier>() {
+ @Override
+ public org.eclipse.emf.ecore.EClassifier safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getEType();
+ }
+ });
+ }
+
+ public final java.lang.String getElementTypeName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getElementTypeName();
+ }
+ });
+ }
+
+ public final int getLowerBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getLowerBound());
+ }
+ }).intValue();
+ }
+
+ public final int getUpperBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getUpperBound());
+ }
+ }).intValue();
+ }
+
+ public final boolean isOrdered() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isOrdered());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isUnique() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isUnique());
+ }
+ }).booleanValue();
+ }
+
+ public final org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> pressTypeButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier>>() {
+ @Override
+ public org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().pressTypeButton();
+ }
+ });
+ }
+
+ public final void setEType(final org.eclipse.emf.ecore.EClassifier parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setEType(parm0);
+ }
+ });
+ }
+
+ public final void setLowerBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setLowerBound(parm0);
+ }
+ });
+ }
+
+ public final void setOrdered(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setOrdered(parm0);
+ }
+ });
+ }
+
+ public final void setUnique(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setUnique(parm0);
+ }
+ });
+ }
+
+ public final void setUpperBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setUpperBound(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query getQuery() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getQuery();
+ }
+ });
+ }
+
+ public final java.lang.String getQueryText() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().getQueryText();
+ }
+ });
+ }
+
+ public final boolean isQueryEnable() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isQueryEnable());
+ }
+ }).booleanValue();
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget> selectQueryType(final java.lang.String parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget> safeRun() {
+ return SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().selectQueryType(parm0);
+ }
+ });
+ }
+
+ public final void setQuery(final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setQuery(parm0);
+ }
+ });
+ }
+
+ public final boolean isChangeable() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isChangeable());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isDerived() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isDerived());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isTransient() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isTransient());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isVolatile() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().isVolatile());
+ }
+ }).booleanValue();
+ }
+
+ public final void setChangeable(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setChangeable(parm0);
+ }
+ });
+ }
+
+ public final void setDerived(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setDerived(parm0);
+ }
+ });
+ }
+
+ public final void setTransient(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setTransient(parm0);
+ }
+ });
+ }
+
+ public final void setVolatile(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedEStructuralFeatureWidget.this.getSynchronizedObject().setVolatile(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedETypedElementWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedETypedElementWidget.java
new file mode 100644
index 00000000000..f2dc0d86201
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedETypedElementWidget.java
@@ -0,0 +1,231 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedETypedElementWidget <C extends org.eclipse.emf.ecore.EObject, CW extends java.lang.Object> extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget <C, CW>> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget <C, CW> {
+
+ public SynchronizedETypedElementWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget <C, CW> object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final C getContainer() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<C>() {
+ @Override
+ public C safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getContainer();
+ }
+ });
+ }
+
+ public final java.lang.String getElementName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getElementName();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW> pressParentButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<CW> safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().pressParentButton();
+ }
+ });
+ }
+
+ public final void setName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setName(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.ecore.EClassifier getEType() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.ecore.EClassifier>() {
+ @Override
+ public org.eclipse.emf.ecore.EClassifier safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getEType();
+ }
+ });
+ }
+
+ public final java.lang.String getElementTypeName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().getElementTypeName();
+ }
+ });
+ }
+
+ public final int getLowerBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedETypedElementWidget.this.getSynchronizedObject().getLowerBound());
+ }
+ }).intValue();
+ }
+
+ public final int getUpperBound() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Integer>() {
+ @Override
+ public Integer safeRun() {
+ return Integer.valueOf(SynchronizedETypedElementWidget.this.getSynchronizedObject().getUpperBound());
+ }
+ }).intValue();
+ }
+
+ public final boolean isOrdered() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedETypedElementWidget.this.getSynchronizedObject().isOrdered());
+ }
+ }).booleanValue();
+ }
+
+ public final boolean isUnique() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<Boolean>() {
+ @Override
+ public Boolean safeRun() {
+ return Boolean.valueOf(SynchronizedETypedElementWidget.this.getSynchronizedObject().isUnique());
+ }
+ }).booleanValue();
+ }
+
+ public final org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> pressTypeButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier>>() {
+ @Override
+ public org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClassifier> safeRun() {
+ return SynchronizedETypedElementWidget.this.getSynchronizedObject().pressTypeButton();
+ }
+ });
+ }
+
+ public final void setEType(final org.eclipse.emf.ecore.EClassifier parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setEType(parm0);
+ }
+ });
+ }
+
+ public final void setLowerBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setLowerBound(parm0);
+ }
+ });
+ }
+
+ public final void setOrdered(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setOrdered(parm0);
+ }
+ });
+ }
+
+ public final void setUnique(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setUnique(parm0);
+ }
+ });
+ }
+
+ public final void setUpperBound(final int parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedETypedElementWidget.this.getSynchronizedObject().setUpperBound(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedFacetWidget.java
new file mode 100644
index 00000000000..5101522977d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedFacetWidget.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedFacetWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget {
+
+ public SynchronizedFacetWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet getContainer() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getContainer();
+ }
+ });
+ }
+
+ public final java.lang.String getElementName() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getElementName();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget> pressParentButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget> safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().pressParentButton();
+ }
+ });
+ }
+
+ public final void setName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().setName(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget getGetExtendedMetaclassWidget() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getGetExtendedMetaclassWidget();
+ }
+ });
+ }
+
+ public final java.lang.String getSubTypingFacet() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().getSubTypingFacet();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.ecore.ETypedElement, java.lang.Object>> pressSubTypingButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.ecore.ETypedElement, java.lang.Object>>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<org.eclipse.emf.ecore.ETypedElement, java.lang.Object>> safeRun() {
+ return SynchronizedFacetWidget.this.getSynchronizedObject().pressSubTypingButton();
+ }
+ });
+ }
+
+ public final void setSubTypingFacetSelection(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetWidget.this.getSynchronizedObject().setSubTypingFacetSelection(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetExtendedMetaclassWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetExtendedMetaclassWidget.java
new file mode 100644
index 00000000000..5087a1ed51f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetExtendedMetaclassWidget.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedGetExtendedMetaclassWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget {
+
+ public SynchronizedGetExtendedMetaclassWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final java.lang.String getText() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().getText();
+ }
+ });
+ }
+
+ public final void setText(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().setText(parm0);
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClass> pressButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClass>>() {
+ @Override
+ public org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard<org.eclipse.emf.ecore.EClass> safeRun() {
+ return SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().pressButton();
+ }
+ });
+ }
+
+ public final void setButtonEnabled(final boolean parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetExtendedMetaclassWidget.this.getSynchronizedObject().setButtonEnabled(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredElementCommmandWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredElementCommmandWidget.java
new file mode 100644
index 00000000000..cae545a96b9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredElementCommmandWidget.java
@@ -0,0 +1,143 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+
+public class SynchronizedGetOrCreateFilteredElementCommmandWidget<T extends java.lang.Object, W extends java.lang.Object>
+ extends
+ SynchronizedObject<org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<T, W>>
+ implements
+ org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<T, W> {
+
+ public SynchronizedGetOrCreateFilteredElementCommmandWidget(
+ final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget<T, W> object,
+ final Display display) {
+ super(object, display);
+ }
+
+ public final void addListener(
+ final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final T getElementSelected() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<T>() {
+ @Override
+ public T safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().getElementSelected();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<W> pressNewButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<W>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<W> safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().pressNewButton();
+ }
+ });
+ }
+
+ public final void selectElement(final T parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().selectElement(parm0);
+ }
+ });
+ }
+
+ public final void selectElementByName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().selectElementByName(parm0);
+ }
+ });
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredFacetSetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredFacetSetWidget.java
new file mode 100644
index 00000000000..1f3d30d2ae1
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredFacetSetWidget.java
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.SynchronizedObject;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+
+@SuppressWarnings("PMD.ExcessivePublicCount")
+public class SynchronizedGetOrCreateFilteredFacetSetWidget extends SynchronizedObject<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget> implements org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget {
+
+ public SynchronizedGetOrCreateFilteredFacetSetWidget(final org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget object, final Display display) {
+ super(object, display);
+ }
+ public final void addListener(final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().addListener(parm0);
+ }
+ });
+ }
+
+ public final void createWidgetContent() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().createWidgetContent();
+ }
+ });
+ }
+
+ public final java.lang.String getError() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.String>() {
+ @Override
+ public java.lang.String safeRun() {
+ return SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().getError();
+ }
+ });
+ }
+
+ public final void notifyChanged() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().notifyChanged();
+ }
+ });
+ }
+
+ public final <A> A adapt(final java.lang.Class<A> parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<A>() {
+ @Override
+ public A safeRun() {
+ return SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<java.lang.Object>() {
+ @Override
+ public java.lang.Object safeRun() {
+ return SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().getCommand();
+ }
+ });
+ }
+
+ public final void onDialogValidation() {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().onDialogValidation();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet getElementSelected() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet>() {
+ @Override
+ public org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet safeRun() {
+ return SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().getElementSelected();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget>> pressNewButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable<org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget>>>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog<org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget<org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet, org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget>> safeRun() {
+ return SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().pressNewButton();
+ }
+ });
+ }
+
+ public final void selectElement(final org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().selectElement(parm0);
+ }
+ });
+ }
+
+ public final void selectElementByName(final java.lang.String parm0) {
+ voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedGetOrCreateFilteredFacetSetWidget.this.getSynchronizedObject().selectElementByName(parm0);
+ }
+ });
+ }
+
+}
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
new file mode 100644
index 00000000000..bdf7c575d17
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..346deb79f5b
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..0225c66043a
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetOrCreateOperationDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..03cdd5dd2d3
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget;
+import org.eclipse.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() {
+ // TODO Auto-generated method stub
+ 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
new file mode 100644
index 00000000000..9715e65b3da
--- /dev/null
+++ 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
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.widget.component.metaclass.AbstractGetMetaclassWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..9de5c89ced1
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.composite.GetSubTypingTypeDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithDialogButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..2128193cecf
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.AbstractWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.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
new file mode 100644
index 00000000000..8ec339ecc07
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..a15a76de594
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..c2a7044a9d9
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..0ab8f72e7b4
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..4773c6805cb
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..7fd277065d7
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..995a385c9f6
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..cc0e4854871
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.bounds.AbstractGetBoundsWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..45babd46801
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..5fcc980a4a8
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..9cf541570a4
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..950c56810a7
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.query;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryDialogFactoryStrategy;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.query.AbstractQueryDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..abe4768988c
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.query;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..5b307dbb47c
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.widget.component.query;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.AbstractGetPropertyWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..0ee8637e977
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.core.FacetUtils;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.query.ICreateQueryWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.query.SelectQueryTypeWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetWidget;
+import org.eclipse.emf.facet.util.emf.core.ModelUtils;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..4acdc4dda25
--- /dev/null
+++ 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
@@ -0,0 +1,125 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation;
+
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactory;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactoryFactory;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.widget.getorcreate.IAbstractGetOrCreateElementWithButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..13025db0ca6
--- /dev/null
+++ 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
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.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.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IEStructuralFeatureWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetChangeableWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetDerivedWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetTransientWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetVolatileWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..6bd9f991684
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.sdk.ui.internal.exported.widget.IETypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetElementTypeWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetOrderedWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.GetUniqueWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetLowerBoundWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.bounds.GetUpperBoundWidget;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.wizard.ISelectETypeWizard;
+import org.eclipse.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
new file mode 100644
index 00000000000..5eca682fbd6
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..e01e5cac9f9
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateOperationWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetOperationNameWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithButtonWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..2ee5926fb06
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.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
new file mode 100644
index 00000000000..677792fb845
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.core.FacetUtils;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetSetInFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IENamedElementWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..65468c52701
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.core.FacetUtils;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.CreateFacetInFacetSetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..0069f3544f6
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.core.FacetUtils;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.dialog.creation.AddOperationInFacetDialog;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IDerivedTypedElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..1a14e08b291
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetAttributeNameWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..b469c8d53bc
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AddParameterInOperationWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..c4cf8e6152d
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AddOperationInFacetWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..3ca2df9481b
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.properties.name.GetReferenceNameWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractEStructuralFeatureWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.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
new file mode 100644
index 00000000000..cfba8816359
--- /dev/null
+++ 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
@@ -0,0 +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.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.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.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
new file mode 100644
index 00000000000..da8276d5b38
--- /dev/null
+++ 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
@@ -0,0 +1,168 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.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.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.IFacetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.getorcreate.IGetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.component.metaclass.IGetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.widget.creation.IGetOrCreateFilteredFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.sync.generated.SynchronizedGetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.getorcreate.GetOrCreateFacetSetWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.GetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.component.metaclass.SelectSubTypingTypeWidget;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.widget.creation.AbstractENamedElementWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.properties.name.AbstractGetElementNameWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.widget.IAbstractWidget;
+import org.eclipse.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.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.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
new file mode 100644
index 00000000000..65ecfefb22c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java
@@ -0,0 +1,240 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.facet.efacet.core.IFacetActions;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.WorkbenchUtils;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedCreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
+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.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
new file mode 100644
index 00000000000..a45f6a4e574
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.wizard;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.IWizardFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.wizard.SynchronizedWizard;
+import org.eclipse.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
+import org.eclipse.jface.viewers.ISelection;
+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
new file mode 100644
index 00000000000..2871d22fade
--- /dev/null
+++ 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
@@ -0,0 +1,109 @@
+/**
+ * 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.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.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.util.core.Logger;
+//import org.eclipse.emf.facet.util.core.internal.exported.PluginUtils;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+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
new file mode 100644
index 00000000000..03a320e5b79
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+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
new file mode 100644
index 00000000000..814c074d29f
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.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
new file mode 100644
index 00000000000..76652db4bcc
--- /dev/null
+++ 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
@@ -0,0 +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.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.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);
+ }
+ });
+ }
+
+}

Back to the top