+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.classpath
new file mode 100644
index 00000000000..da1049abda9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.project
new file mode 100644
index 00000000000..e329e952c1d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.emf.facet.custom.sdk.ui
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..dafbb140e95
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,379 @@
+Manifest-Version: 1.0
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Built-By: hudsonbuild
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.sdk.ui;singleton:=true
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.emf.facet.widgets.celleditors;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.2.0",
+ org.eclipse.swt;bundle-version="3.6.0",
+ org.eclipse.emf.ecore;bundle-version="2.6.0",
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.util.core;bundle-version="0.2.0",
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.papyrus.emf.facet.custom.sdk.core;bundle-version="0.2.1",
+ org.eclipse.papyrus.emf.facet.util.emf.core;bundle-version="0.2.1",
+ org.eclipse.papyrus.emf.facet.util.ui;bundle-version="0.3.0",
+ org.eclipse.emf.facet.efacet.sdk.ui;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.efacet.ui;bundle-version="0.2.1",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.2.1",
+ org.eclipse.papyrus.emf.facet.util.emf.ui;bundle-version="0.3.0",
+ org.eclipse.emf.edit;bundle-version="2.6.0",
+ org.eclipse.ui.ide;bundle-version="3.6.0",
+ org.eclipse.core.expressions;bundle-version="3.4.200"
+Bundle-Activator: org.eclipse.emf.facet.custom.sdk.ui.internal.Activat
+ or
+Bundle-Version: 0.4.0.201308190853
+Build-Jdk: 1.6.0_27
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Name: %Bundle-Name
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Bundle-ManifestVersion: 2
+Export-Package: org.eclipse.emf.facet.custom.sdk.ui.dialog
+
+Name: META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk
+ .ui/pom.properties
+SHA1-Digest: 96E/uYHm8QwzJpH96NOc4UoxF4Y=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /composite/ImageComposite$2.class
+SHA1-Digest: +l/wxqSBJnv49KlEy7xeBdj4ayo=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/messages.properties
+SHA1-Digest: 0eDpJbTjo7IgoOpcCiLJJMMOd5w=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$10.class
+SHA1-Digest: /oCj5CcrQLrdsMYI59MAKwyjUTs=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/Sy
+ nchronizedCreateFacetCustomizationDialog.class
+SHA1-Digest: HwGWbdmeGSMXHAn2J6mhZCAfaEk=
+
+Name: icons/treeView.gif
+SHA1-Digest: J08i2rueFvxIsJ1Z9BgktWZSpEE=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget.class
+SHA1-Digest: IkOq12o4KlHBXypJYltlRzt1VCU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetOperationFacetWidget.class
+SHA1-Digest: UngYpYn3UPX43cn2d9tbYc6rsT0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCus
+ tomizationPropertyInEClassHandler.class
+SHA1-Digest: 3w+d2LpR8uPJtHEEV7x8q+DOSbM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/page/Cu
+ stomPropertyWizardPage$2.class
+SHA1-Digest: C85x6sbZR27Znl+f8ylVA93gVTA=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetCustomizedFacetWidget.class
+SHA1-Digest: hDSkmH/+bE1t4hvGHnnpOQSLVjc=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Create
+ FacetCustomizationHandler.class
+SHA1-Digest: aYXIH6FBR7G1J+vmvp0RHemaEMo=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/Startup.class
+SHA1-Digest: 7uVIrYLoA4w1HF9/vzqXs9FxA4M=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/Abstrac
+ tGetCustomizationDialog.class
+SHA1-Digest: UQ3tgwJ+cgZBDWdMYFEBW/CI+nM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCas
+ eQueryHandler.class
+SHA1-Digest: jMo7ic/AiwyRthwlzaatu37jTp8=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/Abstrac
+ tGetOrCreateCustomizationDialog.class
+SHA1-Digest: h51bYF7i8fZKwnPcswVJA4fpdps=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/wizard/page/ICreate
+ CustomizationWizardPage.class
+SHA1-Digest: /Cgt8XfYc2INZt/nUzNNp+FVd8E=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$2.class
+SHA1-Digest: qwiQoxr+s3OPsSI8vJvutw02kNY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command
+ /GetOrCreateCustomizationWidget.class
+SHA1-Digest: zvuYu1sF/did58y1MJyaIH2l1TA=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selecti
+ on/GetCustomizedFacetDialog.class
+SHA1-Digest: Kq5I7fRZomW+0OHNFCrCHuLg2AM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command
+ /QueryContext.class
+SHA1-Digest: 9baC5HUaH3N3a+aS4Oq6ge0ScOM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$4.class
+SHA1-Digest: k+NMbNkyFGG+InEUV3tK+s/bgeY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/dialog/Customizatio
+ nDialogFactory$1.class
+SHA1-Digest: QysGrXIUDop28MG5/IU2eQ3XAUY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/propert
+ y/name/GetCaseQueryTypeWidget.class
+SHA1-Digest: zu4yC41Dhw7xu0E2HFl7OEgDST0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$6.class
+SHA1-Digest: 9ZGIJeANIoMf64TFdiq8KAw+ZQM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/CreateC
+ ustimizationWizardImpl.class
+SHA1-Digest: jicaCoQG2xqg0vV8nEBfSNnuWsY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$8.class
+SHA1-Digest: 9vobku/pQqXgYc7RQiGjDooYvO4=
+
+Name: META-INF/eclipse.inf
+SHA1-Digest: 09gN05tobgS/MdtqyTNQhOhB73M=
+
+Name: icons/querySet.gif
+SHA1-Digest: Ypcn7ddJ56HdPpJYqBYET9A8l1Q=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selecti
+ on/GetExtendedFacetDialog.class
+SHA1-Digest: NKIPx26XZh+iIbDTOnYGkaV57SI=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command
+ /AddCustomizationPropertyDialog.class
+SHA1-Digest: JcH80agQQOKqhaTApM/376E3yU0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command
+ /AddCustomizationPropertyWidget.class
+SHA1-Digest: 7sH3jb49E3pQe4VSSTVOCYqufuM=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /composite/ImageCompositeFactory.class
+SHA1-Digest: 7LRlMZHl1v02W/qBmQYLhPfmI1A=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/CreateC
+ ustimizationWizardImpl$1.class
+SHA1-Digest: 6jxu718ASPssVEmyJ7F/ANH4L60=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetFiltredCustomizedFacetWidget.class
+SHA1-Digest: vgMM4Qkjj+JogLP7i9vQwViH5LE=
+
+Name: icons/FacetAttribute.gif
+SHA1-Digest: iJVUkNzDcR93MimauSwnnNlqlzw=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/Activator.class
+SHA1-Digest: jZRKBVH5PnNYfxyjxJ1fplE2J1o=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/getorcr
+ eate/GetOrCreateCustomizationDialog.class
+SHA1-Digest: xn0NDTp3iZDHdEZnQyBUWt6DqYU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetOrCreateCustomizationWidget.class
+SHA1-Digest: PtoY+sa6i1esFGwm7WwW1IwDx9c=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetFiltredOperationFacetWidget.class
+SHA1-Digest: gvhVB5Om6pIuoKVLHgMe6dgaoVo=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/Sy
+ nchronizedCreateEClassCustomizationDialog.class
+SHA1-Digest: nN2z3oC9aRlok+NvVWxTjpz8j30=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /composite/ImageComposite.class
+SHA1-Digest: JP4tlD/yAj40lHjY6CeACuW0A1c=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/Sy
+ nchronizedAddCustomizationPropertyDialog.class
+SHA1-Digest: xKgnZ8G00kQatBgBIuWmpi0TlxA=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/page/Cr
+ eateCustomizationWizardPage.class
+SHA1-Digest: CHtofczIDGjts89SpVZTyScfqP0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command
+ /CreateEClassCustomizationWidget.class
+SHA1-Digest: pXvx+O9Kqxcoy7OqKgW7Vl5TMP8=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/Messages.class
+SHA1-Digest: bZidPO4d7Z0DTYG6auRXqnmsbQk=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /composite/ImageComposite$1.class
+SHA1-Digest: sXtK3X90+UUwYXZ8QjFSg3OJRxY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/page/Cu
+ stomPropertyWizardPage.class
+SHA1-Digest: PFKQ3SDeT2ZegrbeP0r3pfV7UnI=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /composite/ImageComposite$3.class
+SHA1-Digest: US4JQlC83UyPrbRUs9kAiCU2xYU=
+
+Name: META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk
+ .ui/pom.xml
+SHA1-Digest: Os/QnVt3ICG82YcUwUsYEBhTh1I=
+
+Name: OSGI-INF/l10n/bundle.properties
+SHA1-Digest: IdWwkz9OBwHz8QRbCFAdiyA+zrc=
+
+Name: icons/full/wizban/NewCustom.gif
+SHA1-Digest: CfAK4I3/f4RWRH687PmoPhy5xjI=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command
+ /CreateEClassCustomizationDialog.class
+SHA1-Digest: ZPgTCVlK+sMINGfkwmLVl6mvbo4=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$11.class
+SHA1-Digest: wNJpU+maXUW73HPYBwFzt19Vp6U=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selecti
+ on/GetFacetOperationDialog.class
+SHA1-Digest: cvLE8ybTMcU/nimv2TqRvixnHnQ=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCus
+ tomizationPropertyInFacetHandler.class
+SHA1-Digest: 0D2rBsllbaqIC3OPn4+fiygf7MU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/dialog/Customizatio
+ nDialogFactory.class
+SHA1-Digest: /GCocBSTAKIPjCWmWXRD2UzttFw=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/page/Cu
+ stomPropertyWizardPage$1.class
+SHA1-Digest: SMDhaPm/p77Lg5CCWiJVOkbYxxo=
+
+Name: icons/ParameterValue.gif
+SHA1-Digest: k6QiLCZYrVmMJ6A2ZM7y663F7w0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/Abstrac
+ tCustomizationMainDialog.class
+SHA1-Digest: 0eB1NbSk8zl9UgdvFBfTaLJdMAo=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command
+ /AddCaseQueryDialog.class
+SHA1-Digest: qXUcdnQnr+FqUVvAERur1MuwDsY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command
+ /AddCaseQueryWidget.class
+SHA1-Digest: 8jh4HDb736X2s1igjgaY79aliXk=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Utils.
+ class
+SHA1-Digest: qZkE2nctlQ8yMmCEJcAV3GkbAxg=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/AbstractGetFacetWidget.class
+SHA1-Digest: +KhMbHCsj7fXAnBNIBKET9eyZTM=
+
+Name: icons/facet.gif
+SHA1-Digest: XEEa0LVNEosBP0izGtitfq02WAI=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/metacla
+ ss/GetExtendedMetaclassWidget.class
+SHA1-Digest: c3rIsmNHEfgkMbAG9acd8PkesWU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/widgets/celleditors
+ /ImageCellEditor.class
+SHA1-Digest: z1mioOF/nWLjqTMi90ij2W6q0AU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$1.class
+SHA1-Digest: xrcOkv0LDkdagbv6FCkGa44EVmE=
+
+Name: plugin.xml
+SHA1-Digest: EOhq9rAmJ6XKc21SJKFVXdIsJqE=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetExtendedFacetWidget.class
+SHA1-Digest: MNEOrpJDF4V65WLHj7YLkoewY64=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$3.class
+SHA1-Digest: okZsR4FZ9dcyoteCwtuxVD8kReA=
+
+Name: icons/FacetReference.gif
+SHA1-Digest: QMWLPiWsn1Q3mCC6dVej6KW6aes=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$5.class
+SHA1-Digest: XUXasN1BS4WqChIoR2Ee4MV63dU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$7.class
+SHA1-Digest: E1pi+U63KBVMV1RQuokltKm/TAc=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGe
+ tOrCreateFilteredElementCommmandWidget$9.class
+SHA1-Digest: NhNosZy/WhBsr+fDFNGX36e1llo=
+
+Name: icons/flatView.gif
+SHA1-Digest: m7CoejyO/BwL1K8nsf+3iF2nYsg=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/Sy
+ nchronizedAddCaseQueryDialog.class
+SHA1-Digest: objP1JIjz9Au1C7W1oDUFEsAZ4c=
+
+Name: about.html
+SHA1-Digest: ucbJ2JQyMW17Zy+4pyWJhaS7Sws=
+
+Name: icons/full/obj16/CustomModelFile.gif
+SHA1-Digest: zjQCllhiXDEnFg6c6wdc1isUBw8=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/wizard/page/ICustom
+ izationPropertyWizardPage.class
+SHA1-Digest: qmcNaNWnh5Io4PMp7w+fhk7V4H8=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/wizard/CreateC
+ ustimizationWizardImpl$2.class
+SHA1-Digest: jQM8FncXiY19lm770N4c3AcerIw=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/propert
+ y/name/GetCaseQueryNameWidget.class
+SHA1-Digest: eNl1wzPNKqjPmevAd6r9vQL+S/Q=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Create
+ EClassCustomizationHandler.class
+SHA1-Digest: HgkLeq4tFQaY0mMYLQuJgH4RBio=
+
+Name: icons/FacetSet.gif
+SHA1-Digest: ZNjHVhFyhjicmeiWt004wpwJdNU=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command
+ /CreateFacetCustomizationDialog.class
+SHA1-Digest: VGS+PUhptUnp2uc2JfqmyxMJLOY=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command
+ /CreateFacetCustomizationWidget.class
+SHA1-Digest: CwSI8mpzKA4zk7BJ5LfSHX22+W0=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcr
+ eate/GetFiltredExtendedFacetWidget.class
+SHA1-Digest: 3qWTYaSbElVgYoco1tKdZvK4Bf8=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/propert
+ y/name/GetEClassCustomizationNameWidget.class
+SHA1-Digest: KjK421M4uOrnWsRzUAjk2FVPqxQ=
+
+Name: icons/FacetOperation.gif
+SHA1-Digest: geCi1ofnq5obJShghQN1sk0ACoI=
+
+Name: org.eclipse.emf.facet.custom.sdk.ui.modelcelleditors
+SHA1-Digest: mOF8luq4olJe/WCRqBrtQY1AjWo=
+
+Name: org/eclipse/emf/facet/custom/sdk/ui/dialog/ICustomizationDialogF
+ actory.class
+SHA1-Digest: moRiQJ3BDVJYJYHxlTIkFTbZymQ=
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/eclipse.inf b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/eclipse.inf
new file mode 100644
index 00000000000..92ffed2421c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/eclipse.inf
@@ -0,0 +1,2 @@
+#Processed using Jarprocessor
+pack200.conditioned = true
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.properties
new file mode 100644
index 00000000000..13321a40eb7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon Aug 19 04:56:53 EDT 2013
+version=0.4.0-SNAPSHOT
+groupId=org.eclipse.emft
+artifactId=org.eclipse.emf.facet.custom.sdk.ui
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.xml
new file mode 100644
index 00000000000..364e008ce56
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/META-INF/maven/org.eclipse.emft/org.eclipse.emf.facet.custom.sdk.ui/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+
+ org.eclipse.emf.facet.build
+ org.eclipse.emft
+ 0.4.0
+ ../../
+
+ org.eclipse.emft
+ org.eclipse.emf.facet.custom.sdk.ui
+ 0.4.0-SNAPSHOT
+ eclipse-plugin
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..71af665ad77
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,37 @@
+###############################################################################
+# 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:
+# Nicolas Bros (Mia-Software) - Bug 375388 - Cell editor for IImage
+# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+###############################################################################
+#Properties file for org.eclipse.emf.facet.custom.sdk.ui
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet Custom SDK UI (Incubation)
+
+wizard.name = Create a Customization 0.2
+wizard.description = Create a new Customization model
+
+menu.custo.label = EMF Customization Commands
+command.custo.name=Create EClass Customization
+command.custo.name.1=Create Facet Customization
+command.custo.name.2=Add a Customization Property
+command.custo.name.3=Add a Query
+
+menu.label = EMF Facet Commands
+command.name = Create FacetSet in a FacetSet
+command.name.0 = Create Facet in a FacetSet
+command.name.1 = Add Facet Attribute
+command.name.2 = Add Facet Operation
+command.name.3 = Add Parameter to Facet Operation
+command.name.4 = Add Facet Reference
+command.name.5 = Edit FacetSet
+command.name.6 = Edit Facet
+command.name.7 = Edit Facet Attribute
+command.name.8 = Edit Facet Operation
+command.name.9 = Edit Facet Operation Parameter
+command.name.10 = Edit Facet Reference
\ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/about.html
new file mode 100644
index 00000000000..3019b95b9cf
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+About This Content
+
+December 22, 2008
+License
+
+The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at http://www.eclipse.org/legal/epl-v10.html .
+For purposes of the EPL, "Program" will mean the Content.
+
+If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org .
+
+
+
\ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/build.properties
new file mode 100644
index 00000000000..409a846ccc5
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+bin.includes = META-INF/,\
+ .,\
+ org.eclipse.emf.facet.custom.sdk.ui.modelcelleditors,\
+ icons/,\
+ about.html,\
+ plugin.xml,\
+ OSGI-INF/
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetAttribute.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetAttribute.gif
new file mode 100644
index 00000000000..78d42474957
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetAttribute.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetOperation.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetOperation.gif
new file mode 100644
index 00000000000..b3643da048a
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetOperation.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetReference.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetReference.gif
new file mode 100644
index 00000000000..0c9154c7997
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetReference.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetSet.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetSet.gif
new file mode 100644
index 00000000000..d8a3e957c58
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/FacetSet.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/ParameterValue.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/ParameterValue.gif
new file mode 100644
index 00000000000..2b692560297
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/ParameterValue.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/facet.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/facet.gif
new file mode 100644
index 00000000000..8c67c03cc10
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/facet.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/flatView.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/flatView.gif
new file mode 100644
index 00000000000..1ef74cf98f4
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/flatView.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/obj16/CustomModelFile.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/obj16/CustomModelFile.gif
new file mode 100644
index 00000000000..8a7eeb2c824
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/obj16/CustomModelFile.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/wizban/NewCustom.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/wizban/NewCustom.gif
new file mode 100644
index 00000000000..eab53a99e8c
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/full/wizban/NewCustom.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/querySet.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/querySet.gif
new file mode 100644
index 00000000000..07d18c55b7f
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/querySet.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/treeView.gif b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/treeView.gif
new file mode 100644
index 00000000000..234486172ca
Binary files /dev/null and b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/icons/treeView.gif differ
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/org.eclipse.emf.facet.custom.sdk.ui.modelcelleditors b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/org.eclipse.emf.facet.custom.sdk.ui.modelcelleditors
new file mode 100644
index 00000000000..d5bb2ed5a38
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/org.eclipse.emf.facet.custom.sdk.ui.modelcelleditors
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml
new file mode 100644
index 00000000000..aae098cee8d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %wizard.description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/dialog/ICustomizationDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/dialog/ICustomizationDialogFactory.java
new file mode 100644
index 00000000000..e5238c9efea
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/dialog/ICustomizationDialogFactory.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
+ * Gregoire Dupe (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.dialog;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.dialog.CustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Interface for the dialogs creation factory.
+ *
+ * @see CustomizationDialogFactorImpl
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface ICustomizationDialogFactory {
+
+ ICustomizationDialogFactory DEFAULT = new CustomizationDialogFactory();
+
+ /**
+ * Create an new Dialog for the creation of a EClass Customization.
+ *
+ * @param editingDomain
+ */
+ IDialog openCreateEClassCustomizationDialog(Display display,
+ EditingDomain editingDomain);
+
+ /**
+ * Create an new Dialog for the creation of a Facet Customization.
+ *
+ * @return the dialog.
+ */
+ IDialog openCreateFacetCustomizationDialog(Display display,
+ EditingDomain editingDomain);
+
+ /**
+ * Create an new Dialog for the creation of a Customization Operation into a
+ * Customization.
+ *
+ * @return the dialog.
+ */
+ IDialog openAddCustomizationPropertyDialog(Display display,
+ EditingDomain editingDomain);
+
+ /**
+ * Create an new Dialog for the creation of a Query into a Case.
+ *
+ * @return the dialog.
+ */
+ IDialog openAddCaseQueryDialog(Display display, EditingDomain editingDomain);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Activator.java
new file mode 100644
index 00000000000..2bc1e3a305d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/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:
+ * Nicolas Bros (Mia-Software) - Bug 375388 - Cell editor for IImage
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ *******************************************************************************/
+package org.eclipse.emf.facet.custom.sdk.ui.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+@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.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Messages.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Messages.java
new file mode 100644
index 00000000000..c0c69168c5b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Messages.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * 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:
+ * Nicolas Bros (Mia-Software) - Bug 375388 - Cell editor for IImage
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ *******************************************************************************/
+package org.eclipse.emf.facet.custom.sdk.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.emf.facet.custom.sdk.ui.internal.messages"; //$NON-NLS-1$
+ public static String ImageComposite_fullImage;
+ public static String Create_Customization_Model;
+ public static String CreateCustomizationWizardImpl_customization;
+ public static String CreateCustomizationWizardImpl_customization_properties;
+ public static String CreateCustomizationWizardImpl_Create_new_customization;
+ public static String CreateCustomizationWizardImpl_File_extension_restriction;
+ public static String CreateCustomizationWizardPage_Not_a_Plugin_project;
+
+ public static String Enter_a_nsUri;
+ public static String Enter_a_prefix;
+ public static String Please_enter_nsUri;
+ public static String Please_enter_prefix;
+ public static String Please_select_EPackage;
+
+ public static String CreateEClassCustomizationDialog_Message;
+ public static String CreateEClassCustomizationDialog_Title;
+
+ public static String CreateFacetCustomizationDialog_Message;
+ public static String CreateFacetCustomizationDialog_Title;
+
+ public static String ExtendedMetaClass;
+ public static String Metaclass_mustSelectMetaclass;
+
+ public static String Customization;
+ public static String Customization_mustSelectCustomization;
+ public static String Customization_mustGiveCustomizationName;
+
+ public static String GetOrCreate_customization_message;
+ public static String Select_Customization;
+
+ public static String Facet_mustSelectFacet;
+ public static String ExtendedFacet;
+ public static String CustomizedFacet;
+ public static String CustomizedFacet_mustSelectCustomizedFacet;
+
+ public static String OperationFacet;
+ public static String OperationFacet_mustSelectOperationFacet;
+
+ public static String Add_Customization_title;
+ public static String Add_Customization_message;
+
+ public static String Query_case_name;
+ public static String Query_case_type;
+
+ public static String Get_customization_property_message;
+ public static String Select_Customization_property;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Startup.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/Startup.java
new file mode 100644
index 00000000000..ba68f279d71
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/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:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ *******************************************************************************/
+package org.eclipse.emf.facet.custom.sdk.ui.internal;
+import org.eclipse.ui.IStartup;
+
+
+public class Startup implements IStartup {
+
+ public void earlyStartup() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/dialog/CustomizationDialogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/dialog/CustomizationDialogFactory.java
new file mode 100644
index 00000000000..ec045f2cd45
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/dialog/CustomizationDialogFactory.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.custom.sdk.ui.internal.dialog;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command.AddCaseQueryDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command.AddCustomizationPropertyDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command.CreateEClassCustomizationDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command.CreateFacetCustomizationDialog;
+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.ICommandWidget;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Concrete implementation of {@link ICustomizationDialogFactory}.
+ *
+ * @see ICustomizationDialogFactory
+ */
+public class CustomizationDialogFactory implements ICustomizationDialogFactory {
+
+ protected static void openDialog(final IDialog> dialog,
+ final Display display) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ dialog.open();
+ }
+ });
+ }
+
+ public IDialog openCreateEClassCustomizationDialog(
+ final Display display,
+ final EditingDomain editingDomain) {
+ final IDialog dialog = new CreateEClassCustomizationDialog(
+ (Customization) HandlerUtils.getSelection(), editingDomain);
+ openDialog(dialog, display);
+ return new SynchronizedAbstractDialog(dialog, display);
+ }
+
+ public IDialog openCreateFacetCustomizationDialog(
+ final Display display,
+ final EditingDomain editingDomain) {
+ final IDialog dialog = new CreateFacetCustomizationDialog(
+ (Customization) HandlerUtils.getSelection(), editingDomain);
+ openDialog(dialog, display);
+ return new SynchronizedAbstractDialog(dialog, display);
+ }
+
+ public IDialog openAddCustomizationPropertyDialog(
+ final Display display,
+ final EditingDomain editingDomain) {
+ final IDialog dialog = new AddCustomizationPropertyDialog(
+ (EClassCustomization) HandlerUtils.getSelection(),
+ editingDomain);
+ openDialog(dialog, display);
+ return new SynchronizedAbstractDialog(dialog, display);
+ }
+
+ public IDialog openAddCaseQueryDialog(
+ final Display display,
+ final EditingDomain editingDomain) {
+ final IDialog dialog = new AddCaseQueryDialog(
+ (ETypedElementCase) HandlerUtils.getSelection(), editingDomain);
+ openDialog(dialog, display);
+ return new SynchronizedAbstractDialog(dialog, display);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/messages.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/messages.properties
new file mode 100644
index 00000000000..7dc535d839c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/messages.properties
@@ -0,0 +1,57 @@
+###############################################################################
+# 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:
+# Nicolas Bros (Mia-Software) - Bug 375388 - Cell editor for IImage
+# Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+# Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+###############################################################################
+ImageComposite_fullImage=Full Image
+Create_Customization_Model=Create a customization model
+CreateCustomizationWizardImpl_customization=New Customization
+CreateCustomizationWizardImpl_Create_new_customization=Create a new Customization
+CreateCustomizationWizardImpl_customization_properties=Set the Customization properties
+CreateCustomizationWizardImpl_File_extension_restriction=File extension has to be ".custom"
+CreateCustomizationWizardPage_Not_a_Plugin_project=Warning : you are creating this Customization in a non-Plugin project. It will not be available until moved to a Plugin project.
+
+Enter_a_nsUri=Enter a nsUri :
+Please_enter_nsUri=Please enter a nsUri
+Enter_a_prefix=Enter a prefix :
+Please_enter_prefix=Please enter a prefix
+Please_select_EPackage=Please, select an EPackage
+
+CreateEClassCustomizationDialog_Message=Create a new EClass Customization
+CreateEClassCustomizationDialog_Title=EClass Customization
+
+CreateFacetCustomizationDialog_Message=Create a new Facet Customization
+CreateFacetCustomizationDialog_Title=Facet Customization
+
+Metaclass_mustSelectMetaclass=You must select a MetaClass
+ExtendedMetaClass=&Extended Meta-Class:
+
+Facet_mustSelectFacet=You must select an Extended Facet
+ExtendedFacet=Extended Facet
+
+Customization=Customization
+Customization_mustSelectCustomization=You must select a Customization
+Customization_mustGiveCustomizationName=You must give a Customization Name
+
+GetOrCreate_customization_message=Select or a Customization
+Select_Customization=Select a Customization
+CustomizedFacet=Customized Facet
+CustomizedFacet_mustSelectCustomizedFacet=You must select a Customized Facet
+
+OperationFacet=Facet Operation
+OperationFacet_mustSelectOperationFacet=You must select a Facet Operation
+
+Add_Customization_title=Add a Customization Property
+Add_Customization_message=Add a new Customization Property
+
+Get_customization_property_message=Select a Customization Property
+Select_Customization_property=Customization Property
+
+Query_case_name=Customized eTypeElement
+Query_case_type=Case type
\ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGetOrCreateFilteredElementCommmandWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGetOrCreateFilteredElementCommmandWidget.java
new file mode 100644
index 00000000000..0c0b4d15550
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/sync/SynchronizedGetOrCreateFilteredElementCommmandWidget.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:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.sync;
+
+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
+ extends
+ SynchronizedObject>
+ implements
+ org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget {
+
+ public SynchronizedGetOrCreateFilteredElementCommmandWidget(
+ final org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget 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() {
+ @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 adapt(final java.lang.Class parm0) {
+ return safeSyncExec(new AbstractExceptionFreeRunnable () {
+ @Override
+ public A safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().adapt(parm0);
+ }
+ });
+ }
+
+ public final java.lang.Object getCommand() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable() {
+ @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() {
+ @Override
+ public T safeRun() {
+ return SynchronizedGetOrCreateFilteredElementCommmandWidget.this
+ .getSynchronizedObject().getElementSelected();
+ }
+ });
+ }
+
+ public final org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog pressNewButton() {
+ return safeSyncExec(new AbstractExceptionFreeRunnable>() {
+ @Override
+ public org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog 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.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractCustomizationMainDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractCustomizationMainDialog.java
new file mode 100644
index 00000000000..553c7456f96
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractCustomizationMainDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactory;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactoryFactory;
+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;
+
+public abstract class AbstractCustomizationMainDialog
+ extends AbstractMainDialog {
+
+ private final EditingDomain ediditingDomain;
+ private final ICustomizationCommandFactory customCmdFactory;
+
+ /**
+ * Constructor.
+ *
+ * @param selection
+ * the selection in the model (ecore file).
+ */
+ public AbstractCustomizationMainDialog(final Object selection,
+ final EditingDomain editingDomain) {
+ super(selection);
+ this.ediditingDomain = editingDomain;
+ this.customCmdFactory = ICustomizationCommandFactoryFactory.DEFAULT
+ .createICustomizationCommandFactory(editingDomain);
+ }
+
+ @Override
+ protected void execute() {
+ final Object result = getWidget().getCommand();
+ if (result instanceof Command) {
+ final Command command = (Command) result;
+ this.ediditingDomain.getCommandStack().execute(command);
+ }
+ }
+
+ protected final ICustomizationCommandFactory getCustomCmdFactory() {
+ return this.customCmdFactory;
+ }
+
+ protected final EditingDomain getEditingDomain() {
+ return this.ediditingDomain;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetCustomizationDialog.java
new file mode 100644
index 00000000000..1e21922c904
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetCustomizationDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+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 AbstractGetCustomizationDialog
+ extends AbstractDialog, W> {
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public AbstractGetCustomizationDialog(
+ final IWithResultDialogCallback callback) {
+ super(callback);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetOrCreateCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetOrCreateCustomizationDialog.java
new file mode 100644
index 00000000000..416620b3360
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/AbstractGetOrCreateCustomizationDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactory;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactoryFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+
+public abstract class AbstractGetOrCreateCustomizationDialog
+ extends AbstractGetCustomizationDialog {
+
+ private final EditingDomain editingDomain;
+ private final ICustomizationCommandFactory customCmdFactory;
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public AbstractGetOrCreateCustomizationDialog(
+ final IWithResultDialogCallback callback,
+ final EditingDomain editingDomain) {
+ super(callback);
+ this.editingDomain = editingDomain;
+ this.customCmdFactory = ICustomizationCommandFactoryFactory.DEFAULT
+ .createICustomizationCommandFactory(editingDomain);
+ }
+
+ protected final EditingDomain getEditingDomain() {
+ return this.editingDomain;
+ }
+
+ protected final ICustomizationCommandFactory getCustomCmdFactory() {
+ return this.customCmdFactory;
+ }
+
+ @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.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCaseQueryDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCaseQueryDialog.java
new file mode 100644
index 00000000000..ff94ff0d60b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCaseQueryDialog.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.custom.sdk.ui.internal.util.dialog.command;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractCustomizationMainDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command.AddCaseQueryWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+
+/**
+ * Concrete dialog for the creation of a query in a case.
+ */
+public class AddCaseQueryDialog extends
+ AbstractCustomizationMainDialog {
+
+ private AddCaseQueryWidget addCaseQueryW;
+ private final PropertyElement2 queryCaseProp;
+ private final PropertyElement2 queryValueProp;
+ private final IQueryContext queryContext;
+
+ /**
+ * Constructor.
+ *
+ * @param selection
+ * the selection in the model (custom file).
+ */
+ public AddCaseQueryDialog(final ETypedElementCase selection,
+ final EditingDomain editingDomain) {
+ super(selection, editingDomain);
+ this.queryContext = new QueryContext(selection);
+ this.queryCaseProp = new PropertyElement2(true);
+ this.queryValueProp = new PropertyElement2(true);
+ if (selection != null) {
+ this.queryCaseProp.setValue2(selection);
+ }
+ }
+
+ @Override
+ protected ICommandWidget createWidget() {
+ this.addCaseQueryW = new AddCaseQueryWidget(this.getDialogComposite(),
+ getCustomCmdFactory(), this.queryCaseProp, this.queryValueProp,
+ this.queryContext);
+ return this.addCaseQueryW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.Add_Customization_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Add_Customization_title;
+ }
+
+ /**
+ * @return the addCaseQueryWidget
+ */
+ public AddCaseQueryWidget getAddCaseQueryWidget() {
+ return this.addCaseQueryW;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCustomizationPropertyDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCustomizationPropertyDialog.java
new file mode 100644
index 00000000000..f4ac0ab5144
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/AddCustomizationPropertyDialog.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.custom.sdk.ui.internal.util.dialog.command;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractCustomizationMainDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command.AddCustomizationPropertyWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+
+/**
+ * Concrete dialog for the creation of a customization property into a
+ * customization.
+ */
+public class AddCustomizationPropertyDialog extends
+ AbstractCustomizationMainDialog {
+
+ private AddCustomizationPropertyWidget addCustomW;
+ private final EClassCustomization eClassCustom;
+ private final PropertyElement2 facetOpProperty;
+
+ /**
+ * Constructor.
+ *
+ * @param selection
+ * the selection in the model (custom file).
+ */
+ public AddCustomizationPropertyDialog(final EClassCustomization selection,
+ final EditingDomain editingDomain) {
+ super(selection, editingDomain);
+ this.eClassCustom = selection;
+ this.facetOpProperty = new PropertyElement2(true);
+ }
+
+ @Override
+ protected ICommandWidget createWidget() {
+ this.addCustomW = new AddCustomizationPropertyWidget(
+ this.getDialogComposite(), this.facetOpProperty,
+ this.eClassCustom, this.getEditingDomain());
+ return this.addCustomW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.Add_Customization_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Add_Customization_title;
+ }
+
+ /**
+ * @return the addCustomizationWidget
+ */
+ public AddCustomizationPropertyWidget getAddCustomizationWidget() {
+ return this.addCustomW;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateEClassCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateEClassCustomizationDialog.java
new file mode 100644
index 00000000000..c444cbef1e6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateEClassCustomizationDialog.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.custom.sdk.ui.internal.util.dialog.command;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractCustomizationMainDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command.CreateEClassCustomizationWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+
+/**
+ * Concrete dialog for the creation of an EClass Customization.
+ */
+public class CreateEClassCustomizationDialog extends
+ AbstractCustomizationMainDialog {
+
+ private CreateEClassCustomizationWidget eClassCustomW;
+ private final PropertyElement2 customProperty;
+ private final PropertyElement2 mClassProperty;
+ private final PropertyElement2 extFacetProperty;
+
+ /**
+ * Constructor.
+ *
+ * @param selection
+ * the selection in the model (custom file).
+ */
+ public CreateEClassCustomizationDialog(final Customization selection,
+ final EditingDomain editingDomain) {
+ super(selection, editingDomain);
+ this.customProperty = new PropertyElement2(true);
+ this.mClassProperty = new PropertyElement2(true);
+ this.extFacetProperty = new PropertyElement2(true);
+ if (selection != null) {
+ this.customProperty.setValue2(selection);
+ }
+ }
+
+ @Override
+ protected ICommandWidget createWidget() {
+ this.eClassCustomW = new CreateEClassCustomizationWidget(
+ this.getDialogComposite(), this.getCustomCmdFactory(),
+ getEditingDomain(), this.customProperty, this.mClassProperty,
+ this.extFacetProperty);
+ return this.eClassCustomW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.CreateEClassCustomizationDialog_Message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateEClassCustomizationDialog_Title;
+ }
+
+ /**
+ * @return the createEClassCustomizationWidget
+ */
+ public CreateEClassCustomizationWidget getCreateEClassCustomizationWidget() {
+ return this.eClassCustomW;
+ }
+
+ protected final CreateEClassCustomizationWidget geteClassCustomW() {
+ return this.eClassCustomW;
+ }
+
+ protected final PropertyElement2 getCustomProperty() {
+ return this.customProperty;
+ }
+
+ protected final PropertyElement2 getmClassProperty() {
+ return this.mClassProperty;
+ }
+
+ protected final PropertyElement2 getExtFacetProperty() {
+ return this.extFacetProperty;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateFacetCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateFacetCustomizationDialog.java
new file mode 100644
index 00000000000..84fa5cd1f14
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/CreateFacetCustomizationDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command.CreateFacetCustomizationWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+
+/**
+ * Concrete dialog for the creation of a Facet Customization.
+ */
+public class CreateFacetCustomizationDialog extends
+ CreateEClassCustomizationDialog {
+
+ private CreateFacetCustomizationWidget facetCustomW;
+ private PropertyElement2 facetCustomProp;
+
+ /**
+ * Constructor.
+ *
+ * @param selection
+ * the selection in the model (custom file).
+ */
+ public CreateFacetCustomizationDialog(final Customization selection,
+ final EditingDomain editingDomain) {
+ super(selection, editingDomain);
+ this.facetCustomProp = new PropertyElement2(true);
+ }
+
+ @Override
+ protected ICommandWidget createWidget() {
+ this.facetCustomW = new CreateFacetCustomizationWidget(
+ this.getDialogComposite(), getCustomCmdFactory(),
+ getEditingDomain(), getmClassProperty(), getCustomProperty(),
+ getExtFacetProperty(), this.facetCustomProp);
+ return this.facetCustomW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.CreateFacetCustomizationDialog_Message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateFacetCustomizationDialog_Title;
+ }
+
+ /**
+ * @return the createFacetCustomizationWidget
+ */
+ public CreateFacetCustomizationWidget getCreateFacetCustomizationWidget() {
+ return this.facetCustomW;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/QueryContext.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/QueryContext.java
new file mode 100644
index 00000000000..5fe973b3ef2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/command/QueryContext.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:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command;
+
+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.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+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.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.util.emf.core.ModelUtils;
+
+public class QueryContext implements IQueryContext {
+
+ private final DerivedTypedElement dte;
+ private final ETypedElementCase selection;
+
+ public QueryContext(final ETypedElementCase selection) {
+ this.selection = selection;
+ this.dte = FacetUtils
+ .getContainingDerivedTypedElement(selection);
+ }
+
+ public int getUpperBound() {
+ return this.dte.getUpperBound();
+ }
+
+ public EClassifier getReturnType() {
+ return this.dte.getEType();
+ }
+
+ public Resource getResource() {
+ return this.selection.eResource();
+ }
+
+ public Query getQuery() {
+ return this.selection.getValue();
+ }
+
+ public IProject getProject() {
+ return ModelUtils.getProject(this.selection);
+ }
+
+ public EObject getIntermediateEObject() {
+ return this.selection;
+ }
+
+ public Facet getFacet() {
+ return (Facet) this.dte.eContainer();
+ }
+
+ public EClassifier getExtendedEClass() {
+ return FacetUtils.getExtendedMetaclass((Facet) this.dte.eContainer());
+ }
+
+ public String getDerivedTypedElementName() {
+ return this.dte.getName();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/getorcreate/GetOrCreateCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/getorcreate/GetOrCreateCustomizationDialog.java
new file mode 100644
index 00000000000..843703a54ae
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/getorcreate/GetOrCreateCustomizationDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.getorcreate;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.sync.SynchronizedGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractGetOrCreateCustomizationDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command.GetOrCreateCustomizationWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.IGetOrCreateFilteredElementCommmandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+
+/**
+ * Provide a dialog where the user can select a {@link Customization} in the
+ * list. This class use the specific widget
+ * {@link GetOrCreateCustomizationWidget} and return the selected element with
+ * the method {@link #getCustomizationSelected()}.
+ *
+ * When the "ok" button is pressed, the parent property is set with the selected
+ * element.
+ *
+ * @see GetOrCreateCustomizationWidget
+ */
+public class GetOrCreateCustomizationDialog
+ extends
+ AbstractGetOrCreateCustomizationDialog> {
+
+ private final PropertyElement2 customProperty;
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public GetOrCreateCustomizationDialog(
+ final IWithResultDialogCallback callback,
+ final EditingDomain editingDomain, final Customization custom) {
+ super(callback, editingDomain);
+ this.customProperty = new PropertyElement2(true, custom);
+ }
+
+ @Override
+ protected IGetOrCreateFilteredElementCommmandWidget createWidget() {
+ final GetOrCreateCustomizationWidget widget = new GetOrCreateCustomizationWidget(this.getDialogComposite(),
+ getEditingDomain(), this.customProperty);
+ return new SynchronizedGetOrCreateFilteredElementCommmandWidget(
+ widget, widget.getDisplay());
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.GetOrCreate_customization_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Select_Customization;
+ }
+
+ @Override
+ protected void okPressed() {
+ this.getCallback().commited(this.customProperty.getValue2());
+ super.okPressed();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetCustomizedFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetCustomizedFacetDialog.java
new file mode 100644
index 00000000000..c7916a8fa9d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetCustomizedFacetDialog.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.selection;
+
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractGetCustomizationDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetCustomizedFacetWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetFiltredCustomizedFacetWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+
+/**
+ * Concrete dialog for the selection of the customized facet.
+ *
+ * @see GetCustomizedFacetWidget
+ */
+public class GetCustomizedFacetDialog extends
+ AbstractGetCustomizationDialog {
+ private GetFiltredCustomizedFacetWidget customFacetW;
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public GetCustomizedFacetDialog(
+ final IWithResultDialogCallback callback) {
+ super(callback);
+ }
+
+ @Override
+ protected GetFiltredCustomizedFacetWidget createWidget() {
+ this.customFacetW = new GetFiltredCustomizedFacetWidget(
+ this.getDialogComposite());
+ return this.customFacetW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.GetOrCreate_customization_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Select_Customization;
+ }
+
+ @Override
+ protected void okPressed() {
+ // TODO Use of in instance of PropertyElement ?
+ this.getCallback().commited(this.customFacetW.getElementSelected());
+ super.okPressed();
+ }
+
+ @Override
+ protected void execute() {
+ getCallback().commited(this.customFacetW.getFacetSelected());
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetExtendedFacetDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetExtendedFacetDialog.java
new file mode 100644
index 00000000000..ba52524eefc
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetExtendedFacetDialog.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.custom.sdk.ui.internal.util.dialog.selection;
+
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractGetCustomizationDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetExtendedFacetWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetFiltredExtendedFacetWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+
+/**
+ * Concrete dialog for the selection of the extended facet.
+ *
+ * @see GetExtendedFacetWidget
+ */
+public class GetExtendedFacetDialog extends
+ AbstractGetCustomizationDialog {
+
+ private GetFiltredExtendedFacetWidget extendedFacetW;
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public GetExtendedFacetDialog(
+ final IWithResultDialogCallback callback) {
+ super(callback);
+ }
+
+ @Override
+ protected GetFiltredExtendedFacetWidget createWidget() {
+ this.extendedFacetW = new GetFiltredExtendedFacetWidget(
+ this.getDialogComposite());
+ return this.extendedFacetW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.GetOrCreate_customization_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Select_Customization;
+ }
+
+ @Override
+ protected void okPressed() {
+ if (this.extendedFacetW.getFacetSelected() != null) {
+ getCallback().commited(this.extendedFacetW.getElementSelected());
+ }
+ super.okPressed();
+ }
+
+ @Override
+ protected void execute() {
+ getCallback().commited(this.extendedFacetW.getFacetSelected());
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetFacetOperationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetFacetOperationDialog.java
new file mode 100644
index 00000000000..a555c0cb1b0
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/selection/GetFacetOperationDialog.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.custom.sdk.ui.internal.util.dialog.selection;
+
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.AbstractGetCustomizationDialog;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetFiltredOperationFacetWidget;
+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.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+
+/**
+ * Concrete dialog for the selection of a Customization. The Customization is an
+ * operation into a particular facet.
+ *
+ * @see GetFiltredOperationFacetWidget
+ */
+public class GetFacetOperationDialog extends
+ AbstractGetCustomizationDialog {
+
+ private GetFiltredOperationFacetWidget operationFacetW;
+ private final Facet facet;
+
+ /**
+ * Constructor.
+ *
+ * @param properties
+ * properties that parent widget had.
+ */
+ public GetFacetOperationDialog(
+ final IWithResultDialogCallback callback,
+ final Facet facet) {
+ super(callback);
+ this.facet = facet;
+ }
+
+ @Override
+ protected GetFiltredOperationFacetWidget createWidget() {
+ this.operationFacetW = new GetFiltredOperationFacetWidget(
+ this.getDialogComposite(), this.facet);
+ return this.operationFacetW;
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return Messages.Get_customization_property_message;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.Select_Customization_property;
+ }
+
+ @Override
+ protected void okPressed() {
+ if (this.operationFacetW.getFacetOperationSelected() != null) {
+ this.getCallback().commited(
+ this.operationFacetW.getFacetOperationSelected());
+ }
+ super.okPressed();
+ }
+
+ @Override
+ protected void execute() {
+ getCallback()
+ .commited(this.operationFacetW.getFacetOperationSelected());
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCaseQueryDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCaseQueryDialog.java
new file mode 100644
index 00000000000..cff43749e2f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCaseQueryDialog.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.custom.sdk.ui.internal.util.dialog.sync;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedAddCaseQueryDialog extends
+ SynchronizedAbstractDialog {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedAddCaseQueryDialog(final IDialog object,
+ final Display display) {
+ super(object, display);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCustomizationPropertyDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCustomizationPropertyDialog.java
new file mode 100644
index 00000000000..a74ee8f0055
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedAddCustomizationPropertyDialog.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.custom.sdk.ui.internal.util.dialog.sync;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedAddCustomizationPropertyDialog extends
+ SynchronizedAbstractDialog {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedAddCustomizationPropertyDialog(
+ final IDialog object, final Display display) {
+ super(object, display);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateEClassCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateEClassCustomizationDialog.java
new file mode 100644
index 00000000000..0f2045248e0
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateEClassCustomizationDialog.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.custom.sdk.ui.internal.util.dialog.sync;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedCreateEClassCustomizationDialog extends
+ SynchronizedAbstractDialog {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedCreateEClassCustomizationDialog(
+ final IDialog object, final Display display) {
+ super(object, display);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateFacetCustomizationDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateFacetCustomizationDialog.java
new file mode 100644
index 00000000000..78d00ef2212
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/dialog/sync/SynchronizedCreateFacetCustomizationDialog.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.custom.sdk.ui.internal.util.dialog.sync;
+
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialog;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.dialog.SynchronizedAbstractDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedCreateFacetCustomizationDialog extends
+ SynchronizedAbstractDialog {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedCreateFacetCustomizationDialog(
+ final IDialog object, final Display display) {
+ super(object, display);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCaseQueryHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCaseQueryHandler.java
new file mode 100644
index 00000000000..2d13a725f19
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCaseQueryHandler.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Handler for the creation of a case query into an {@link ETypedElementCase}.
+ *
+ * @see ETypedElementCase
+ */
+public class AddCaseQueryHandler extends AbstractSelectionExpectedTypeHandler {
+
+ @Override
+ protected Class> getSelectionExpectedType() {
+ return ETypedElementCase.class;
+ }
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final EditingDomain editingDomain = Utils.getEditingDomain(event);
+ final Display display = Utils.getDisplay(event);
+ return ICustomizationDialogFactory.DEFAULT.openAddCaseQueryDialog(
+ display, editingDomain);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInEClassHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInEClassHandler.java
new file mode 100644
index 00000000000..f97b89bdfc6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInEClassHandler.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Handler for the creation of an Customization Property into an EClass
+ * Customization.
+ */
+public class AddCustomizationPropertyInEClassHandler extends
+ AbstractSelectionExpectedTypeHandler {
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final EditingDomain editingDomain = Utils.getEditingDomain(event);
+ final Display display = Utils.getDisplay(event);
+ return ICustomizationDialogFactory.DEFAULT
+ .openAddCustomizationPropertyDialog(display, editingDomain);
+ }
+
+ @Override
+ protected Class> getSelectionExpectedType() {
+ return EClassCustomization.class;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInFacetHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInFacetHandler.java
new file mode 100644
index 00000000000..7c43859457d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/AddCustomizationPropertyInFacetHandler.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.FacetCustomization;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Handler for the creation of an Customization Property into a Facet
+ * Customization.
+ */
+public class AddCustomizationPropertyInFacetHandler extends
+ AbstractSelectionExpectedTypeHandler {
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final EditingDomain editingDomain = Utils.getEditingDomain(event);
+ final Display display = Utils.getDisplay(event);
+ return ICustomizationDialogFactory.DEFAULT
+ .openAddCustomizationPropertyDialog(display, editingDomain);
+ }
+
+ @Override
+ protected Class> getSelectionExpectedType() {
+ return FacetCustomization.class;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateEClassCustomizationHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateEClassCustomizationHandler.java
new file mode 100644
index 00000000000..36f435cb8b4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateEClassCustomizationHandler.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.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Handler for the creation of an EClass Customization.
+ */
+public class CreateEClassCustomizationHandler extends
+ AbstractSelectionExpectedTypeHandler {
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final EditingDomain editingDomain = Utils.getEditingDomain(event);
+ final Display display = Utils.getDisplay(event);
+ return ICustomizationDialogFactory.DEFAULT
+ .openCreateEClassCustomizationDialog(display, editingDomain);
+ }
+
+ @Override
+ protected Class> getSelectionExpectedType() {
+ return Customization.class;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateFacetCustomizationHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateFacetCustomizationHandler.java
new file mode 100644
index 00000000000..a87a1fed4d8
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/CreateFacetCustomizationHandler.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.handler.AbstractSelectionExpectedTypeHandler;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Handler for the creation of an Facet Customization.
+ */
+public class CreateFacetCustomizationHandler extends AbstractSelectionExpectedTypeHandler {
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final EditingDomain editingDomain = Utils.getEditingDomain(event);
+ final Display display = Utils.getDisplay(event);
+ return ICustomizationDialogFactory.DEFAULT
+ .openCreateFacetCustomizationDialog(display, editingDomain);
+ }
+
+ @Override
+ protected Class> getSelectionExpectedType() {
+ return Customization.class;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Utils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Utils.java
new file mode 100644
index 00000000000..b9ff5caaaae
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/handler/Utils.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:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public final class Utils {
+
+ private Utils() {
+ // Must not be used
+ }
+
+ public static EditingDomain getEditingDomain(final ExecutionEvent event) {
+ final IWorkbenchPart part = getPart(event);
+ IEditingDomainProvider edProvider = null;
+ if (part instanceof IEditingDomainProvider) {
+ edProvider = (IEditingDomainProvider) part;
+ } else {
+ edProvider = (IEditingDomainProvider) part
+ .getAdapter(IEditingDomainProvider.class);
+ }
+ EditingDomain editingDomain = null;
+ if (edProvider != null) {
+ editingDomain = edProvider.getEditingDomain();
+ }
+ return editingDomain;
+ }
+
+ private static IWorkbenchPart getPart(final ExecutionEvent event) {
+ IWorkbenchPart part = null;
+ if (event.getApplicationContext() instanceof IEvaluationContext) {
+ final IEvaluationContext evalContext = (IEvaluationContext) event
+ .getApplicationContext();
+ part = (IWorkbenchPart) evalContext.getVariable("activePart"); //$NON-NLS-1$
+ } else {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final IWorkbenchWindow window = workbench
+ .getActiveWorkbenchWindow();
+ if (window != null) {
+ final IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ part = page.getActivePart();
+ }
+ }
+ }
+ return part;
+ }
+
+ public static Display getDisplay(final ExecutionEvent execEvent) {
+ Display display = null;
+ if (execEvent.getTrigger() instanceof Event) {
+ final Event event = (Event) execEvent.getTrigger();
+ display = event.display;
+ } else {
+ display = PlatformUI.getWorkbench().getDisplay();
+ }
+ return display;
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCaseQueryWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCaseQueryWidget.java
new file mode 100644
index 00000000000..cdf492f7b93
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCaseQueryWidget.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.custom.sdk.ui.internal.util.widget.command;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactory;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.property.name.GetCaseQueryNameWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.property.name.GetCaseQueryTypeWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.IQueryContext;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.query.SelectQueryTypeWidget;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Widget for the creation of a case query. This Widget return a command (
+ * {@link #getCommand()} for the creation of the element into the model.
+ *
+ * This widget uses 3 others widgets:
+ *
+ * {@link GetCaseQueryNameWidget} to display the name of the query.
+ * {@link GetCaseQueryTypeWidget} to display the type of the query.
+ * {@link SelectQueryTypeWidget} to select the query and open the query editor.
+ */
+public class AddCaseQueryWidget extends AbstractCommandWidget {
+
+ private final PropertyElement2 queryCaseProp;
+ private final PropertyElement2 queryProperty;
+ private final ICustomizationCommandFactory customCmdFactory;
+ private final IQueryContext queryContext;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the properties.
+ * @param customCmdFactory
+ * @param queryCaseProp
+ * @param queryNameProp
+ * @param queryTypeProp
+ * @param queryProperty
+ */
+ public AddCaseQueryWidget(final Composite parent,
+ final ICustomizationCommandFactory customCmdFactory,
+ final PropertyElement2 queryCaseProperty,
+ final PropertyElement2 queryProperty,
+ final IQueryContext queryContext) {
+ super(parent);
+ this.customCmdFactory = customCmdFactory;
+ this.queryCaseProp = queryCaseProperty;
+ this.queryProperty = queryProperty;
+ this.queryContext = queryContext;
+ }
+
+ @Override
+ public Command getCommand() {
+ final ETypedElementCase elementCase = this.queryCaseProp.getValue2();
+ final Query query = this.queryProperty.getValue2();
+ return this.customCmdFactory.addValueInCase(
+ elementCase, query);
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ addSubWidget(new GetCaseQueryNameWidget(this, this.queryCaseProp));
+ final SelectQueryTypeWidget queryTypeWidget = new SelectQueryTypeWidget(
+ this, this.queryProperty, true, this.queryContext);
+ addSubWidget(queryTypeWidget);
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing to do.
+ }
+
+ @Override
+ public void onDialogValidation() {
+ // Nothing to do.
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCustomizationPropertyWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCustomizationPropertyWidget.java
new file mode 100644
index 00000000000..c4c56104d0c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/AddCustomizationPropertyWidget.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.custom.sdk.ui.internal.util.widget.command;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.CustomFactory;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementSwitchQuery;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetOperationFacetWidget;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactoryFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Widget for the selection of a customization property. This Widget return a
+ * command ( {@link #getCommand()} for the creation of the element into the
+ * model.
+ *
+ * This widget uses the {@link GetOperationFacetWidget} widget to display a
+ * dialog where the user select the operation he wants.
+ *
+ * When the operation is selected, a copy of this operation is made and this one
+ * will be added to the model.
+ *
+ * Cases are created to be added to the operation:
+ *
+ * a null
case a case for each
+ * {@link EStructuralFeature} of the extended meta-class
+ */
+public class AddCustomizationPropertyWidget extends
+ AbstractCommandWidget {
+
+ private final EClassCustomization eClassCustom;
+ private final PropertyElement2 facetOpProperty;
+ private final EditingDomain editingDomain;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the properties.
+ */
+ public AddCustomizationPropertyWidget(final Composite parent,
+ final PropertyElement2 facetOpProperty,
+ final EClassCustomization eClassCustomProp,
+ final EditingDomain editingDomain) {
+ super(parent);
+ this.facetOpProperty = facetOpProperty;
+ this.eClassCustom = eClassCustomProp;
+ this.editingDomain = editingDomain;
+ }
+
+ @Override
+ public Command getCommand() {
+ final FacetOperation customOperation = (FacetOperation) this.facetOpProperty
+ .getValue();
+ // Copy of the selected operation.
+ final FacetOperation facetOperation = EcoreUtil
+ .copy(customOperation);
+ // Set the selected operation has the override operation of the new one.
+ facetOperation.setOverride(customOperation);
+ // Creation of the Query
+ final ETypedElementSwitchQuery eTypedElementSQ = CustomFactory.eINSTANCE
+ .createETypedElementSwitchQuery();
+ ETypedElementCase elementCase;
+ // Adding a null case
+ elementCase = CustomFactory.eINSTANCE.createETypedElementCase();
+ elementCase.setCase(null);
+ eTypedElementSQ.getCases().add(elementCase);
+ // Adding a Case for each Structural Feature.
+ for (final EStructuralFeature feature : this.eClassCustom
+ .getExtendedMetaclass().getEAllStructuralFeatures()) {
+ elementCase = CustomFactory.eINSTANCE.createETypedElementCase();
+ elementCase.setCase(feature);
+ eTypedElementSQ.getCases().add(elementCase);
+ }
+ // Set the query created to the custom operation.
+ facetOperation.setQuery(eTypedElementSQ);
+ return IFacetCommandFactoryFactory.DEFAULT.createCommandFactory(
+ this.editingDomain).createAddOperationInFacetCommand(
+ this.eClassCustom, facetOperation);
+ }
+
+ @Override
+ public void onDialogValidation() {
+ // Nothing to do.
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ final GetOperationFacetWidget widget = new GetOperationFacetWidget(
+ this, this.facetOpProperty, this.eClassCustom);
+ addSubWidget(widget);
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing to do.
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateEClassCustomizationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateEClassCustomizationWidget.java
new file mode 100644
index 00000000000..50be1908a1a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateEClassCustomizationWidget.java
@@ -0,0 +1,180 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.command;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.CustomFactory;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactory;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetExtendedFacetWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetOrCreateCustomizationWidget;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.metaclass.GetExtendedMetaclassWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.command.AbstractCommandWidget;
+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 creation of an {@link EClassCustomization}. This Widget return
+ * a command ( {@link #getCommand()} for the creation of the element into the
+ * model.
+ *
+ *
+ * This widget uses 3 others:
+ *
+ * {@link GetOrCreateCustomizationWidget} for the selection of the parent.
+ *
+ * {@link GetExtendedMetaclassWidget} for the selection of the extended
+ * meta-class
+ *
+ * {@link GetExtendedFacetWidget} for the selection of the extended
+ * {@link Facet}
+ */
+public class CreateEClassCustomizationWidget extends AbstractCommandWidget {
+
+ private final PropertyElement2 customProperty;
+ private final PropertyElement2 mClassProperty;
+ private final PropertyElement2 extFacetProperty;
+
+ private GetOrCreateCustomizationWidget customWidget;
+ private GetExtendedMetaclassWidget extendedMCWidget;
+ private GetExtendedFacetWidget extendedFacetW;
+ private final ICustomizationCommandFactory customCmdFactory;
+ private final EditingDomain editingDomain;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the properties.
+ */
+ public CreateEClassCustomizationWidget(final Composite parent,
+ final ICustomizationCommandFactory customCmdFactory,
+ final EditingDomain editingDomain,
+ final PropertyElement2 customProperty,
+ final PropertyElement2 mClassProperty,
+ final PropertyElement2 extFacetProperty) {
+ super(parent);
+ this.customCmdFactory = customCmdFactory;
+ this.editingDomain = editingDomain;
+ this.customProperty = customProperty;
+ this.mClassProperty = mClassProperty;
+ this.extFacetProperty = extFacetProperty;
+ }
+
+ @Override
+ public Command getCommand() {
+ final Customization customization = (Customization) this
+ .getCustomizationProperty().getValue();
+ final EClassCustomization eClassCustom = createEClassCustomization();
+ return this.customCmdFactory.createEClassCustomization(customization,
+ eClassCustom);
+ }
+
+ public EClassCustomization createEClassCustomization() {
+ final EClass extendedMetaclass = (EClass) this.getMetaClassProperty()
+ .getValue();
+ final Facet extendedFacet = (Facet) this.getExtendedFacetProperty()
+ .getValue();
+ final String name = extendedMetaclass.getName() + " " //$NON-NLS-1$
+ + extendedFacet.getDocumentation();
+ final EClassCustomization eClassCustom = getEClassCustomization();
+ eClassCustom.setName(name);
+ eClassCustom.setExtendedMetaclass(extendedMetaclass);
+ eClassCustom.getExtendedFacets().add(extendedFacet);
+ return eClassCustom;
+ }
+
+ @SuppressWarnings("static-method")
+ // @SuppressWarnings("static-method") This method is overrode by
+ // EditEClassCustomizationWidget.
+ public EClassCustomization getEClassCustomization() {
+ return CustomFactory.eINSTANCE.createEClassCustomization();
+ }
+
+ @Override
+ public void onDialogValidation() {
+ // Nothing.
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ this.customWidget = new GetOrCreateCustomizationWidget(this,
+ this.customProperty, this.editingDomain);
+ addSubWidget(this.customWidget);
+ this.extendedMCWidget = new GetExtendedMetaclassWidget(this,
+ this.mClassProperty, this.customProperty);
+ addSubWidget(this.extendedMCWidget);
+ this.extendedFacetW = new GetExtendedFacetWidget(this,
+ this.extFacetProperty);
+ addSubWidget(this.extendedFacetW);
+ }
+
+ @Override
+ public void notifyChanged() {
+ // Nothing.
+ }
+
+ /**
+ * @return the customizationProperty
+ */
+ public PropertyElement getCustomizationProperty() {
+ return this.customProperty;
+ }
+
+ /**
+ * @return the metaClassProperty
+ */
+ public PropertyElement getMetaClassProperty() {
+ return this.mClassProperty;
+ }
+
+ /**
+ * @return the extendedFacetProperty
+ */
+ public PropertyElement getExtendedFacetProperty() {
+ return this.extFacetProperty;
+ }
+
+ /**
+ * @return the getOrCreateCustomizationWidget
+ */
+ public GetOrCreateCustomizationWidget getGetOrCreateCustomizationWidget() {
+ return this.customWidget;
+ }
+
+ /**
+ * @return the getExtendedMetaclassWidget
+ */
+ public GetExtendedMetaclassWidget getGetExtendedMetaclassWidget() {
+ return this.extendedMCWidget;
+ }
+
+ /**
+ * @return the getExtendedFacetWidget
+ */
+ public GetExtendedFacetWidget getGetExtendedFacetWidget() {
+ return this.extendedFacetW;
+ }
+
+ protected final ICustomizationCommandFactory getCustomCmdFactory() {
+ return this.customCmdFactory;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateFacetCustomizationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateFacetCustomizationWidget.java
new file mode 100644
index 00000000000..abafe7d52c3
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/CreateFacetCustomizationWidget.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
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.command;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.CustomFactory;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.FacetCustomization;
+import org.eclipse.emf.facet.custom.sdk.core.ICustomizationCommandFactory;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.widget.getorcreate.GetCustomizedFacetWidget;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+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 creation of an {@link FacetCustomization}. This Widget return
+ * a command ( {@link #getCommand()} for the creation of the element into the
+ * model and extends {@link CreateEClassCustomizationWidget}.
+ *
+ *
+ * This widget add a other widget to the 3 of
+ * {@link CreateEClassCustomizationWidget}:
+ *
+ * {@link GetCustomizedFacetWidget} for the selection of a {@link Facet}
+ */
+public class CreateFacetCustomizationWidget extends
+ CreateEClassCustomizationWidget {
+
+ private final PropertyElement2 facetCustomProp;
+ private GetCustomizedFacetWidget getCustomFacetW;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the properties.
+ * @param mClassProperty
+ * @param customProperty
+ * @param extFacetProperty
+ * @param facetCustomProp
+ * @param facetCustomProp
+ */
+ public CreateFacetCustomizationWidget(final Composite parent,
+ final ICustomizationCommandFactory customCmdFactory,
+ final EditingDomain editingDomain,
+ final PropertyElement2 mClassProperty,
+ final PropertyElement2 customProperty,
+ final PropertyElement2 extFacetProperty,
+ final PropertyElement2 facetCustomProp) {
+ super(parent, customCmdFactory, editingDomain,
+ customProperty, mClassProperty, extFacetProperty);
+ this.facetCustomProp = facetCustomProp;
+ }
+
+ @Override
+ public Command getCommand() {
+ final Customization customization = (Customization) this
+ .getCustomizationProperty().getValue();
+ final FacetCustomization facetCustom = createFacetCustomization();
+ return getCustomCmdFactory().createFacetCustomization(customization,
+ facetCustom);
+ }
+
+ public FacetCustomization createFacetCustomization() {
+ final EClass extendedMetaclass = (EClass) this.getMetaClassProperty()
+ .getValue();
+ final Facet extendedFacet = (Facet) this.getExtendedFacetProperty()
+ .getValue();
+ final String name = extendedMetaclass.getName() + " " //$NON-NLS-1$
+ + extendedFacet.getDocumentation();
+ final Facet customizedFacet = (Facet) this.facetCustomProp.getValue();
+ final FacetCustomization facetCustom = getFacetCustomization();
+ facetCustom.setName(name);
+ facetCustom.setExtendedMetaclass(extendedMetaclass);
+ facetCustom.getExtendedFacets().add(extendedFacet);
+ facetCustom.setCustomizedFacet(customizedFacet);
+ return facetCustom;
+ }
+
+ @SuppressWarnings("static-method")
+ //@SuppressWarnings("static-method") This method is overrode by EditFacetCustomizationWidget.
+ public FacetCustomization getFacetCustomization() {
+ return CustomFactory.eINSTANCE.createFacetCustomization();
+ }
+
+ @Override
+ protected void addSubWidgets() {
+ super.addSubWidgets();
+ this.getCustomFacetW = new GetCustomizedFacetWidget(this,
+ this.facetCustomProp);
+ addSubWidget(this.getCustomFacetW);
+ }
+
+ /**
+ * @return the facetCustomizedProperty
+ */
+ public PropertyElement getFacetCustomizedProperty() {
+ return this.facetCustomProp;
+ }
+
+ /**
+ * @return the getCustomizedFacetWidget
+ */
+ public GetCustomizedFacetWidget getGetCustomizedFacetWidget() {
+ return this.getCustomFacetW;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/GetOrCreateCustomizationWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/GetOrCreateCustomizationWidget.java
new file mode 100644
index 00000000000..a3c71be2488
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/command/GetOrCreateCustomizationWidget.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.command;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.command.CreateEClassCustomizationDialog;
+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.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.command.ICommandWidget;
+import org.eclipse.emf.facet.util.ui.utils.PropertyElement2;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * This widget allow the user to select a Customization.
+ *
+ * @see AbstractGetOrCreateFilteredElementCommandWidget
+ */
+public class GetOrCreateCustomizationWidget extends
+ AbstractGetOrCreateFilteredElementCommandWidget {
+
+ private final EditingDomain editingDomain;
+ private final PropertyElement2 customProperty;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the properties.
+ * @param customProperty
+ */
+ public GetOrCreateCustomizationWidget(final Composite parent,
+ final EditingDomain editingDomain,
+ final PropertyElement2 customProperty) {
+ super(parent);
+ this.editingDomain = editingDomain;
+ this.customProperty = customProperty;
+ }
+
+ @Override
+ protected Map getElements() {
+ final Map result = new HashMap();
+ final Customization initialSelection = this.customProperty.getValue2();
+ final FacetSet parent = FacetUtils
+ .getContainingFacetSet(initialSelection);
+ final Map allFacetSets = FacetUtils
+ .getAllFacetSetsByName(parent);
+ for (String key : allFacetSets.keySet()) {
+ final FacetSet value = allFacetSets.get(key);
+ if (value instanceof Customization) {
+ final Customization custom = (Customization) value;
+ result.put(key, custom);
+ }
+ }
+ final Object name = initialSelection.getName();
+ result.remove(name);
+ return result;
+ }
+
+ @Override
+ protected IDialog createDialog() {
+ return new CreateEClassCustomizationDialog(
+ this.customProperty.getValue2(), this.editingDomain);
+ }
+
+ @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.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/AbstractGetFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/AbstractGetFacetWidget.java
new file mode 100644
index 00000000000..9cb70248708
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/AbstractGetFacetWidget.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.widget.component.getorcreate.AbstractGetOrCreateElementWithButtonWidget;
+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 extends {@link AbstractGetOrCreateElementWithButtonWidget} and
+ * display to the user a label with a textfield and a button to select the
+ * customized facet.
+ */
+public abstract class AbstractGetFacetWidget extends
+ AbstractGetOrCreateElementWithDialogButtonWidget {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param propertyElement
+ * the property element that be edited with this composite.
+ * @param properties
+ * the map of properties of the parent.
+ */
+ public AbstractGetFacetWidget(final Composite parent,
+ final PropertyElement2 propertyElement) {
+ super(parent, propertyElement);
+ }
+
+ @Override
+ protected String getTextFieldInitialText() {
+ return this.getPropertyElement().getValue2().getName();
+ }
+
+ @Override
+ public void notifyChanged() { // NOPMD by gdupe on 24/09/12 16:59
+ // NOPMD This methods will be empty in all the sub classes of this class
+ // No action has to be done if a change appends.
+ }
+
+ @Override
+ protected void onCanceled() { // NOPMD by gdupe on 24/09/12 16:59
+ // NOPMD This methods will be empty in all the sub classes of this class
+ // Nothing to do.
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetCustomizedFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetCustomizedFacetWidget.java
new file mode 100644
index 00000000000..fc24dca02fd
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetCustomizedFacetWidget.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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.selection.GetCustomizedFacetDialog;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+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;
+
+/**
+ * This class extends {@link AbstractGetOrCreateElementWithButtonWidget} and
+ * display to the user a label with a textfield and a button to select the
+ * customized facet.
+ */
+public class GetCustomizedFacetWidget extends
+ AbstractGetFacetWidget {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param propertyElement
+ * the property element that be edited with this composite.
+ * @param properties
+ * the map of properties of the parent.
+ */
+ public GetCustomizedFacetWidget(final Composite parent,
+ final PropertyElement2 propertyElement) {
+ super(parent, propertyElement);
+ }
+
+ @Override
+ protected String getLabel() {
+ return Messages.CustomizedFacet;
+ }
+
+ @Override
+ protected String getErrorMessage() {
+ return Messages.CustomizedFacet_mustSelectCustomizedFacet;
+ }
+
+ @Override
+ protected GetCustomizedFacetDialog getCreationDialog(
+ final IWithResultDialogCallback callback) {
+ return new GetCustomizedFacetDialog(callback);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetExtendedFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetExtendedFacetWidget.java
new file mode 100644
index 00000000000..7f6e6df2627
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetExtendedFacetWidget.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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.util.dialog.selection.GetExtendedFacetDialog;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IWithResultDialogCallback;
+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;
+
+/**
+ * This class extends {@link AbstractGetOrCreateElementWithButtonWidget}. The
+ * widget open the {@link GetExtendedFacetDialog} dialog when the button [...]
+ * is pressed {@link #createDialog()}.
+ */
+public class GetExtendedFacetWidget extends
+ AbstractGetFacetWidget {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param propertyElement
+ * the property element that be edited with this composite.
+ * @param properties
+ * the map of properties of the parent.
+ */
+ public GetExtendedFacetWidget(final Composite parent,
+ final PropertyElement2 propertyElement) {
+ super(parent, propertyElement);
+ }
+
+ @Override
+ protected String getLabel() {
+ return Messages.ExtendedFacet;
+ }
+
+ @Override
+ protected String getErrorMessage() {
+ return Messages.Facet_mustSelectFacet;
+ }
+
+ @Override
+ protected GetExtendedFacetDialog getCreationDialog(
+ final IWithResultDialogCallback callback) {
+ return new GetExtendedFacetDialog(callback);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredCustomizedFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredCustomizedFacetWidget.java
new file mode 100644
index 00000000000..695550d8c44
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredCustomizedFacetWidget.java
@@ -0,0 +1,121 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.core.IFacetSetCatalogManager;
+import org.eclipse.emf.facet.efacet.core.IFacetSetCatalogManagerFactory;
+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.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.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * This widget extends {@link AbstractGetOrCreateFilteredElementCommandWidget} and allow
+ * the selection of a {@link Facet} that the Customization will customize. It
+ * displays a selection window with a textfield to filter the element in the
+ * selection window. Extending {@link AbstractGetOrCreateFilteredElementCommandWidget},
+ * a [New...] button can be displayed. Here, no button is displayed because we
+ * only select the extended facet into the existing facet.
+ *
+ *
+ * The selection window will be full up with the customization properties
+ * returned by {@link IFacetSetCatalogManager}.
+ */
+public class GetFiltredCustomizedFacetWidget extends
+ AbstractGetOrCreateFilteredElementCommandWidget {
+
+ protected static final String TMP_NAME = Activator.getDefault()
+ .getBundle().getSymbolicName()
+ + ".tmp"; //$NON-NLS-1$
+ public static final File DEFAULT_FILE = new File(Platform
+ .getStateLocation(Activator.getDefault().getBundle()).toOSString(),
+ GetFiltredCustomizedFacetWidget.TMP_NAME);
+
+ private final IFacetSetCatalogManager facetSetCatMan;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the map of properties of the parent.
+ */
+ public GetFiltredCustomizedFacetWidget(final Composite parent) {
+ super(parent);
+ this.facetSetCatMan = IFacetSetCatalogManagerFactory.DEFAULT
+ .getOrCreateFacetSetCatalogManager(EditingUtil
+ .createDefaultResource(
+ GetFiltredCustomizedFacetWidget.DEFAULT_FILE)
+ .getResourceSet());
+ }
+
+ @Override
+ protected Map getElements() {
+ final Map allFacets = new HashMap();
+ final Collection facetSets = this.facetSetCatMan
+ .getRegisteredFacetSets();
+ for (final FacetSet facetSet : facetSets) {
+ for (final EClassifier eClassifier : facetSet.getEClassifiers()) {
+ if ((eClassifier instanceof Facet)
+ && (eClassifier.getName() != null)) {
+ allFacets.put(eClassifier.getName(), (Facet) eClassifier);
+ }
+ }
+ }
+ return allFacets;
+ }
+
+ @Override
+ public void notifyChanged() {
+ // No action has to be done if a change appends.
+ }
+
+ @Override
+ public Command getCommand() {
+ // Here, this widget only return a selected element so, no command is
+ // returned.
+ return null;
+ }
+
+ @Override
+ protected IDialog createDialog() {
+ // No "New..." button.
+ return null;
+ }
+
+
+ @Override
+ public void onDialogValidation() {
+ // Nothing.
+ }
+
+ /**
+ * @return
+ */
+ public Facet getFacetSelected() {
+ return getElementSelected();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredExtendedFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredExtendedFacetWidget.java
new file mode 100644
index 00000000000..8437e1bcf30
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredExtendedFacetWidget.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.facet.custom.core.ICustomizationPropertiesCatalogManager;
+import org.eclipse.emf.facet.custom.core.ICustomizationPropertiesCatalogManagerFactory;
+import org.eclipse.emf.facet.custom.sdk.ui.internal.Activator;
+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.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.util.widget.command.AbstractGetOrCreateFilteredElementCommandWidget;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * This widget extends {@link AbstractGetOrCreateFilteredElementCommandWidget} and allow
+ * the selection of a {@link Facet} that the Customization will extend. It
+ * displays a selection window with a textfield to filter the element in the
+ * selection window. Extending {@link AbstractGetOrCreateFilteredElementCommandWidget},
+ * a [New...] button can be displayed. Here, no button is displayed because we
+ * only select the extended facet into the existing facet.
+ *
+ *
+ * The selection window will be full up with the customization properties
+ * returned by {@link ICustomizationPropertiesCatalogManager}.
+ */
+public class GetFiltredExtendedFacetWidget extends
+ AbstractGetOrCreateFilteredElementCommandWidget {
+
+ protected static final String TMP_NAME = Activator.getDefault()
+ .getBundle().getSymbolicName()
+ + ".tmp"; //$NON-NLS-1$
+ public static final File DEFAULT_FILE = new File(Platform
+ .getStateLocation(Activator.getDefault().getBundle()).toOSString(),
+ GetFiltredExtendedFacetWidget.TMP_NAME);
+
+ private final ICustomizationPropertiesCatalogManager customPropCatMan;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param properties
+ * the map of properties of the parent.
+ */
+ public GetFiltredExtendedFacetWidget(final Composite parent) {
+ super(parent);
+ this.customPropCatMan = ICustomizationPropertiesCatalogManagerFactory.INSTANCE
+ .getOrCreateCustomizationPropertiesCatalogManager(EditingUtil
+ .createDefaultResource(
+ GetFiltredExtendedFacetWidget.DEFAULT_FILE)
+ .getResourceSet());
+ }
+
+ @Override
+ protected Map getElements() {
+ final Map allFacets = new HashMap();
+ final List facetSets = this.customPropCatMan
+ .getAllRegisteredCustomizationPropertySet();
+ for (final FacetSet facetSet : facetSets) {
+ for (final EClassifier eClassifier : facetSet.getEClassifiers()) {
+ if ((eClassifier instanceof Facet)
+ && (eClassifier.getName() != null)) {
+ allFacets.put(eClassifier.getName(), (Facet) eClassifier);
+ }
+ }
+ }
+ return allFacets;
+ }
+
+ @Override
+ protected IDialog createDialog() {
+ // No "New..." button.
+ return null;
+ }
+
+ @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.
+ }
+
+ /**
+ * @return
+ */
+ public Facet getFacetSelected() {
+ return getElementSelected();
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredOperationFacetWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredOperationFacetWidget.java
new file mode 100644
index 00000000000..4f53aa92a12
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/src/org/eclipse/emf/facet/custom/sdk/ui/internal/util/widget/getorcreate/GetFiltredOperationFacetWidget.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.custom.sdk.ui.internal.util.widget.getorcreate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.common.command.Command;
+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.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;
+
+/**
+ * This widget provide the selection of a {@link FacetOperation} available of
+ * the selected {@link Facet}. The {@link Facet} is passed in the constructor
+ * parameter.
+ *
+ *
+ * This widget extends {@link AbstractGetOrCreateFilteredElementCommandWidget}.
+ *
+ * @see AbstractGetOrCreateFilteredElementCommandWidget
+ */
+public class GetFiltredOperationFacetWidget extends
+ AbstractGetOrCreateFilteredElementCommandWidget {
+
+ private final Facet selectedFacet;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite.
+ * @param facetOpProperty
+ * @param properties
+ * the map of properties of the parent.
+ * @param facetOpProperty
+ */
+ public GetFiltredOperationFacetWidget(final Composite parent,
+ final Facet selectedFacet) {
+ super(parent);
+ this.selectedFacet = selectedFacet;
+ }
+
+ @Override
+ protected Map getElements() {
+ final Map