diff options
author | glefur | 2011-02-01 09:55:15 +0000 |
---|---|---|
committer | glefur | 2011-02-01 09:55:15 +0000 |
commit | ae710faa57a0cc3360d3af68419df4a2c6c980a4 (patch) | |
tree | f5063d520c0ec9230cc74030ba0661b3a314bfd5 /tests | |
parent | ad85194e4c0d729617bf0228565925c19f9df4a4 (diff) | |
download | org.eclipse.eef-ae710faa57a0cc3360d3af68419df4a2c6c980a4.tar.gz org.eclipse.eef-ae710faa57a0cc3360d3af68419df4a2c6c980a4.tar.xz org.eclipse.eef-ae710faa57a0cc3360d3af68419df4a2c6c980a4.zip |
Synchronized: Generation
ADDED: StictTyping filter
Diffstat (limited to 'tests')
58 files changed, 6696 insertions, 202 deletions
diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample1.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample1.gif Binary files differnew file mode 100644 index 000000000..60148743b --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample1.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample2.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample2.gif Binary files differnew file mode 100644 index 000000000..90f4828ff --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateConcreteReferenceOwnerSample_strictTyping_ConcreteReferenceTargetSample2.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceOwnerSample.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceOwnerSample.gif Binary files differnew file mode 100644 index 000000000..dc3ca1841 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceOwnerSample.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample1.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample1.gif Binary files differnew file mode 100644 index 000000000..309083004 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample1.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample2.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample2.gif Binary files differnew file mode 100644 index 000000000..dfffef186 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/ctool16/CreateRoot_samples_ConcreteReferenceTargetSample2.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceOwnerSample.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceOwnerSample.gif Binary files differnew file mode 100644 index 000000000..98b351f1c --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceOwnerSample.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceTargetSample.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceTargetSample.gif Binary files differnew file mode 100644 index 000000000..7bac4fd38 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/AbstractReferenceTargetSample.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceOwnerSample.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceOwnerSample.gif Binary files differnew file mode 100644 index 000000000..7bac4fd38 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceOwnerSample.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample1.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample1.gif Binary files differnew file mode 100644 index 000000000..a3908bcf7 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample1.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample2.gif b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample2.gif Binary files differnew file mode 100644 index 000000000..33a997a16 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/icons/full/obj16/ConcreteReferenceTargetSample2.gif diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.components b/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.components index 35ce2f8d6..ca727a92f 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.components +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.components @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ASCII"?> -<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:eef-components="http://www.eclipse.org/emf/eef/components/1.0.0" xmlns:eef-mapping-navigation="http://www.eclipse.org/emf/eef/mapping/navigation/1.0.0" xmlns:eef-views="http://www.eclipse.org/emf/eef/views/1.0.0"> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:eef-components="http://www.eclipse.org/emf/eef/components/1.0.0" xmlns:eef-mapping-filters="http://www.eclipse.org/emf/eef/mapping/filters/1.0.0" xmlns:eef-mapping-navigation="http://www.eclipse.org/emf/eef/mapping/navigation/1.0.0" xmlns:eef-views="http://www.eclipse.org/emf/eef/views/1.0.0"> <eef-components:PropertiesEditionContext xmi:id="_Fx_LAAwvEd-uP4lw9e0IMw" documentation="Edition Context for eefnr GenPackage"> <categories xmi:id="_Fx_LAQwvEd-uP4lw9e0IMw" name="eefnr"> <bindings xsi:type="eef-components:PropertiesEditionComponent" xmi:id="_Fx_LAgwvEd-uP4lw9e0IMw" name="Root" views="_Fx_LQwwvEd-uP4lw9e0IMw"> @@ -410,6 +410,38 @@ </categories> <model href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.genmodel#//eefnr/navigation"/> </eef-components:PropertiesEditionContext> + <eef-components:PropertiesEditionContext xmi:id="_Z3SiZS1SEeCoYry1ltbGrg" documentation="Edition Context for filters GenPackage"> + <categories xmi:id="_Z3SiZi1SEeCoYry1ltbGrg" name="filters"> + <bindings xsi:type="eef-components:PropertiesEditionComponent" xmi:id="_Z3SibC1SEeCoYry1ltbGrg" name="ConcreteReferenceOwnerSample" views="_Z3TwiC1SEeCoYry1ltbGrg"> + <properties xsi:type="eef-components:PropertiesEditionElement" xmi:id="_Z3SibS1SEeCoYry1ltbGrg" name="name" views="_Z3Twii1SEeCoYry1ltbGrg"> + <model xsi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//AbstractSample/name"/> + </properties> + <properties xsi:type="eef-components:PropertiesEditionElement" xmi:id="_Z3Sibi1SEeCoYry1ltbGrg" name="abstractTarget" views="_Z3Twiy1SEeCoYry1ltbGrg"> + <bindingFilters xsi:type="eef-mapping-filters:OnlyReferenceTypeFilter" xmi:id="_oh90kC1XEeCoYry1ltbGrg" name="onlyReferenceTypefilter"> + <reference href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/ConcreteReferenceOwnerSample/target"/> + </bindingFilters> + <model xsi:type="ecore:EReference" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/AbstractReferenceOwnerSample/abstractTarget"/> + </properties> + <properties xsi:type="eef-components:PropertiesEditionElement" xmi:id="_riJJIS3oEeCjCeyEYuXGRQ" name="strictTyping" views="_wF62UC3oEeCjCeyEYuXGRQ"> + <model xsi:type="ecore:EReference" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/ConcreteReferenceOwnerSample/strictTyping"/> + </properties> + <model xsi:type="ecore:EClass" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/ConcreteReferenceOwnerSample"/> + </bindings> + <bindings xsi:type="eef-components:PropertiesEditionComponent" xmi:id="_Z3Siby1SEeCoYry1ltbGrg" name="ConcreteReferenceTargetSample1" views="_Z3TwjC1SEeCoYry1ltbGrg"> + <properties xsi:type="eef-components:PropertiesEditionElement" xmi:id="_Z3SicC1SEeCoYry1ltbGrg" name="name" views="_Z3Twji1SEeCoYry1ltbGrg"> + <model xsi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//AbstractSample/name"/> + </properties> + <model xsi:type="ecore:EClass" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/ConcreteReferenceTargetSample1"/> + </bindings> + <bindings xsi:type="eef-components:PropertiesEditionComponent" xmi:id="_Z3SicS1SEeCoYry1ltbGrg" name="ConcreteReferenceTargetSample2" views="_Z3Twjy1SEeCoYry1ltbGrg"> + <properties xsi:type="eef-components:PropertiesEditionElement" xmi:id="_Z3Sici1SEeCoYry1ltbGrg" name="name" views="_Z3TwkS1SEeCoYry1ltbGrg"> + <model xsi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//AbstractSample/name"/> + </properties> + <model xsi:type="ecore:EClass" href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.ecore#//filters/ConcreteReferenceTargetSample2"/> + </bindings> + </categories> + <model href="platform:/resource/org.eclipse.emf.eef.tests.nonreg/model/eefnr.genmodel#//eefnr/filters"/> + </eef-components:PropertiesEditionContext> <eef-components:PropertiesEditionContext xmi:id="_0Hu75z1nEd-LLuOHydFNYw" documentation="Edition Context for eefnrext GenPackage"> <categories xmi:id="_0Hu76D1nEd-LLuOHydFNYw" name="eefnrext"> <bindings xsi:type="eef-components:PropertiesEditionComponent" xmi:id="_0Hu76T1nEd-LLuOHydFNYw" name="TableCompositionTargetExtensionEditorSample" views="_0HxYLT1nEd-LLuOHydFNYw"> @@ -913,4 +945,40 @@ </views> </categories> </eef-views:ViewsRepository> + <eef-views:ViewsRepository xmi:id="_Z3Twfy1SEeCoYry1ltbGrg" documentation="Views repository for filters GenPackage" name="filters"> + <RepositoryKind>SWT</RepositoryKind> + <RepositoryKind>Form</RepositoryKind> + <categories xmi:id="_Z3TwgC1SEeCoYry1ltbGrg" name="filters"> + <views xmi:id="_Z3TwiC1SEeCoYry1ltbGrg" name="ConcreteReferenceOwnerSample"> + <elements xsi:type="eef-views:Container" xmi:id="_Z3TwiS1SEeCoYry1ltbGrg" name="properties"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.4"/> + <elements xsi:type="eef-views:ElementEditor" xmi:id="_Z3Twii1SEeCoYry1ltbGrg" name="name"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.0"/> + </elements> + <elements xsi:type="eef-views:ElementEditor" xmi:id="_Z3Twiy1SEeCoYry1ltbGrg" name="abstractTarget"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/EMFProperties.toolkits#//@widgets.8"/> + </elements> + <elements xsi:type="eef-views:ElementEditor" xmi:id="_wF62UC3oEeCjCeyEYuXGRQ" name="strictTyping"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/EMFProperties.toolkits#//@widgets.7"/> + </elements> + </elements> + </views> + <views xmi:id="_Z3TwjC1SEeCoYry1ltbGrg" name="ConcreteReferenceTargetSample1"> + <elements xsi:type="eef-views:Container" xmi:id="_Z3TwjS1SEeCoYry1ltbGrg" name="properties"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.4"/> + <elements xsi:type="eef-views:ElementEditor" xmi:id="_Z3Twji1SEeCoYry1ltbGrg" name="name"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.0"/> + </elements> + </elements> + </views> + <views xmi:id="_Z3Twjy1SEeCoYry1ltbGrg" name="ConcreteReferenceTargetSample2"> + <elements xsi:type="eef-views:Container" xmi:id="_Z3TwkC1SEeCoYry1ltbGrg" name="properties"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.4"/> + <elements xsi:type="eef-views:ElementEditor" xmi:id="_Z3TwkS1SEeCoYry1ltbGrg" name="name"> + <representation href="platform:/plugin/org.eclipse.emf.eef.views/std/SWT.toolkits#//@widgets.0"/> + </elements> + </elements> + </views> + </categories> + </eef-views:ViewsRepository> </xmi:XMI> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.eefgen b/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.eefgen index 1db547418..da75d961e 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.eefgen +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/models/eefnr.eefgen @@ -9,6 +9,9 @@ <editionContexts basePackage="org.eclipse.emf.eef" descriptorsContributorID="" descriptorsGenericPropertiesViews="true"> <PropertiesEditionContext href="eefnr.components#_IPrf8j1-Ed-LLuOHydFNYw"/> </editionContexts> + <editionContexts basePackage="org.eclipse.emf.eef" descriptorsGenericPropertiesViews="true"> + <PropertiesEditionContext href="eefnr.components#_Z3SiZS1SEeCoYry1ltbGrg"/> + </editionContexts> <editionContexts basePackage="org.eclipse.emf.eef" descriptorsContributorID="" descriptorsGenericPropertiesViews="true"> <PropertiesEditionContext href="eefnr.components#_IPrf8j1-Ed-LLuOHydFNYe"/> </editionContexts> @@ -24,4 +27,7 @@ <viewsRepositories basePackage="org.eclipse.emf.eef.eefnr.references" swtViews="true" formViews="true"> <viewsRepository href="eefnr.components#_IPsHCz1-Ed-LLuOHydFNYe"/> </viewsRepositories> + <viewsRepositories basePackage="org.eclipse.emf.eef.eefnr.filters" swtViews="true" formViews="true"> + <viewsRepository href="eefnr.components#_Z3Twfy1SEeCoYry1ltbGrg"/> + </viewsRepositories> </eef-gen:EEFGenModel> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.properties b/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.properties index 96445df7d..41bf16b6f 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.properties +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.properties @@ -2,7 +2,7 @@ # <copyright> # </copyright> # -# $Id: plugin.properties,v 1.9 2010/11/30 08:24:12 glefur Exp $ +# $Id: plugin.properties,v 1.10 2011/02/01 09:55:16 glefur Exp $ pluginName = Eefnr Edit Support providerName = www.example.org @@ -166,3 +166,11 @@ _UI_NamedElement_type = Named Element _UI_Element_type = Element _UI_Element_visible_feature = Visible _UI_Tests_type = Tests +_UI_AbstractReferenceOwnerSample_type = Abstract Reference Owner Sample +_UI_AbstractReferenceTargetSample_type = Abstract Reference Target Sample +_UI_ConcreteReferenceOwnerSample_type = Concrete Reference Owner Sample +_UI_ConcreteReferenceTargetSample1_type = Concrete Reference Target Sample1 +_UI_ConcreteReferenceTargetSample2_type = Concrete Reference Target Sample2 +_UI_AbstractReferenceOwnerSample_abstractTarget_feature = Abstract Target +_UI_ConcreteReferenceOwnerSample_target_feature = Target +_UI_ConcreteReferenceOwnerSample_strictTyping_feature = Strict Typing diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.xml index 96361bec0..0a9ac4263 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.xml +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/plugin.xml @@ -5,7 +5,7 @@ <copyright> </copyright> - $Id: plugin.xml,v 1.10 2010/11/30 08:24:13 glefur Exp $ + $Id: plugin.xml,v 1.11 2011/02/01 09:55:16 glefur Exp $ --> <plugin> @@ -24,6 +24,18 @@ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> <factory + uri="http://www.eclipse.org/emf/eef/nonreg/filters/1.0.0" + class="org.eclipse.emf.eef.eefnr.filters.provider.FiltersItemProviderAdapterFactory" + supportedTypes= + "org.eclipse.emf.edit.provider.IEditingDomainItemProvider + org.eclipse.emf.edit.provider.IStructuredItemContentProvider + org.eclipse.emf.edit.provider.ITreeItemContentProvider + org.eclipse.emf.edit.provider.IItemLabelProvider + org.eclipse.emf.edit.provider.IItemPropertySource"/> + </extension> + + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory uri="http://www.eclipse.org/emf/eef/nonreg/references/1.0.0" class="org.eclipse.emf.eef.eefnr.references.provider.ReferencesItemProviderAdapterFactory" supportedTypes= @@ -61,6 +73,24 @@ <!-- EEF extensions --> <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> <factory + uri="http://www.eclipse.org/emf/eef/nonreg/references/1.0.0" + class="org.eclipse.emf.eef.eefnr.providers.ReferencesEEFAdapterFactory" + supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> + </extension> + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory + uri="http://www.eclipse.org/emf/eef/nonreg/navigation/1.0.0" + class="org.eclipse.emf.eef.eefnr.providers.NavigationEEFAdapterFactory" + supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> + </extension> + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory + uri="http://www.eclipse.org/emf/eef/nonreg/filters/1.0.0" + class="org.eclipse.emf.eef.eefnr.providers.FiltersEEFAdapterFactory" + supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> + </extension> + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory uri="http://www.eclipse.org/emf/eef/nonreg/1.0.0" class="org.eclipse.emf.eef.eefnr.providers.EefnrEEFAdapterFactory" supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> @@ -68,25 +98,31 @@ <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> @@ -285,82 +321,134 @@ type="org.eclipse.emf.eef.eefnr.TableCompositionExtensionEditorSample"> </input> </propertySection> - </propertySections> - </extension> - <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> - <factory - uri="http://www.eclipse.org/emf/eef/nonreg/navigation/1.0.0" - class="org.eclipse.emf.eef.navigation.providers.NavigationEEFAdapterFactory" - supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - - <!-- Tabbed properties views extension --> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertyContributor"> - <propertyContributor - contributorId="org.eclipse.emf.eef.navigation.properties"> - <propertyCategory - category="default"> - </propertyCategory> - <propertyCategory - category="extended"> - </propertyCategory> - <propertyCategory - category="advanced"> - </propertyCategory> - </propertyContributor> - </extension> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> - <propertyTabs - contributorId="org.eclipse.emf.eef.navigation.properties"> - <propertyTab - label="Base" - category="default" - id="Base"> - </propertyTab> - <propertyTab - label="DeferedFlatReferencesTableSample" - category="extended" - id="DeferedFlatReferencesTableSample" - afterTab="DeferedFlatReferencesTableSample"> - </propertyTab> - <propertyTab - label="DeferedReferencesTableSample" - category="extended" - id="DeferedReferencesTableSample" - afterTab="DeferedReferencesTableSample"> - </propertyTab> - </propertyTabs> - </extension> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertySections"> - <propertySections - contributorId="org.eclipse.emf.eef.navigation.properties"> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.references.section.ReferenceEnabledSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.references.ReferenceEnabledSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.references.section.ReferenceEnabledSample" + tab="AbstractSample"> + <input + type="org.eclipse.emf.eef.eefnr.references.ReferenceEnabledSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnr.section.AbstractSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.AbstractSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.references.section.AbstractEnabledSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.references.AbstractEnabledSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.references.section.AbstractEnabledSample" + tab="AbstractSample"> + <input + type="org.eclipse.emf.eef.eefnr.references.AbstractEnabledSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.TableCompositionTargetExtensionEditorSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnrext.TableCompositionTargetExtensionEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.CheckBoxExtendedEditorSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnrext.CheckBoxExtendedEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.CheckBoxExtendedEditorSample" + tab="AbstractSample"> + <input + type="org.eclipse.emf.eef.eefnrext.CheckBoxExtendedEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.FlatReferenceExtendedEditorSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnrext.FlatReferenceExtendedEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.FlatReferenceExtendedEditorSample" + tab="SecondFlatReferenceExtendedEditorSample"> + <input + type="org.eclipse.emf.eef.eefnrext.FlatReferenceExtendedEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnrext.section.FlatReferenceExtendedEditorSample" + tab="CheckBoxExtendedEditorSample"> + <input + type="org.eclipse.emf.eef.eefnrext.FlatReferenceExtendedEditorSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.AbstractReferenceOwnerSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.AbstractReferenceTargetSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceOwnerSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceTargetSample1" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceTargetSample2" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2"> + </input> + </propertySection> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" id="org.eclipse.emf.eef.navigation.section.DeferedFlatReferenceTableEditorSample" @@ -377,140 +465,71 @@ type="org.eclipse.emf.eef.eefnr.navigation.DeferedReferenceTableEditorSample"> </input> </propertySection> - <propertySection - class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.navigation.section.Owner" - tab="Base"> - <input - type="org.eclipse.emf.eef.eefnr.navigation.Owner"> - </input> - </propertySection> - <propertySection - class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.navigation.section.Subtype" - tab="Base"> - <input - type="org.eclipse.emf.eef.eefnr.navigation.Subtype"> - </input> - </propertySection> - </propertySections> - </extension> - <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> - <factory - uri="http://www.eclipse.org/emf/eef/nonreg/references/1.0.0" - class="org.eclipse.emf.eef.references.providers.ReferencesEEFAdapterFactory" - supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> - </extension> - - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - <extension - point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> - <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> - </PropertiesEditionPartProvider> - </extension> - - <!-- Tabbed properties views extension --> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertyContributor"> - <propertyContributor - contributorId="org.eclipse.emf.eef.references.properties"> - <propertyCategory - category="default"> - </propertyCategory> - <propertyCategory - category="extended"> - </propertyCategory> - <propertyCategory - category="advanced"> - </propertyCategory> - </propertyContributor> - </extension> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> - <propertyTabs - contributorId="org.eclipse.emf.eef.references.properties"> - <propertyTab - label="Base" - category="default" - id="Base"> - </propertyTab> - <propertyTab - label="AbstractSample" - category="extended" - id="AbstractSample" - afterTab="Base"> - </propertyTab> - <propertyTab - label="AbstractSample" - category="extended" - id="AbstractSample" - afterTab="Base"> - </propertyTab> - </propertyTabs> - </extension> - <extension - point="org.eclipse.ui.views.properties.tabbed.propertySections"> - <propertySections - contributorId="org.eclipse.emf.eef.references.properties"> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.references.section.ReferenceEnabledSample" + id="org.eclipse.emf.eef.navigation.section.Owner" tab="Base"> <input - type="org.eclipse.emf.eef.eefnr.references.ReferenceEnabledSample"> + type="org.eclipse.emf.eef.eefnr.navigation.Owner"> </input> </propertySection> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.references.section.ReferenceEnabledSample" - tab="AbstractSample"> + id="org.eclipse.emf.eef.navigation.section.Subtype" + tab="Base"> <input - type="org.eclipse.emf.eef.eefnr.references.ReferenceEnabledSample"> + type="org.eclipse.emf.eef.eefnr.navigation.Subtype"> </input> </propertySection> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.eefnr.section.AbstractSample" + id="org.eclipse.emf.eef.navigation.section.Subtype" + tab="Owner"> + <input + type="org.eclipse.emf.eef.eefnr.navigation.Subtype"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.navigation.section.AnotherSubType" tab="Base"> <input - type="org.eclipse.emf.eef.eefnr.AbstractSample"> + type="org.eclipse.emf.eef.eefnr.navigation.AnotherSubType"> </input> </propertySection> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.references.section.AbstractEnabledSample" + id="org.eclipse.emf.eef.navigation.section.AnotherSubType" + tab="Subtype"> + <input + type="org.eclipse.emf.eef.eefnr.navigation.AnotherSubType"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.eefnr.section.NamedElement" tab="Base"> <input - type="org.eclipse.emf.eef.eefnr.references.AbstractEnabledSample"> + type="org.eclipse.emf.eef.eefnr.NamedElement"> </input> </propertySection> <propertySection class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" - id="org.eclipse.emf.eef.references.section.AbstractEnabledSample" - tab="AbstractSample"> + id="org.eclipse.emf.eef.navigation.section.Element" + tab="Base"> <input - type="org.eclipse.emf.eef.eefnr.references.AbstractEnabledSample"> + type="org.eclipse.emf.eef.eefnr.navigation.Element"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.navigation.section.Element" + tab="NamedElement"> + <input + type="org.eclipse.emf.eef.eefnr.navigation.Element"> </input> </propertySection> </propertySections> </extension> - </plugin> + diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnr_properties.plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnr_properties.plugin.xml index 0a8c8819f..55d0f3d9b 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnr_properties.plugin.xml +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnr_properties.plugin.xml @@ -18,6 +18,12 @@ </extension> <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> <factory + uri="http://www.eclipse.org/emf/eef/nonreg/filters/1.0.0" + class="org.eclipse.emf.eef.eefnr.providers.FiltersEEFAdapterFactory" + supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> + </extension> + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory uri="http://www.eclipse.org/emf/eef/nonreg/1.0.0" class="org.eclipse.emf.eef.eefnr.providers.EefnrEEFAdapterFactory" supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> @@ -25,25 +31,31 @@ <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnrext_properties.plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnrext_properties.plugin.xml index c1d215480..1c79fe493 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnrext_properties.plugin.xml +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/eefnrext_properties.plugin.xml @@ -13,25 +13,31 @@ <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/filters_properties.plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/filters_properties.plugin.xml new file mode 100644 index 000000000..c28b6e880 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/filters_properties.plugin.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + + <plugin> + + <!-- EEF extensions --> + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <factory + uri="http://www.eclipse.org/emf/eef/nonreg/filters/1.0.0" + class="org.eclipse.emf.eef.filters.providers.FiltersEEFAdapterFactory" + supportedTypes="org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider"/> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + + <!-- Tabbed properties views extension --> + <extension + point="org.eclipse.ui.views.properties.tabbed.propertyContributor"> + <propertyContributor + contributorId="org.eclipse.emf.eef.filters.properties"> + <propertyCategory + category="default"> + </propertyCategory> + <propertyCategory + category="extended"> + </propertyCategory> + <propertyCategory + category="advanced"> + </propertyCategory> + </propertyContributor> + </extension> + <extension + point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> + <propertyTabs + contributorId="org.eclipse.emf.eef.filters.properties"> + <propertyTab + label="Base" + category="default" + id="Base"> + </propertyTab> + </propertyTabs> + </extension> + <extension + point="org.eclipse.ui.views.properties.tabbed.propertySections"> + <propertySections + contributorId="org.eclipse.emf.eef.filters.properties"> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.AbstractReferenceOwnerSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.AbstractReferenceTargetSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceOwnerSample" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceTargetSample1" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1"> + </input> + </propertySection> + <propertySection + class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection" + id="org.eclipse.emf.eef.filters.section.ConcreteReferenceTargetSample2" + tab="Base"> + <input + type="org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2"> + </input> + </propertySection> + </propertySections> + </extension> + </plugin> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/navigation_properties.plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/navigation_properties.plugin.xml index 117c1a6eb..2facb9563 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/navigation_properties.plugin.xml +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/navigation_properties.plugin.xml @@ -13,25 +13,31 @@ <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceOwnerSamplePropertiesEditionPart.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceOwnerSamplePropertiesEditionPart.java new file mode 100644 index 000000000..7a3288573 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceOwnerSamplePropertiesEditionPart.java @@ -0,0 +1,99 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +// Start of user code for imports +import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.ViewerFilter;
+ + + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public interface AbstractReferenceOwnerSamplePropertiesEditionPart { + + /** + * @return the name + * + */ + public String getName(); + + /** + * Defines a new name + * @param newValue the new name to set + * + */ + public void setName(String newValue); + + + + + /** + * Init the abstractTarget + * @param settings settings for the abstractTarget ReferencesTable + */ + public void initAbstractTarget(ReferencesTableSettings settings); + + /** + * Update the abstractTarget + * @param newValue the abstractTarget to update + * + */ + public void updateAbstractTarget(); + + /** + * Adds the given filter to the abstractTarget edition editor. + * + * @param filter + * a viewer filter + * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter); + + /** + * Adds the given filter to the abstractTarget edition editor. + * + * @param filter + * a viewer filter + * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter); + + /** + * @return true if the given element is contained inside the abstractTarget table + * + */ + public boolean isContainedInAbstractTargetTable(EObject element); + + + + + + /** + * Returns the internationalized title text. + * + * @return the internationalized title text. + * + */ + public String getTitle(); + + // Start of user code for additional methods + +// End of user code + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceTargetSamplePropertiesEditionPart.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceTargetSamplePropertiesEditionPart.java new file mode 100644 index 000000000..57c398cdd --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/AbstractReferenceTargetSamplePropertiesEditionPart.java @@ -0,0 +1,55 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +// Start of user code for imports + + + + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public interface AbstractReferenceTargetSamplePropertiesEditionPart { + + /** + * @return the name + * + */ + public String getName(); + + /** + * Defines a new name + * @param newValue the new name to set + * + */ + public void setName(String newValue); + + + + + + /** + * Returns the internationalized title text. + * + * @return the internationalized title text. + * + */ + public String getTitle(); + + // Start of user code for additional methods + +// End of user code + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceOwnerSamplePropertiesEditionPart.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceOwnerSamplePropertiesEditionPart.java new file mode 100644 index 000000000..d645e9fb6 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceOwnerSamplePropertiesEditionPart.java @@ -0,0 +1,99 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +// Start of user code for imports +import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.ViewerFilter;
+ + + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public interface ConcreteReferenceOwnerSamplePropertiesEditionPart { + + /** + * @return the name + * + */ + public String getName(); + + /** + * Defines a new name + * @param newValue the new name to set + * + */ + public void setName(String newValue); + + + + + /** + * Init the abstractTarget + * @param settings settings for the abstractTarget ReferencesTable + */ + public void initAbstractTarget(ReferencesTableSettings settings); + + /** + * Update the abstractTarget + * @param newValue the abstractTarget to update + * + */ + public void updateAbstractTarget(); + + /** + * Adds the given filter to the abstractTarget edition editor. + * + * @param filter + * a viewer filter + * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter); + + /** + * Adds the given filter to the abstractTarget edition editor. + * + * @param filter + * a viewer filter + * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter); + + /** + * @return true if the given element is contained inside the abstractTarget table + * + */ + public boolean isContainedInAbstractTargetTable(EObject element); + + + + + + /** + * Returns the internationalized title text. + * + * @return the internationalized title text. + * + */ + public String getTitle(); + + // Start of user code for additional methods + +// End of user code + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample1PropertiesEditionPart.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample1PropertiesEditionPart.java new file mode 100644 index 000000000..8d579ba03 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample1PropertiesEditionPart.java @@ -0,0 +1,55 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +// Start of user code for imports + + + + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public interface ConcreteReferenceTargetSample1PropertiesEditionPart { + + /** + * @return the name + * + */ + public String getName(); + + /** + * Defines a new name + * @param newValue the new name to set + * + */ + public void setName(String newValue); + + + + + + /** + * Returns the internationalized title text. + * + * @return the internationalized title text. + * + */ + public String getTitle(); + + // Start of user code for additional methods + +// End of user code + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample2PropertiesEditionPart.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample2PropertiesEditionPart.java new file mode 100644 index 000000000..613bb3753 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/ConcreteReferenceTargetSample2PropertiesEditionPart.java @@ -0,0 +1,55 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +// Start of user code for imports + + + + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public interface ConcreteReferenceTargetSample2PropertiesEditionPart { + + /** + * @return the name + * + */ + public String getName(); + + /** + * Defines a new name + * @param newValue the new name to set + * + */ + public void setName(String newValue); + + + + + + /** + * Returns the internationalized title text. + * + * @return the internationalized title text. + * + */ + public String getTitle(); + + // Start of user code for additional methods + +// End of user code + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/FiltersViewsRepository.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/FiltersViewsRepository.java new file mode 100644 index 000000000..5b05546dc --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/FiltersViewsRepository.java @@ -0,0 +1,105 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts; + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class FiltersViewsRepository { + + public static final int SWT_KIND = 0; + + public static final int FORM_KIND = 1; + + + /** + * AbstractReferenceOwnerSample view descriptor + * + */ + public static class AbstractReferenceOwnerSample { + public static class Properties { + + + public static String name = "filters::AbstractReferenceOwnerSample::properties::name"; + + + public static String abstractTarget = "filters::AbstractReferenceOwnerSample::properties::abstractTarget"; + + + } + + } + + /** + * AbstractReferenceTargetSample view descriptor + * + */ + public static class AbstractReferenceTargetSample { + public static class Properties { + + + public static String name = "filters::AbstractReferenceTargetSample::properties::name"; + + + } + + } + + /** + * ConcreteReferenceOwnerSample view descriptor + * + */ + public static class ConcreteReferenceOwnerSample { + public static class Properties { + + + public static String name = "filters::ConcreteReferenceOwnerSample::properties::name"; + + + public static String abstractTarget = "filters::ConcreteReferenceOwnerSample::properties::abstractTarget"; + + + } + + } + + /** + * ConcreteReferenceTargetSample1 view descriptor + * + */ + public static class ConcreteReferenceTargetSample1 { + public static class Properties { + + + public static String name = "filters::ConcreteReferenceTargetSample1::properties::name"; + + + } + + } + + /** + * ConcreteReferenceTargetSample2 view descriptor + * + */ + public static class ConcreteReferenceTargetSample2 { + public static class Properties { + + + public static String name = "filters::ConcreteReferenceTargetSample2::properties::name"; + + + } + + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceOwnerSamplePropertiesEditionPartForm.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceOwnerSamplePropertiesEditionPartForm.java new file mode 100644 index 000000000..b4f28dd84 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceOwnerSamplePropertiesEditionPartForm.java @@ -0,0 +1,383 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.forms; + +// Start of user code for imports +import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
+import org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceOwnerSamplePropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, AbstractReferenceOwnerSamplePropertiesEditionPart { + + protected Text name; + protected ReferencesTable abstractTarget; + protected List<ViewerFilter> abstractTargetBusinessFilters = new ArrayList<ViewerFilter>(); + protected List<ViewerFilter> abstractTargetFilters = new ArrayList<ViewerFilter>(); + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public AbstractReferenceOwnerSamplePropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) + * + */ + public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { + ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); + Form form = scrolledForm.getForm(); + view = form.getBody(); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(widgetFactory, view); + return scrolledForm; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(final FormToolkit widgetFactory, Composite view) { + CompositionSequence abstractReferenceOwnerSampleStep = new CompositionSequence(); + CompositionStep propertiesStep = abstractReferenceOwnerSampleStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.class); + propertiesStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name); + propertiesStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget); + + + composer = new PartComposer(abstractReferenceOwnerSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.class) { + return createPropertiesGroup(widgetFactory, parent); + } + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name) { + return createNameText(widgetFactory, parent); + } + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget) { + return createAbstractTargetReferencesTable(widgetFactory, parent); + } + return parent; + } + }; + composer.compose(view); + } + /** + * + */ + protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { + Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); + propertiesSection.setText(FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); + propertiesSectionData.horizontalSpan = 3; + propertiesSection.setLayoutData(propertiesSectionData); + Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + propertiesSection.setClient(propertiesGroup); + return propertiesGroup; + } + + + protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, FiltersViewsRepository.FORM_KIND)); + name = widgetFactory.createText(parent, ""); //$NON-NLS-1$ + name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + widgetFactory.paintBordersFor(parent); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + /** + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + }); + name.addKeyListener(new KeyAdapter() { + /** + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + }); + EditingUtils.setID(name, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, FiltersViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected Composite createAbstractTargetReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.abstractTarget = new ReferencesTable(FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel, new ReferencesTableListener () { + public void handleAdd() { addAbstractTarget(); } + public void handleEdit(EObject element) { editAbstractTarget(element); } + public void handleMove(EObject element, int oldIndex, int newIndex) { moveAbstractTarget(element, oldIndex, newIndex); } + public void handleRemove(EObject element) { removeFromAbstractTarget(element); } + public void navigateTo(EObject element) { } + }); + this.abstractTarget.setHelpText(propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, FiltersViewsRepository.FORM_KIND)); + this.abstractTarget.createControls(parent, widgetFactory); + this.abstractTarget.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent e) { + if (e.item != null && e.item.getData() instanceof EObject) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); + } + } + + }); + GridData abstractTargetData = new GridData(GridData.FILL_HORIZONTAL); + abstractTargetData.horizontalSpan = 3; + this.abstractTarget.setLayoutData(abstractTargetData); + this.abstractTarget.disableMove(); + abstractTarget.setID(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget); + abstractTarget.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected void addAbstractTarget() { + TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(abstractTarget.getInput(), abstractTargetFilters, abstractTargetBusinessFilters, + "abstractTarget", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) { + @Override + public void process(IStructuredSelection selection) { + for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject) iter.next(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + abstractTarget.refresh(); + } + }; + dialog.open(); + } + + /** + * + */ + protected void moveAbstractTarget(EObject element, int oldIndex, int newIndex) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void removeFromAbstractTarget(EObject element) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void editAbstractTarget(EObject element) { + EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory); + PropertiesEditingProvider provider = (PropertiesEditingProvider)adapterFactory.adapt(element, PropertiesEditingProvider.class); + if (provider != null) { + PropertiesEditingPolicy policy = provider.getPolicy(context); + if (policy != null) { + policy.execute(); + abstractTarget.refresh(); + } + } + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#initAbstractTarget(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) + */ + public void initAbstractTarget(ReferencesTableSettings settings) { + if (current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); + abstractTarget.setContentProvider(contentProvider); + abstractTarget.setInput(settings); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#updateAbstractTarget() + * + */ + public void updateAbstractTarget() { + abstractTarget.refresh(); +} + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#addFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#addBusinessFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#isContainedInAbstractTargetTable(EObject element) + * + */ + public boolean isContainedInAbstractTargetTable(EObject element) { + return ((ReferencesTableSettings)abstractTarget.getInput()).contains(element); + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.AbstractReferenceOwnerSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceTargetSamplePropertiesEditionPartForm.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceTargetSamplePropertiesEditionPartForm.java new file mode 100644 index 000000000..4dd5be35c --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/AbstractReferenceTargetSamplePropertiesEditionPartForm.java @@ -0,0 +1,222 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.forms; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceTargetSamplePropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, AbstractReferenceTargetSamplePropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public AbstractReferenceTargetSamplePropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) + * + */ + public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { + ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); + Form form = scrolledForm.getForm(); + view = form.getBody(); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(widgetFactory, view); + return scrolledForm; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(final FormToolkit widgetFactory, Composite view) { + CompositionSequence abstractReferenceTargetSampleStep = new CompositionSequence(); + abstractReferenceTargetSampleStep + .addStep(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.class) + .addStep(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name); + + + composer = new PartComposer(abstractReferenceTargetSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.AbstractReferenceTargetSample.Properties.class) { + return createPropertiesGroup(widgetFactory, parent); + } + if (key == FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name) { + return createNameText(widgetFactory, parent); + } + return parent; + } + }; + composer.compose(view); + } + /** + * + */ + protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { + Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); + propertiesSection.setText(FiltersMessages.AbstractReferenceTargetSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); + propertiesSectionData.horizontalSpan = 3; + propertiesSection.setLayoutData(propertiesSectionData); + Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + propertiesSection.setClient(propertiesGroup); + return propertiesGroup; + } + + + protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, FiltersMessages.AbstractReferenceTargetSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, FiltersViewsRepository.FORM_KIND)); + name = widgetFactory.createText(parent, ""); //$NON-NLS-1$ + name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + widgetFactory.paintBordersFor(parent); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + /** + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceTargetSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + }); + name.addKeyListener(new KeyAdapter() { + /** + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceTargetSamplePropertiesEditionPartForm.this, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + }); + EditingUtils.setID(name, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, FiltersViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.AbstractReferenceTargetSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceOwnerSamplePropertiesEditionPartForm.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceOwnerSamplePropertiesEditionPartForm.java new file mode 100644 index 000000000..419ff1eab --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceOwnerSamplePropertiesEditionPartForm.java @@ -0,0 +1,383 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.forms; + +// Start of user code for imports +import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
+import org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceOwnerSamplePropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, ConcreteReferenceOwnerSamplePropertiesEditionPart { + + protected Text name; + protected ReferencesTable abstractTarget; + protected List<ViewerFilter> abstractTargetBusinessFilters = new ArrayList<ViewerFilter>(); + protected List<ViewerFilter> abstractTargetFilters = new ArrayList<ViewerFilter>(); + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceOwnerSamplePropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) + * + */ + public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { + ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); + Form form = scrolledForm.getForm(); + view = form.getBody(); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(widgetFactory, view); + return scrolledForm; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(final FormToolkit widgetFactory, Composite view) { + CompositionSequence concreteReferenceOwnerSampleStep = new CompositionSequence(); + CompositionStep propertiesStep = concreteReferenceOwnerSampleStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.class); + propertiesStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name); + propertiesStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget); + + + composer = new PartComposer(concreteReferenceOwnerSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.class) { + return createPropertiesGroup(widgetFactory, parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name) { + return createNameText(widgetFactory, parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget) { + return createAbstractTargetReferencesTable(widgetFactory, parent); + } + return parent; + } + }; + composer.compose(view); + } + /** + * + */ + protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { + Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); + propertiesSection.setText(FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); + propertiesSectionData.horizontalSpan = 3; + propertiesSection.setLayoutData(propertiesSectionData); + Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + propertiesSection.setClient(propertiesGroup); + return propertiesGroup; + } + + + protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, FiltersViewsRepository.FORM_KIND)); + name = widgetFactory.createText(parent, ""); //$NON-NLS-1$ + name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + widgetFactory.paintBordersFor(parent); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + /** + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + }); + name.addKeyListener(new KeyAdapter() { + /** + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, FiltersViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected Composite createAbstractTargetReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.abstractTarget = new ReferencesTable(FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel, new ReferencesTableListener () { + public void handleAdd() { addAbstractTarget(); } + public void handleEdit(EObject element) { editAbstractTarget(element); } + public void handleMove(EObject element, int oldIndex, int newIndex) { moveAbstractTarget(element, oldIndex, newIndex); } + public void handleRemove(EObject element) { removeFromAbstractTarget(element); } + public void navigateTo(EObject element) { } + }); + this.abstractTarget.setHelpText(propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, FiltersViewsRepository.FORM_KIND)); + this.abstractTarget.createControls(parent, widgetFactory); + this.abstractTarget.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent e) { + if (e.item != null && e.item.getData() instanceof EObject) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); + } + } + + }); + GridData abstractTargetData = new GridData(GridData.FILL_HORIZONTAL); + abstractTargetData.horizontalSpan = 3; + this.abstractTarget.setLayoutData(abstractTargetData); + this.abstractTarget.disableMove(); + abstractTarget.setID(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget); + abstractTarget.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected void addAbstractTarget() { + TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(abstractTarget.getInput(), abstractTargetFilters, abstractTargetBusinessFilters, + "abstractTarget", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) { + @Override + public void process(IStructuredSelection selection) { + for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject) iter.next(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + abstractTarget.refresh(); + } + }; + dialog.open(); + } + + /** + * + */ + protected void moveAbstractTarget(EObject element, int oldIndex, int newIndex) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void removeFromAbstractTarget(EObject element) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void editAbstractTarget(EObject element) { + EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory); + PropertiesEditingProvider provider = (PropertiesEditingProvider)adapterFactory.adapt(element, PropertiesEditingProvider.class); + if (provider != null) { + PropertiesEditingPolicy policy = provider.getPolicy(context); + if (policy != null) { + policy.execute(); + abstractTarget.refresh(); + } + } + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#initAbstractTarget(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) + */ + public void initAbstractTarget(ReferencesTableSettings settings) { + if (current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); + abstractTarget.setContentProvider(contentProvider); + abstractTarget.setInput(settings); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#updateAbstractTarget() + * + */ + public void updateAbstractTarget() { + abstractTarget.refresh(); +} + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#addFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#addBusinessFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#isContainedInAbstractTargetTable(EObject element) + * + */ + public boolean isContainedInAbstractTargetTable(EObject element) { + return ((ReferencesTableSettings)abstractTarget.getInput()).contains(element); + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceOwnerSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample1PropertiesEditionPartForm.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample1PropertiesEditionPartForm.java new file mode 100644 index 000000000..cd904047c --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample1PropertiesEditionPartForm.java @@ -0,0 +1,222 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.forms; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample1PropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, ConcreteReferenceTargetSample1PropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceTargetSample1PropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) + * + */ + public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { + ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); + Form form = scrolledForm.getForm(); + view = form.getBody(); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(widgetFactory, view); + return scrolledForm; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(final FormToolkit widgetFactory, Composite view) { + CompositionSequence concreteReferenceTargetSample1Step = new CompositionSequence(); + concreteReferenceTargetSample1Step + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.class) + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name); + + + composer = new PartComposer(concreteReferenceTargetSample1Step) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.class) { + return createPropertiesGroup(widgetFactory, parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name) { + return createNameText(widgetFactory, parent); + } + return parent; + } + }; + composer.compose(view); + } + /** + * + */ + protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { + Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); + propertiesSection.setText(FiltersMessages.ConcreteReferenceTargetSample1PropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); + propertiesSectionData.horizontalSpan = 3; + propertiesSection.setLayoutData(propertiesSectionData); + Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + propertiesSection.setClient(propertiesGroup); + return propertiesGroup; + } + + + protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, FiltersMessages.ConcreteReferenceTargetSample1PropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, FiltersViewsRepository.FORM_KIND)); + name = widgetFactory.createText(parent, ""); //$NON-NLS-1$ + name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + widgetFactory.paintBordersFor(parent); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + /** + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample1PropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + }); + name.addKeyListener(new KeyAdapter() { + /** + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample1PropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, FiltersViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceTargetSample1_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample2PropertiesEditionPartForm.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample2PropertiesEditionPartForm.java new file mode 100644 index 000000000..a7d059e44 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/forms/ConcreteReferenceTargetSample2PropertiesEditionPartForm.java @@ -0,0 +1,222 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.forms; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample2PropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, ConcreteReferenceTargetSample2PropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceTargetSample2PropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) + * + */ + public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { + ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); + Form form = scrolledForm.getForm(); + view = form.getBody(); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(widgetFactory, view); + return scrolledForm; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# + * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(final FormToolkit widgetFactory, Composite view) { + CompositionSequence concreteReferenceTargetSample2Step = new CompositionSequence(); + concreteReferenceTargetSample2Step + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.class) + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name); + + + composer = new PartComposer(concreteReferenceTargetSample2Step) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.class) { + return createPropertiesGroup(widgetFactory, parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name) { + return createNameText(widgetFactory, parent); + } + return parent; + } + }; + composer.compose(view); + } + /** + * + */ + protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { + Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); + propertiesSection.setText(FiltersMessages.ConcreteReferenceTargetSample2PropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); + propertiesSectionData.horizontalSpan = 3; + propertiesSection.setLayoutData(propertiesSectionData); + Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + propertiesSection.setClient(propertiesGroup); + return propertiesGroup; + } + + + protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, FiltersMessages.ConcreteReferenceTargetSample2PropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, FiltersViewsRepository.FORM_KIND)); + name = widgetFactory.createText(parent, ""); //$NON-NLS-1$ + name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + widgetFactory.paintBordersFor(parent); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + /** + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample2PropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + }); + name.addKeyListener(new KeyAdapter() { + /** + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample2PropertiesEditionPartForm.this, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, FiltersViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceTargetSample2_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceOwnerSamplePropertiesEditionPartImpl.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceOwnerSamplePropertiesEditionPartImpl.java new file mode 100644 index 000000000..ad464fa2a --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceOwnerSamplePropertiesEditionPartImpl.java @@ -0,0 +1,386 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.impl; + +// Start of user code for imports +import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
+import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceOwnerSamplePropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, AbstractReferenceOwnerSamplePropertiesEditionPart { + + protected Text name; + protected ReferencesTable abstractTarget; + protected List<ViewerFilter> abstractTargetBusinessFilters = new ArrayList<ViewerFilter>(); + protected List<ViewerFilter> abstractTargetFilters = new ArrayList<ViewerFilter>(); + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public AbstractReferenceOwnerSamplePropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite) + * + */ + public Composite createFigure(final Composite parent) { + view = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(view); + return view; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createControls(org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(Composite view) { + CompositionSequence abstractReferenceOwnerSampleStep = new CompositionSequence(); + CompositionStep propertiesStep = abstractReferenceOwnerSampleStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.class); + propertiesStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name); + propertiesStep.addStep(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget); + + + composer = new PartComposer(abstractReferenceOwnerSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.class) { + return createPropertiesGroup(parent); + } + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name) { + return createNameText(parent); + } + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget) { + return createAbstractTargetAdvancedReferencesTable(parent); + } + return parent; + } + }; + composer.compose(view); + } + + /** + * + */ + protected Composite createPropertiesGroup(Composite parent) { + Group propertiesGroup = new Group(parent, SWT.NONE); + propertiesGroup.setText(FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL); + propertiesGroupData.horizontalSpan = 3; + propertiesGroup.setLayoutData(propertiesGroupData); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + return propertiesGroup; + } + + + protected Composite createNameText(Composite parent) { + SWTUtils.createPartLabel(parent, FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, FiltersViewsRepository.SWT_KIND)); + name = new Text(parent, SWT.BORDER); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + EditingUtils.setID(name, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name, FiltersViewsRepository.SWT_KIND), null); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected Composite createAbstractTargetAdvancedReferencesTable(Composite parent) { + this.abstractTarget = new ReferencesTable(FiltersMessages.AbstractReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel, new ReferencesTableListener() { + public void handleAdd() { addAbstractTarget(); } + public void handleEdit(EObject element) { editAbstractTarget(element); } + public void handleMove(EObject element, int oldIndex, int newIndex) { moveAbstractTarget(element, oldIndex, newIndex); } + public void handleRemove(EObject element) { removeFromAbstractTarget(element); } + public void navigateTo(EObject element) { } + }); + this.abstractTarget.setHelpText(propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, FiltersViewsRepository.SWT_KIND)); + this.abstractTarget.createControls(parent); + this.abstractTarget.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent e) { + if (e.item != null && e.item.getData() instanceof EObject) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); + } + } + + }); + GridData abstractTargetData = new GridData(GridData.FILL_HORIZONTAL); + abstractTargetData.horizontalSpan = 3; + this.abstractTarget.setLayoutData(abstractTargetData); + this.abstractTarget.disableMove(); + abstractTarget.setID(FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget); + abstractTarget.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected void addAbstractTarget() { + TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(abstractTarget.getInput(), abstractTargetFilters, abstractTargetBusinessFilters, + "abstractTarget", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) { + @Override + public void process(IStructuredSelection selection) { + for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject) iter.next(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + abstractTarget.refresh(); + } + }; + dialog.open(); + } + + /** + * + */ + protected void moveAbstractTarget(EObject element, int oldIndex, int newIndex) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void removeFromAbstractTarget(EObject element) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void editAbstractTarget(EObject element) { + EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory); + PropertiesEditingProvider provider = (PropertiesEditingProvider)adapterFactory.adapt(element, PropertiesEditingProvider.class); + if (provider != null) { + PropertiesEditingPolicy policy = provider.getPolicy(context); + if (policy != null) { + policy.execute(); + abstractTarget.refresh(); + } + } + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#initAbstractTarget(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) + */ + public void initAbstractTarget(ReferencesTableSettings settings) { + if (current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); + abstractTarget.setContentProvider(contentProvider); + abstractTarget.setInput(settings); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#updateAbstractTarget() + * + */ + public void updateAbstractTarget() { + abstractTarget.refresh(); +} + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#addFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#addBusinessFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart#isContainedInAbstractTargetTable(EObject element) + * + */ + public boolean isContainedInAbstractTargetTable(EObject element) { + return ((ReferencesTableSettings)abstractTarget.getInput()).contains(element); + } + + + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.AbstractReferenceOwnerSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceTargetSamplePropertiesEditionPartImpl.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceTargetSamplePropertiesEditionPartImpl.java new file mode 100644 index 000000000..2ceac4868 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/AbstractReferenceTargetSamplePropertiesEditionPartImpl.java @@ -0,0 +1,225 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.impl; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceTargetSamplePropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, AbstractReferenceTargetSamplePropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public AbstractReferenceTargetSamplePropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite) + * + */ + public Composite createFigure(final Composite parent) { + view = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(view); + return view; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createControls(org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(Composite view) { + CompositionSequence abstractReferenceTargetSampleStep = new CompositionSequence(); + abstractReferenceTargetSampleStep + .addStep(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.class) + .addStep(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name); + + + composer = new PartComposer(abstractReferenceTargetSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.AbstractReferenceTargetSample.Properties.class) { + return createPropertiesGroup(parent); + } + if (key == FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name) { + return createNameText(parent); + } + return parent; + } + }; + composer.compose(view); + } + + /** + * + */ + protected Composite createPropertiesGroup(Composite parent) { + Group propertiesGroup = new Group(parent, SWT.NONE); + propertiesGroup.setText(FiltersMessages.AbstractReferenceTargetSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL); + propertiesGroupData.horizontalSpan = 3; + propertiesGroup.setLayoutData(propertiesGroupData); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + return propertiesGroup; + } + + + protected Composite createNameText(Composite parent) { + SWTUtils.createPartLabel(parent, FiltersMessages.AbstractReferenceTargetSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, FiltersViewsRepository.SWT_KIND)); + name = new Text(parent, SWT.BORDER); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceTargetSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AbstractReferenceTargetSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + EditingUtils.setID(name, FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name, FiltersViewsRepository.SWT_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.AbstractReferenceTargetSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.java new file mode 100644 index 000000000..ab314badf --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.java @@ -0,0 +1,386 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.impl; + +// Start of user code for imports +import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
+import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
+import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceOwnerSamplePropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, ConcreteReferenceOwnerSamplePropertiesEditionPart { + + protected Text name; + protected ReferencesTable abstractTarget; + protected List<ViewerFilter> abstractTargetBusinessFilters = new ArrayList<ViewerFilter>(); + protected List<ViewerFilter> abstractTargetFilters = new ArrayList<ViewerFilter>(); + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceOwnerSamplePropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite) + * + */ + public Composite createFigure(final Composite parent) { + view = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(view); + return view; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createControls(org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(Composite view) { + CompositionSequence concreteReferenceOwnerSampleStep = new CompositionSequence(); + CompositionStep propertiesStep = concreteReferenceOwnerSampleStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.class); + propertiesStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name); + propertiesStep.addStep(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget); + + + composer = new PartComposer(concreteReferenceOwnerSampleStep) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.class) { + return createPropertiesGroup(parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name) { + return createNameText(parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget) { + return createAbstractTargetAdvancedReferencesTable(parent); + } + return parent; + } + }; + composer.compose(view); + } + + /** + * + */ + protected Composite createPropertiesGroup(Composite parent) { + Group propertiesGroup = new Group(parent, SWT.NONE); + propertiesGroup.setText(FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL); + propertiesGroupData.horizontalSpan = 3; + propertiesGroup.setLayoutData(propertiesGroupData); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + return propertiesGroup; + } + + + protected Composite createNameText(Composite parent) { + SWTUtils.createPartLabel(parent, FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, FiltersViewsRepository.SWT_KIND)); + name = new Text(parent, SWT.BORDER); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name, FiltersViewsRepository.SWT_KIND), null); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected Composite createAbstractTargetAdvancedReferencesTable(Composite parent) { + this.abstractTarget = new ReferencesTable(FiltersMessages.ConcreteReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel, new ReferencesTableListener() { + public void handleAdd() { addAbstractTarget(); } + public void handleEdit(EObject element) { editAbstractTarget(element); } + public void handleMove(EObject element, int oldIndex, int newIndex) { moveAbstractTarget(element, oldIndex, newIndex); } + public void handleRemove(EObject element) { removeFromAbstractTarget(element); } + public void navigateTo(EObject element) { } + }); + this.abstractTarget.setHelpText(propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, FiltersViewsRepository.SWT_KIND)); + this.abstractTarget.createControls(parent); + this.abstractTarget.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent e) { + if (e.item != null && e.item.getData() instanceof EObject) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); + } + } + + }); + GridData abstractTargetData = new GridData(GridData.FILL_HORIZONTAL); + abstractTargetData.horizontalSpan = 3; + this.abstractTarget.setLayoutData(abstractTargetData); + this.abstractTarget.disableMove(); + abstractTarget.setID(FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget); + abstractTarget.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ + return parent; + } + + /** + * + */ + protected void addAbstractTarget() { + TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(abstractTarget.getInput(), abstractTargetFilters, abstractTargetBusinessFilters, + "abstractTarget", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) { + @Override + public void process(IStructuredSelection selection) { + for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject) iter.next(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + abstractTarget.refresh(); + } + }; + dialog.open(); + } + + /** + * + */ + protected void moveAbstractTarget(EObject element, int oldIndex, int newIndex) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void removeFromAbstractTarget(EObject element) { + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceOwnerSamplePropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); + abstractTarget.refresh(); + } + + /** + * + */ + protected void editAbstractTarget(EObject element) { + EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(propertiesEditionComponent.getEditingContext(), propertiesEditionComponent, element, adapterFactory); + PropertiesEditingProvider provider = (PropertiesEditingProvider)adapterFactory.adapt(element, PropertiesEditingProvider.class); + if (provider != null) { + PropertiesEditingPolicy policy = provider.getPolicy(context); + if (policy != null) { + policy.execute(); + abstractTarget.refresh(); + } + } + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#initAbstractTarget(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) + */ + public void initAbstractTarget(ReferencesTableSettings settings) { + if (current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); + abstractTarget.setContentProvider(contentProvider); + abstractTarget.setInput(settings); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#updateAbstractTarget() + * + */ + public void updateAbstractTarget() { + abstractTarget.refresh(); +} + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#addFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#addBusinessFilterAbstractTarget(ViewerFilter filter) + * + */ + public void addBusinessFilterToAbstractTarget(ViewerFilter filter) { + abstractTargetBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart#isContainedInAbstractTargetTable(EObject element) + * + */ + public boolean isContainedInAbstractTargetTable(EObject element) { + return ((ReferencesTableSettings)abstractTarget.getInput()).contains(element); + } + + + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceOwnerSample_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample1PropertiesEditionPartImpl.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample1PropertiesEditionPartImpl.java new file mode 100644 index 000000000..7a96f0a79 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample1PropertiesEditionPartImpl.java @@ -0,0 +1,225 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.impl; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample1PropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, ConcreteReferenceTargetSample1PropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceTargetSample1PropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite) + * + */ + public Composite createFigure(final Composite parent) { + view = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(view); + return view; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createControls(org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(Composite view) { + CompositionSequence concreteReferenceTargetSample1Step = new CompositionSequence(); + concreteReferenceTargetSample1Step + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.class) + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name); + + + composer = new PartComposer(concreteReferenceTargetSample1Step) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.class) { + return createPropertiesGroup(parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name) { + return createNameText(parent); + } + return parent; + } + }; + composer.compose(view); + } + + /** + * + */ + protected Composite createPropertiesGroup(Composite parent) { + Group propertiesGroup = new Group(parent, SWT.NONE); + propertiesGroup.setText(FiltersMessages.ConcreteReferenceTargetSample1PropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL); + propertiesGroupData.horizontalSpan = 3; + propertiesGroup.setLayoutData(propertiesGroupData); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + return propertiesGroup; + } + + + protected Composite createNameText(Composite parent) { + SWTUtils.createPartLabel(parent, FiltersMessages.ConcreteReferenceTargetSample1PropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, FiltersViewsRepository.SWT_KIND)); + name = new Text(parent, SWT.BORDER); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample1PropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample1PropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name, FiltersViewsRepository.SWT_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceTargetSample1_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample2PropertiesEditionPartImpl.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample2PropertiesEditionPartImpl.java new file mode 100644 index 000000000..2a6bddfdd --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/parts/impl/ConcreteReferenceTargetSample2PropertiesEditionPartImpl.java @@ -0,0 +1,225 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.parts.impl; + +// Start of user code for imports +import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.providers.FiltersMessages;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
+import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
+import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample2PropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, ConcreteReferenceTargetSample2PropertiesEditionPart { + + protected Text name; + + + + /** + * Default constructor + * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part + * + */ + public ConcreteReferenceTargetSample2PropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) { + super(editionComponent); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createFigure(org.eclipse.swt.widgets.Composite) + * + */ + public Composite createFigure(final Composite parent) { + view = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + view.setLayout(layout); + createControls(view); + return view; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart# + * createControls(org.eclipse.swt.widgets.Composite) + * + */ + public void createControls(Composite view) { + CompositionSequence concreteReferenceTargetSample2Step = new CompositionSequence(); + concreteReferenceTargetSample2Step + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.class) + .addStep(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name); + + + composer = new PartComposer(concreteReferenceTargetSample2Step) { + + @Override + public Composite addToPart(Composite parent, Object key) { + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.class) { + return createPropertiesGroup(parent); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name) { + return createNameText(parent); + } + return parent; + } + }; + composer.compose(view); + } + + /** + * + */ + protected Composite createPropertiesGroup(Composite parent) { + Group propertiesGroup = new Group(parent, SWT.NONE); + propertiesGroup.setText(FiltersMessages.ConcreteReferenceTargetSample2PropertiesEditionPart_PropertiesGroupLabel); + GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL); + propertiesGroupData.horizontalSpan = 3; + propertiesGroup.setLayoutData(propertiesGroupData); + GridLayout propertiesGroupLayout = new GridLayout(); + propertiesGroupLayout.numColumns = 3; + propertiesGroup.setLayout(propertiesGroupLayout); + return propertiesGroup; + } + + + protected Composite createNameText(Composite parent) { + SWTUtils.createPartLabel(parent, FiltersMessages.ConcreteReferenceTargetSample2PropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, FiltersViewsRepository.SWT_KIND)); + name = new Text(parent, SWT.BORDER); + GridData nameData = new GridData(GridData.FILL_HORIZONTAL); + name.setLayoutData(nameData); + name.addFocusListener(new FocusAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void focusLost(FocusEvent e) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample2PropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + * + */ + @Override + @SuppressWarnings("synthetic-access") + public void keyPressed(KeyEvent e) { + if (e.character == SWT.CR) { + if (propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConcreteReferenceTargetSample2PropertiesEditionPartImpl.this, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + EditingUtils.setID(name, FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name); + EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ + SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name, FiltersViewsRepository.SWT_KIND), null); //$NON-NLS-1$ + return parent; + } + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void firePropertiesChanged(IPropertiesEditionEvent event) { + // Start of user code for tab synchronization + +// End of user code + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart#getName() + * + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart#setName(String newValue) + * + */ + public void setName(String newValue) { + if (newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() + * + */ + public String getTitle() { + return FiltersMessages.ConcreteReferenceTargetSample2_Part_Title; + } + + // Start of user code additional methods + + // End of user code + + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersMessages.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersMessages.java new file mode 100644 index 000000000..46bd62f3f --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersMessages.java @@ -0,0 +1,150 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.providers; + +import org.eclipse.osgi.util.NLS;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class FiltersMessages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.emf.eef.eefnr.filters.providers.filtersMessages"; //$NON-NLS-1$ + + + public static String AbstractReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel; + + + public static String AbstractReferenceTargetSamplePropertiesEditionPart_PropertiesGroupLabel; + + + public static String ConcreteReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel; + + + public static String ConcreteReferenceTargetSample1PropertiesEditionPart_PropertiesGroupLabel; + + + public static String ConcreteReferenceTargetSample2PropertiesEditionPart_PropertiesGroupLabel; + + + public static String AbstractReferenceOwnerSample_ReadOnly; + + + public static String AbstractReferenceOwnerSample_Part_Title; + + + public static String AbstractReferenceTargetSample_ReadOnly; + + + public static String AbstractReferenceTargetSample_Part_Title; + + + public static String ConcreteReferenceOwnerSample_ReadOnly; + + + public static String ConcreteReferenceOwnerSample_Part_Title; + + + public static String ConcreteReferenceTargetSample1_ReadOnly; + + + public static String ConcreteReferenceTargetSample1_Part_Title; + + + public static String ConcreteReferenceTargetSample2_ReadOnly; + + + public static String ConcreteReferenceTargetSample2_Part_Title; + + + public static String AbstractReferenceOwnerSamplePropertiesEditionPart_NameLabel; + + + public static String AbstractReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel; + + + public static String AbstractReferenceTargetSamplePropertiesEditionPart_NameLabel; + + + public static String ConcreteReferenceOwnerSamplePropertiesEditionPart_NameLabel; + + + public static String ConcreteReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel; + + + public static String ConcreteReferenceTargetSample1PropertiesEditionPart_NameLabel; + + + public static String ConcreteReferenceTargetSample2PropertiesEditionPart_NameLabel; + + + public static String PropertiesEditionPart_DocumentationLabel; + + + public static String PropertiesEditionPart_IntegerValueMessage; + + + public static String PropertiesEditionPart_FloatValueMessage; + + + public static String PropertiesEditionPart_ShortValueMessage; + + + public static String PropertiesEditionPart_LongValueMessage; + + + public static String PropertiesEditionPart_ByteValueMessage; + + + public static String PropertiesEditionPart_BigIntegerValueMessage; + + + public static String PropertiesEditionPart_BigDecimalValueMessage; + + + public static String PropertiesEditionPart_DoubleValueMessage; + + + public static String PropertiesEditionPart_PropertiesGroupLabel; + + + public static String PropertiesEditionPart_RequiredFeatureMessage; + + + public static String PropertiesEditionPart_AddTableViewerLabel; + + + public static String PropertiesEditionPart_EditTableViewerLabel; + + + public static String PropertiesEditionPart_RemoveTableViewerLabel; + + + public static String PropertiesEditionPart_AddListViewerLabel; + + + public static String PropertiesEditionPart_RemoveListViewerLabel; + + // Start of user code for additionnal NLS Constants + +// End of user code + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, FiltersMessages.class); + } + + + private FiltersMessages() { + //protect instanciation + } +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersPropertiesEditionPartProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersPropertiesEditionPartProvider.java new file mode 100644 index 000000000..e811fe5b6 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/FiltersPropertiesEditionPartProvider.java @@ -0,0 +1,85 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.filters.providers; + +import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.eefnr.filters.parts.forms.AbstractReferenceOwnerSamplePropertiesEditionPartForm;
+import org.eclipse.emf.eef.eefnr.filters.parts.forms.AbstractReferenceTargetSamplePropertiesEditionPartForm;
+import org.eclipse.emf.eef.eefnr.filters.parts.forms.ConcreteReferenceOwnerSamplePropertiesEditionPartForm;
+import org.eclipse.emf.eef.eefnr.filters.parts.forms.ConcreteReferenceTargetSample1PropertiesEditionPartForm;
+import org.eclipse.emf.eef.eefnr.filters.parts.forms.ConcreteReferenceTargetSample2PropertiesEditionPartForm;
+import org.eclipse.emf.eef.eefnr.filters.parts.impl.AbstractReferenceOwnerSamplePropertiesEditionPartImpl;
+import org.eclipse.emf.eef.eefnr.filters.parts.impl.AbstractReferenceTargetSamplePropertiesEditionPartImpl;
+import org.eclipse.emf.eef.eefnr.filters.parts.impl.ConcreteReferenceOwnerSamplePropertiesEditionPartImpl;
+import org.eclipse.emf.eef.eefnr.filters.parts.impl.ConcreteReferenceTargetSample1PropertiesEditionPartImpl;
+import org.eclipse.emf.eef.eefnr.filters.parts.impl.ConcreteReferenceTargetSample2PropertiesEditionPartImpl;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPartProvider;
+ + + + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class FiltersPropertiesEditionPartProvider implements IPropertiesEditionPartProvider { + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPartProvider#provides(java.lang.Object) + * + */ + public boolean provides(Object key) { + return key == FiltersViewsRepository.class; + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPartProvider#getPropertiesEditionPart(java.lang.Object, int, org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent) + * + */ + public IPropertiesEditionPart getPropertiesEditionPart(Object key, int kind, IPropertiesEditionComponent component) { + if (key == FiltersViewsRepository.AbstractReferenceOwnerSample.class) { + if (kind == FiltersViewsRepository.SWT_KIND) + return new AbstractReferenceOwnerSamplePropertiesEditionPartImpl(component); + if (kind == FiltersViewsRepository.FORM_KIND) + return new AbstractReferenceOwnerSamplePropertiesEditionPartForm(component); + } + if (key == FiltersViewsRepository.AbstractReferenceTargetSample.class) { + if (kind == FiltersViewsRepository.SWT_KIND) + return new AbstractReferenceTargetSamplePropertiesEditionPartImpl(component); + if (kind == FiltersViewsRepository.FORM_KIND) + return new AbstractReferenceTargetSamplePropertiesEditionPartForm(component); + } + if (key == FiltersViewsRepository.ConcreteReferenceOwnerSample.class) { + if (kind == FiltersViewsRepository.SWT_KIND) + return new ConcreteReferenceOwnerSamplePropertiesEditionPartImpl(component); + if (kind == FiltersViewsRepository.FORM_KIND) + return new ConcreteReferenceOwnerSamplePropertiesEditionPartForm(component); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample1.class) { + if (kind == FiltersViewsRepository.SWT_KIND) + return new ConcreteReferenceTargetSample1PropertiesEditionPartImpl(component); + if (kind == FiltersViewsRepository.FORM_KIND) + return new ConcreteReferenceTargetSample1PropertiesEditionPartForm(component); + } + if (key == FiltersViewsRepository.ConcreteReferenceTargetSample2.class) { + if (kind == FiltersViewsRepository.SWT_KIND) + return new ConcreteReferenceTargetSample2PropertiesEditionPartImpl(component); + if (kind == FiltersViewsRepository.FORM_KIND) + return new ConcreteReferenceTargetSample2PropertiesEditionPartForm(component); + } + return null; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages.properties b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages.properties new file mode 100644 index 000000000..9149f56bf --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages.properties @@ -0,0 +1,54 @@ +#*****************************************************************************
+# Copyright (c) 2009 - 2010 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+#******************************************************************************/ + +# Start of user code for titles customization + +# End of user code + +# default values ... +AbstractReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +AbstractReferenceTargetSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceTargetSample1PropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceTargetSample2PropertiesEditionPart_PropertiesGroupLabel=Properties +AbstractReferenceOwnerSample_ReadOnly=This property is read only +AbstractReferenceOwnerSample_Part_Title=AbstractReferenceOwnerSample +AbstractReferenceTargetSample_ReadOnly=This property is read only +AbstractReferenceTargetSample_Part_Title=AbstractReferenceTargetSample +ConcreteReferenceOwnerSample_ReadOnly=This property is read only +ConcreteReferenceOwnerSample_Part_Title=ConcreteReferenceOwnerSample +ConcreteReferenceTargetSample1_ReadOnly=This property is read only +ConcreteReferenceTargetSample1_Part_Title=ConcreteReferenceTargetSample1 +ConcreteReferenceTargetSample2_ReadOnly=This property is read only +ConcreteReferenceTargetSample2_Part_Title=ConcreteReferenceTargetSample2 +AbstractReferenceOwnerSamplePropertiesEditionPart_NameLabel=Name : +AbstractReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel=AbstractTarget : +AbstractReferenceTargetSamplePropertiesEditionPart_NameLabel=Name : +ConcreteReferenceOwnerSamplePropertiesEditionPart_NameLabel=Name : +ConcreteReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel=AbstractTarget : +ConcreteReferenceTargetSample1PropertiesEditionPart_NameLabel=Name : +ConcreteReferenceTargetSample2PropertiesEditionPart_NameLabel=Name : +PropertiesEditionPart_PropertiesGroupLabel=Properties +PropertiesEditionPart_EditTableViewerLabel=Edit +PropertiesEditionPart_DocumentationLabel=Documentation +PropertiesEditionPart_RequiredFeatureMessage=The property {0} of the object shall be filled +PropertiesEditionPart_RemoveTableViewerLabel=Delete +PropertiesEditionPart_RemoveListViewerLabel=Delete +PropertiesEditionPart_IntegerValueMessage=The property {0} shall be an integer +PropertiesEditionPart_FloatValueMessage=The property {0} shall be a float +PropertiesEditionPart_ShortValueMessage=The property {0} shall be a short +PropertiesEditionPart_DoubleValueMessage=The property {0} shall be a double +PropertiesEditionPart_ByteValueMessage=The property {0} shall be a byte +PropertiesEditionPart_LongValueMessage=The property {0} shall be a long +PropertiesEditionPart_BigIntegerValueMessage=The property {0} shall be a BigInteger +PropertiesEditionPart_BigDecimalValueMessage=The property {0} shall be a BigDecimal +PropertiesEditionPart_AddTableViewerLabel=Add +PropertiesEditionPart_AddListViewerLabel=Add diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages_fr.properties b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages_fr.properties new file mode 100644 index 000000000..c8b95360a --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/filters/providers/filtersMessages_fr.properties @@ -0,0 +1,54 @@ +#*****************************************************************************
+# Copyright (c) 2009 - 2010 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+#******************************************************************************/ + +# Start of user code for titles customization + +# End of user code + +# default values ... +AbstractReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +AbstractReferenceTargetSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceOwnerSamplePropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceTargetSample1PropertiesEditionPart_PropertiesGroupLabel=Properties +ConcreteReferenceTargetSample2PropertiesEditionPart_PropertiesGroupLabel=Properties +AbstractReferenceOwnerSample_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule +AbstractReferenceOwnerSample_Part_Title=AbstractReferenceOwnerSample +AbstractReferenceTargetSample_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule +AbstractReferenceTargetSample_Part_Title=AbstractReferenceTargetSample +ConcreteReferenceOwnerSample_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule +ConcreteReferenceOwnerSample_Part_Title=ConcreteReferenceOwnerSample +ConcreteReferenceTargetSample1_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule +ConcreteReferenceTargetSample1_Part_Title=ConcreteReferenceTargetSample1 +ConcreteReferenceTargetSample2_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule +ConcreteReferenceTargetSample2_Part_Title=ConcreteReferenceTargetSample2 +AbstractReferenceOwnerSamplePropertiesEditionPart_NameLabel=Name : +AbstractReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel=AbstractTarget : +AbstractReferenceTargetSamplePropertiesEditionPart_NameLabel=Name : +ConcreteReferenceOwnerSamplePropertiesEditionPart_NameLabel=Name : +ConcreteReferenceOwnerSamplePropertiesEditionPart_AbstractTargetLabel=AbstractTarget : +ConcreteReferenceTargetSample1PropertiesEditionPart_NameLabel=Name : +ConcreteReferenceTargetSample2PropertiesEditionPart_NameLabel=Name : +PropertiesEditionPart_PropertiesGroupLabel=Propri\u00E9t\u00E9s +PropertiesEditionPart_EditTableViewerLabel=Editer +PropertiesEditionPart_DocumentationLabel=Documentation +PropertiesEditionPart_RequiredFeatureMessage=La propri\u00E9t\u00E9 {0} de l\u0027objet doit \u00EAtre renseign\u00E9e +PropertiesEditionPart_RemoveTableViewerLabel=Supprimer +PropertiesEditionPart_RemoveListViewerLabel=Supprimer +PropertiesEditionPart_IntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un entier +PropertiesEditionPart_FloatValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un flottant +PropertiesEditionPart_ShortValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un short +PropertiesEditionPart_DoubleValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un double +PropertiesEditionPart_ByteValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un byte +PropertiesEditionPart_LongValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un long +PropertiesEditionPart_BigIntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigInteger +PropertiesEditionPart_BigDecimalValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigDecimal +PropertiesEditionPart_AddTableViewerLabel=Ajouter +PropertiesEditionPart_AddListViewerLabel=Ajouter diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/providers/FiltersEEFAdapterFactory.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/providers/FiltersEEFAdapterFactory.java new file mode 100644 index 000000000..4b54b7e46 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/eefnr/providers/FiltersEEFAdapterFactory.java @@ -0,0 +1,78 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.eefnr.providers; + +import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory;
+import org.eclipse.emf.eef.filters.providers.AbstractReferenceOwnerSamplePropertiesEditionProvider;
+import org.eclipse.emf.eef.filters.providers.AbstractReferenceTargetSamplePropertiesEditionProvider;
+import org.eclipse.emf.eef.filters.providers.ConcreteReferenceOwnerSamplePropertiesEditionProvider;
+import org.eclipse.emf.eef.filters.providers.ConcreteReferenceTargetSample1PropertiesEditionProvider;
+import org.eclipse.emf.eef.filters.providers.ConcreteReferenceTargetSample2PropertiesEditionProvider;
+import org.eclipse.emf.eef.references.providers.AbstractSamplePropertiesEditionProvider;
+ + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class FiltersEEFAdapterFactory extends FiltersAdapterFactory { + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractSampleAdapter() + * + */ + public Adapter createAbstractSampleAdapter() { + return new AbstractSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractReferenceOwnerSampleAdapter() + * + */ + public Adapter createAbstractReferenceOwnerSampleAdapter() { + return new AbstractReferenceOwnerSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractReferenceTargetSampleAdapter() + * + */ + public Adapter createAbstractReferenceTargetSampleAdapter() { + return new AbstractReferenceTargetSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceOwnerSampleAdapter() + * + */ + public Adapter createConcreteReferenceOwnerSampleAdapter() { + return new ConcreteReferenceOwnerSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceTargetSample1Adapter() + * + */ + public Adapter createConcreteReferenceTargetSample1Adapter() { + return new ConcreteReferenceTargetSample1PropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceTargetSample2Adapter() + * + */ + public Adapter createConcreteReferenceTargetSample2Adapter() { + return new ConcreteReferenceTargetSample2PropertiesEditionProvider(); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceOwnerSamplePropertiesEditionComponent.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceOwnerSamplePropertiesEditionComponent.java new file mode 100644 index 000000000..16bc8cef7 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceOwnerSamplePropertiesEditionComponent.java @@ -0,0 +1,189 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.components; + +// Start of user code for imports +import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.eef.eefnr.EefnrPackage;
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample;
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;
+import org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceOwnerSamplePropertiesEditionComponent extends SinglePartPropertiesEditingComponent { + + + public static String BASE_PART = "Base"; //$NON-NLS-1$ + + + /** + * Settings for abstractTarget ReferencesTable + */ + private ReferencesTableSettings abstractTargetSettings; + + /** + * Default constructor + * + */ + public AbstractReferenceOwnerSamplePropertiesEditionComponent(PropertiesEditingContext editingContext, EObject abstractReferenceOwnerSample, String editing_mode) { + super(editingContext, abstractReferenceOwnerSample, editing_mode); + parts = new String[] { BASE_PART }; + repositoryKey = FiltersViewsRepository.class; + partKey = FiltersViewsRepository.AbstractReferenceOwnerSample.class; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject, + * org.eclipse.emf.ecore.resource.ResourceSet) + * + */ + public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) { + setInitializing(true); + if (editingPart != null && key == partKey) { + editingPart.setContext(elt, allResource); + final AbstractReferenceOwnerSample abstractReferenceOwnerSample = (AbstractReferenceOwnerSample)elt; + final AbstractReferenceOwnerSamplePropertiesEditionPart basePart = (AbstractReferenceOwnerSamplePropertiesEditionPart)editingPart; + // init values + if (abstractReferenceOwnerSample.getName() != null) + basePart.setName(EEFConverterUtil.convertToString(EcorePackage.eINSTANCE.getEString(), abstractReferenceOwnerSample.getName())); + + abstractTargetSettings = new ReferencesTableSettings(abstractReferenceOwnerSample, FiltersPackage.eINSTANCE.getAbstractReferenceOwnerSample_AbstractTarget()); + basePart.initAbstractTarget(abstractTargetSettings); + // init filters + + basePart.addFilterToAbstractTarget(new ViewerFilter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ + public boolean select(Viewer viewer, Object parentElement, Object element) { + if (element instanceof EObject) + return (!basePart.isContainedInAbstractTargetTable((EObject)element)); + return element instanceof Resource; + } + + }); + basePart.addFilterToAbstractTarget(new EObjectFilter(FiltersPackage.eINSTANCE.getAbstractReferenceTargetSample())); + // Start of user code for additional businessfilters for abstractTarget + + // End of user code + + // init values for referenced views + + // init filters for referenced views + + } + setInitializing(false); + } + + + + + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void updateSemanticModel(final IPropertiesEditionEvent event) { + AbstractReferenceOwnerSample abstractReferenceOwnerSample = (AbstractReferenceOwnerSample)semanticObject; + if (FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name == event.getAffectedEditor()) { + abstractReferenceOwnerSample.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.eINSTANCE.getEString(), (String)event.getNewValue())); + } + if (FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.abstractTarget == event.getAffectedEditor()) { + if (event.getKind() == PropertiesEditionEvent.ADD) { + if (event.getNewValue() instanceof AbstractReferenceTargetSample) { + abstractTargetSettings.addToReference((EObject) event.getNewValue()); + } + } else if (event.getKind() == PropertiesEditionEvent.REMOVE) { + abstractTargetSettings.removeFromReference((EObject) event.getNewValue()); + } + } + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) + */ + public void updatePart(Notification msg) { + if (editingPart.isVisible()) { + AbstractReferenceOwnerSamplePropertiesEditionPart basePart = (AbstractReferenceOwnerSamplePropertiesEditionPart)editingPart; + if (EefnrPackage.eINSTANCE.getAbstractSample_Name().equals(msg.getFeature()) && basePart != null){ + if (msg.getNewValue() != null) { + basePart.setName(EcoreUtil.convertToString(EcorePackage.eINSTANCE.getEString(), msg.getNewValue())); + } else { + basePart.setName(""); + } + } + if (FiltersPackage.eINSTANCE.getAbstractReferenceOwnerSample_AbstractTarget().equals(msg.getFeature())) + basePart.updateAbstractTarget(); + + } + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public Diagnostic validateValue(IPropertiesEditionEvent event) { + Diagnostic ret = Diagnostic.OK_INSTANCE; + if (event.getNewValue() != null) { + try { + if (FiltersViewsRepository.AbstractReferenceOwnerSample.Properties.name == event.getAffectedEditor()) { + Object newValue = event.getNewValue(); + if (newValue instanceof String) { + newValue = EcoreUtil.createFromString(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), (String)newValue); + } + ret = Diagnostician.INSTANCE.validate(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), newValue); + } + } catch (IllegalArgumentException iae) { + ret = BasicDiagnostic.toDiagnostic(iae); + } catch (WrappedException we) { + ret = BasicDiagnostic.toDiagnostic(we); + } + } + return ret; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceTargetSamplePropertiesEditionComponent.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceTargetSamplePropertiesEditionComponent.java new file mode 100644 index 000000000..dd0778366 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/AbstractReferenceTargetSamplePropertiesEditionComponent.java @@ -0,0 +1,143 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.components; + +// Start of user code for imports +import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.eef.eefnr.EefnrPackage;
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample;
+import org.eclipse.emf.eef.eefnr.filters.parts.AbstractReferenceTargetSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceTargetSamplePropertiesEditionComponent extends SinglePartPropertiesEditingComponent { + + + public static String BASE_PART = "Base"; //$NON-NLS-1$ + + + /** + * Default constructor + * + */ + public AbstractReferenceTargetSamplePropertiesEditionComponent(PropertiesEditingContext editingContext, EObject abstractReferenceTargetSample, String editing_mode) { + super(editingContext, abstractReferenceTargetSample, editing_mode); + parts = new String[] { BASE_PART }; + repositoryKey = FiltersViewsRepository.class; + partKey = FiltersViewsRepository.AbstractReferenceTargetSample.class; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject, + * org.eclipse.emf.ecore.resource.ResourceSet) + * + */ + public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) { + setInitializing(true); + if (editingPart != null && key == partKey) { + editingPart.setContext(elt, allResource); + final AbstractReferenceTargetSample abstractReferenceTargetSample = (AbstractReferenceTargetSample)elt; + final AbstractReferenceTargetSamplePropertiesEditionPart basePart = (AbstractReferenceTargetSamplePropertiesEditionPart)editingPart; + // init values + if (abstractReferenceTargetSample.getName() != null) + basePart.setName(EEFConverterUtil.convertToString(EcorePackage.eINSTANCE.getEString(), abstractReferenceTargetSample.getName())); + + // init filters + + // init values for referenced views + + // init filters for referenced views + + } + setInitializing(false); + } + + + + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void updateSemanticModel(final IPropertiesEditionEvent event) { + AbstractReferenceTargetSample abstractReferenceTargetSample = (AbstractReferenceTargetSample)semanticObject; + if (FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name == event.getAffectedEditor()) { + abstractReferenceTargetSample.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.eINSTANCE.getEString(), (String)event.getNewValue())); + } + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) + */ + public void updatePart(Notification msg) { + if (editingPart.isVisible()) { + AbstractReferenceTargetSamplePropertiesEditionPart basePart = (AbstractReferenceTargetSamplePropertiesEditionPart)editingPart; + if (EefnrPackage.eINSTANCE.getAbstractSample_Name().equals(msg.getFeature()) && basePart != null){ + if (msg.getNewValue() != null) { + basePart.setName(EcoreUtil.convertToString(EcorePackage.eINSTANCE.getEString(), msg.getNewValue())); + } else { + basePart.setName(""); + } + } + + } + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public Diagnostic validateValue(IPropertiesEditionEvent event) { + Diagnostic ret = Diagnostic.OK_INSTANCE; + if (event.getNewValue() != null) { + try { + if (FiltersViewsRepository.AbstractReferenceTargetSample.Properties.name == event.getAffectedEditor()) { + Object newValue = event.getNewValue(); + if (newValue instanceof String) { + newValue = EcoreUtil.createFromString(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), (String)newValue); + } + ret = Diagnostician.INSTANCE.validate(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), newValue); + } + } catch (IllegalArgumentException iae) { + ret = BasicDiagnostic.toDiagnostic(iae); + } catch (WrappedException we) { + ret = BasicDiagnostic.toDiagnostic(we); + } + } + return ret; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceOwnerSamplePropertiesEditionComponent.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceOwnerSamplePropertiesEditionComponent.java new file mode 100644 index 000000000..f93e238d5 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceOwnerSamplePropertiesEditionComponent.java @@ -0,0 +1,209 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.components; + +// Start of user code for imports +import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.eef.eefnr.EefnrPackage;
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample;
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceOwnerSamplePropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;
+import org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFUtils;
+import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceOwnerSamplePropertiesEditionComponent extends SinglePartPropertiesEditingComponent { + + + public static String BASE_PART = "Base"; //$NON-NLS-1$ + + + /** + * Settings for abstractTarget ReferencesTable + */ + private ReferencesTableSettings abstractTargetSettings; + + /** + * Default constructor + * + */ + public ConcreteReferenceOwnerSamplePropertiesEditionComponent(PropertiesEditingContext editingContext, EObject concreteReferenceOwnerSample, String editing_mode) { + super(editingContext, concreteReferenceOwnerSample, editing_mode); + parts = new String[] { BASE_PART }; + repositoryKey = FiltersViewsRepository.class; + partKey = FiltersViewsRepository.ConcreteReferenceOwnerSample.class; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject, + * org.eclipse.emf.ecore.resource.ResourceSet) + * + */ + public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) { + setInitializing(true); + if (editingPart != null && key == partKey) { + editingPart.setContext(elt, allResource); + final ConcreteReferenceOwnerSample concreteReferenceOwnerSample = (ConcreteReferenceOwnerSample)elt; + final ConcreteReferenceOwnerSamplePropertiesEditionPart basePart = (ConcreteReferenceOwnerSamplePropertiesEditionPart)editingPart; + // init values + if (concreteReferenceOwnerSample.getName() != null) + basePart.setName(EEFConverterUtil.convertToString(EcorePackage.eINSTANCE.getEString(), concreteReferenceOwnerSample.getName())); + + abstractTargetSettings = new ReferencesTableSettings(concreteReferenceOwnerSample, FiltersPackage.eINSTANCE.getAbstractReferenceOwnerSample_AbstractTarget()); + basePart.initAbstractTarget(abstractTargetSettings); + // init filters + + basePart.addFilterToAbstractTarget(new ViewerFilter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ + public boolean select(Viewer viewer, Object parentElement, Object element) { + if (element instanceof EObject) + return (!basePart.isContainedInAbstractTargetTable((EObject)element)); + return element instanceof Resource; + } + + }); + basePart.addFilterToAbstractTarget(new EObjectFilter(FiltersPackage.eINSTANCE.getAbstractReferenceTargetSample())); + basePart.addFilterToAbstractTarget(new ViewerFilter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ + public boolean select(Viewer viewer, Object parentElement, Object element) { + Object result = EEFUtils.choiceOfValues(ConcreteReferenceOwnerSamplePropertiesEditionComponent.this.semanticObject, FiltersPackage.eINSTANCE.getConcreteReferenceOwnerSample_Target()); + if (result instanceof Collection) { + return ((Collection)result).contains(element); + } else if (result instanceof ResourceSet && element instanceof EObject) { + return ((EObject)element).eResource() != null && ((EObject)element).eResource().getResourceSet() != null && ((EObject)element).eResource().getResourceSet().equals(result); + } + return element instanceof Resource; + } + }); + // Start of user code for additional businessfilters for abstractTarget + + // End of user code + + // init values for referenced views + + // init filters for referenced views + + } + setInitializing(false); + } + + + + + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void updateSemanticModel(final IPropertiesEditionEvent event) { + ConcreteReferenceOwnerSample concreteReferenceOwnerSample = (ConcreteReferenceOwnerSample)semanticObject; + if (FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name == event.getAffectedEditor()) { + concreteReferenceOwnerSample.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.eINSTANCE.getEString(), (String)event.getNewValue())); + } + if (FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.abstractTarget == event.getAffectedEditor()) { + if (event.getKind() == PropertiesEditionEvent.ADD) { + if (event.getNewValue() instanceof AbstractReferenceTargetSample) { + abstractTargetSettings.addToReference((EObject) event.getNewValue()); + } + } else if (event.getKind() == PropertiesEditionEvent.REMOVE) { + abstractTargetSettings.removeFromReference((EObject) event.getNewValue()); + } + } + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) + */ + public void updatePart(Notification msg) { + if (editingPart.isVisible()) { + ConcreteReferenceOwnerSamplePropertiesEditionPart basePart = (ConcreteReferenceOwnerSamplePropertiesEditionPart)editingPart; + if (EefnrPackage.eINSTANCE.getAbstractSample_Name().equals(msg.getFeature()) && basePart != null){ + if (msg.getNewValue() != null) { + basePart.setName(EcoreUtil.convertToString(EcorePackage.eINSTANCE.getEString(), msg.getNewValue())); + } else { + basePart.setName(""); + } + } + if (FiltersPackage.eINSTANCE.getAbstractReferenceOwnerSample_AbstractTarget().equals(msg.getFeature())) + basePart.updateAbstractTarget(); + + } + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public Diagnostic validateValue(IPropertiesEditionEvent event) { + Diagnostic ret = Diagnostic.OK_INSTANCE; + if (event.getNewValue() != null) { + try { + if (FiltersViewsRepository.ConcreteReferenceOwnerSample.Properties.name == event.getAffectedEditor()) { + Object newValue = event.getNewValue(); + if (newValue instanceof String) { + newValue = EcoreUtil.createFromString(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), (String)newValue); + } + ret = Diagnostician.INSTANCE.validate(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), newValue); + } + } catch (IllegalArgumentException iae) { + ret = BasicDiagnostic.toDiagnostic(iae); + } catch (WrappedException we) { + ret = BasicDiagnostic.toDiagnostic(we); + } + } + return ret; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample1PropertiesEditionComponent.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample1PropertiesEditionComponent.java new file mode 100644 index 000000000..96b57f50d --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample1PropertiesEditionComponent.java @@ -0,0 +1,143 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.components; + +// Start of user code for imports +import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.eef.eefnr.EefnrPackage;
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1;
+import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample1PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample1PropertiesEditionComponent extends SinglePartPropertiesEditingComponent { + + + public static String BASE_PART = "Base"; //$NON-NLS-1$ + + + /** + * Default constructor + * + */ + public ConcreteReferenceTargetSample1PropertiesEditionComponent(PropertiesEditingContext editingContext, EObject concreteReferenceTargetSample1, String editing_mode) { + super(editingContext, concreteReferenceTargetSample1, editing_mode); + parts = new String[] { BASE_PART }; + repositoryKey = FiltersViewsRepository.class; + partKey = FiltersViewsRepository.ConcreteReferenceTargetSample1.class; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject, + * org.eclipse.emf.ecore.resource.ResourceSet) + * + */ + public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) { + setInitializing(true); + if (editingPart != null && key == partKey) { + editingPart.setContext(elt, allResource); + final ConcreteReferenceTargetSample1 concreteReferenceTargetSample1 = (ConcreteReferenceTargetSample1)elt; + final ConcreteReferenceTargetSample1PropertiesEditionPart basePart = (ConcreteReferenceTargetSample1PropertiesEditionPart)editingPart; + // init values + if (concreteReferenceTargetSample1.getName() != null) + basePart.setName(EEFConverterUtil.convertToString(EcorePackage.eINSTANCE.getEString(), concreteReferenceTargetSample1.getName())); + + // init filters + + // init values for referenced views + + // init filters for referenced views + + } + setInitializing(false); + } + + + + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void updateSemanticModel(final IPropertiesEditionEvent event) { + ConcreteReferenceTargetSample1 concreteReferenceTargetSample1 = (ConcreteReferenceTargetSample1)semanticObject; + if (FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name == event.getAffectedEditor()) { + concreteReferenceTargetSample1.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.eINSTANCE.getEString(), (String)event.getNewValue())); + } + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) + */ + public void updatePart(Notification msg) { + if (editingPart.isVisible()) { + ConcreteReferenceTargetSample1PropertiesEditionPart basePart = (ConcreteReferenceTargetSample1PropertiesEditionPart)editingPart; + if (EefnrPackage.eINSTANCE.getAbstractSample_Name().equals(msg.getFeature()) && basePart != null){ + if (msg.getNewValue() != null) { + basePart.setName(EcoreUtil.convertToString(EcorePackage.eINSTANCE.getEString(), msg.getNewValue())); + } else { + basePart.setName(""); + } + } + + } + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public Diagnostic validateValue(IPropertiesEditionEvent event) { + Diagnostic ret = Diagnostic.OK_INSTANCE; + if (event.getNewValue() != null) { + try { + if (FiltersViewsRepository.ConcreteReferenceTargetSample1.Properties.name == event.getAffectedEditor()) { + Object newValue = event.getNewValue(); + if (newValue instanceof String) { + newValue = EcoreUtil.createFromString(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), (String)newValue); + } + ret = Diagnostician.INSTANCE.validate(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), newValue); + } + } catch (IllegalArgumentException iae) { + ret = BasicDiagnostic.toDiagnostic(iae); + } catch (WrappedException we) { + ret = BasicDiagnostic.toDiagnostic(we); + } + } + return ret; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample2PropertiesEditionComponent.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample2PropertiesEditionComponent.java new file mode 100644 index 000000000..341fb0100 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/components/ConcreteReferenceTargetSample2PropertiesEditionComponent.java @@ -0,0 +1,143 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.components; + +// Start of user code for imports +import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.eef.eefnr.EefnrPackage;
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2;
+import org.eclipse.emf.eef.eefnr.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart;
+import org.eclipse.emf.eef.eefnr.filters.parts.FiltersViewsRepository;
+import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;
+import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;
+ + +// End of user code + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample2PropertiesEditionComponent extends SinglePartPropertiesEditingComponent { + + + public static String BASE_PART = "Base"; //$NON-NLS-1$ + + + /** + * Default constructor + * + */ + public ConcreteReferenceTargetSample2PropertiesEditionComponent(PropertiesEditingContext editingContext, EObject concreteReferenceTargetSample2, String editing_mode) { + super(editingContext, concreteReferenceTargetSample2, editing_mode); + parts = new String[] { BASE_PART }; + repositoryKey = FiltersViewsRepository.class; + partKey = FiltersViewsRepository.ConcreteReferenceTargetSample2.class; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject, + * org.eclipse.emf.ecore.resource.ResourceSet) + * + */ + public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) { + setInitializing(true); + if (editingPart != null && key == partKey) { + editingPart.setContext(elt, allResource); + final ConcreteReferenceTargetSample2 concreteReferenceTargetSample2 = (ConcreteReferenceTargetSample2)elt; + final ConcreteReferenceTargetSample2PropertiesEditionPart basePart = (ConcreteReferenceTargetSample2PropertiesEditionPart)editingPart; + // init values + if (concreteReferenceTargetSample2.getName() != null) + basePart.setName(EEFConverterUtil.convertToString(EcorePackage.eINSTANCE.getEString(), concreteReferenceTargetSample2.getName())); + + // init filters + + // init values for referenced views + + // init filters for referenced views + + } + setInitializing(false); + } + + + + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public void updateSemanticModel(final IPropertiesEditionEvent event) { + ConcreteReferenceTargetSample2 concreteReferenceTargetSample2 = (ConcreteReferenceTargetSample2)semanticObject; + if (FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name == event.getAffectedEditor()) { + concreteReferenceTargetSample2.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.eINSTANCE.getEString(), (String)event.getNewValue())); + } + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification) + */ + public void updatePart(Notification msg) { + if (editingPart.isVisible()) { + ConcreteReferenceTargetSample2PropertiesEditionPart basePart = (ConcreteReferenceTargetSample2PropertiesEditionPart)editingPart; + if (EefnrPackage.eINSTANCE.getAbstractSample_Name().equals(msg.getFeature()) && basePart != null){ + if (msg.getNewValue() != null) { + basePart.setName(EcoreUtil.convertToString(EcorePackage.eINSTANCE.getEString(), msg.getNewValue())); + } else { + basePart.setName(""); + } + } + + } + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) + * + */ + public Diagnostic validateValue(IPropertiesEditionEvent event) { + Diagnostic ret = Diagnostic.OK_INSTANCE; + if (event.getNewValue() != null) { + try { + if (FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name == event.getAffectedEditor()) { + Object newValue = event.getNewValue(); + if (newValue instanceof String) { + newValue = EcoreUtil.createFromString(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), (String)newValue); + } + ret = Diagnostician.INSTANCE.validate(EefnrPackage.eINSTANCE.getAbstractSample_Name().getEAttributeType(), newValue); + } + } catch (IllegalArgumentException iae) { + ret = BasicDiagnostic.toDiagnostic(iae); + } catch (WrappedException we) { + ret = BasicDiagnostic.toDiagnostic(we); + } + } + return ret; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceOwnerSamplePropertiesEditionProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceOwnerSamplePropertiesEditionProvider.java new file mode 100644 index 000000000..d665e5264 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceOwnerSamplePropertiesEditionProvider.java @@ -0,0 +1,122 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import java.util.List;
+
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.filters.components.AbstractReferenceOwnerSamplePropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceOwnerSamplePropertiesEditionProvider extends PropertiesEditingProviderImpl { + + /** + * Constructor without provider for super types. + */ + public AbstractReferenceOwnerSamplePropertiesEditionProvider() { + super(); + } + + /** + * Constructor with providers for super types. + * @param superProviders providers to use for super types. + */ + public AbstractReferenceOwnerSamplePropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { + super(superProviders); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) + * + */ + public boolean provides(PropertiesEditingContext editingContext) { + return (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) + && (FiltersPackage.eINSTANCE.getAbstractReferenceOwnerSample() == editingContext.getEObject().eClass()); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public boolean provides(PropertiesEditingContext editingContext, String part) { + return (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) && (AbstractReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) && (refinement == AbstractReferenceOwnerSamplePropertiesEditionComponent.class); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) && ((AbstractReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part) && refinement == AbstractReferenceOwnerSamplePropertiesEditionComponent.class)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { + if (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) { + return new AbstractReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { + if (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) { + if (AbstractReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part)) + return new AbstractReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) + */ + @SuppressWarnings("unchecked") + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { + if (editingContext.getEObject() instanceof AbstractReferenceOwnerSample) { + if (AbstractReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part) + && refinement == AbstractReferenceOwnerSamplePropertiesEditionComponent.class) + return new AbstractReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceTargetSamplePropertiesEditionProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceTargetSamplePropertiesEditionProvider.java new file mode 100644 index 000000000..a3a3962f5 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/AbstractReferenceTargetSamplePropertiesEditionProvider.java @@ -0,0 +1,122 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import java.util.List;
+
+import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.filters.components.AbstractReferenceTargetSamplePropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class AbstractReferenceTargetSamplePropertiesEditionProvider extends PropertiesEditingProviderImpl { + + /** + * Constructor without provider for super types. + */ + public AbstractReferenceTargetSamplePropertiesEditionProvider() { + super(); + } + + /** + * Constructor with providers for super types. + * @param superProviders providers to use for super types. + */ + public AbstractReferenceTargetSamplePropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { + super(superProviders); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) + * + */ + public boolean provides(PropertiesEditingContext editingContext) { + return (editingContext.getEObject() instanceof AbstractReferenceTargetSample) + && (FiltersPackage.eINSTANCE.getAbstractReferenceTargetSample() == editingContext.getEObject().eClass()); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public boolean provides(PropertiesEditingContext editingContext, String part) { + return (editingContext.getEObject() instanceof AbstractReferenceTargetSample) && (AbstractReferenceTargetSamplePropertiesEditionComponent.BASE_PART.equals(part)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof AbstractReferenceTargetSample) && (refinement == AbstractReferenceTargetSamplePropertiesEditionComponent.class); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof AbstractReferenceTargetSample) && ((AbstractReferenceTargetSamplePropertiesEditionComponent.BASE_PART.equals(part) && refinement == AbstractReferenceTargetSamplePropertiesEditionComponent.class)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { + if (editingContext.getEObject() instanceof AbstractReferenceTargetSample) { + return new AbstractReferenceTargetSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { + if (editingContext.getEObject() instanceof AbstractReferenceTargetSample) { + if (AbstractReferenceTargetSamplePropertiesEditionComponent.BASE_PART.equals(part)) + return new AbstractReferenceTargetSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) + */ + @SuppressWarnings("unchecked") + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { + if (editingContext.getEObject() instanceof AbstractReferenceTargetSample) { + if (AbstractReferenceTargetSamplePropertiesEditionComponent.BASE_PART.equals(part) + && refinement == AbstractReferenceTargetSamplePropertiesEditionComponent.class) + return new AbstractReferenceTargetSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceOwnerSamplePropertiesEditionProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceOwnerSamplePropertiesEditionProvider.java new file mode 100644 index 000000000..0b6a6bb82 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceOwnerSamplePropertiesEditionProvider.java @@ -0,0 +1,122 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import java.util.List;
+
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.filters.components.ConcreteReferenceOwnerSamplePropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceOwnerSamplePropertiesEditionProvider extends PropertiesEditingProviderImpl { + + /** + * Constructor without provider for super types. + */ + public ConcreteReferenceOwnerSamplePropertiesEditionProvider() { + super(); + } + + /** + * Constructor with providers for super types. + * @param superProviders providers to use for super types. + */ + public ConcreteReferenceOwnerSamplePropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { + super(superProviders); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) + * + */ + public boolean provides(PropertiesEditingContext editingContext) { + return (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) + && (FiltersPackage.eINSTANCE.getConcreteReferenceOwnerSample() == editingContext.getEObject().eClass()); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public boolean provides(PropertiesEditingContext editingContext, String part) { + return (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) && (ConcreteReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) && (refinement == ConcreteReferenceOwnerSamplePropertiesEditionComponent.class); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) && ((ConcreteReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part) && refinement == ConcreteReferenceOwnerSamplePropertiesEditionComponent.class)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { + if (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) { + return new ConcreteReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { + if (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) { + if (ConcreteReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part)) + return new ConcreteReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) + */ + @SuppressWarnings("unchecked") + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { + if (editingContext.getEObject() instanceof ConcreteReferenceOwnerSample) { + if (ConcreteReferenceOwnerSamplePropertiesEditionComponent.BASE_PART.equals(part) + && refinement == ConcreteReferenceOwnerSamplePropertiesEditionComponent.class) + return new ConcreteReferenceOwnerSamplePropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample1PropertiesEditionProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample1PropertiesEditionProvider.java new file mode 100644 index 000000000..6f7eae017 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample1PropertiesEditionProvider.java @@ -0,0 +1,122 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import java.util.List;
+
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.filters.components.ConcreteReferenceTargetSample1PropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample1PropertiesEditionProvider extends PropertiesEditingProviderImpl { + + /** + * Constructor without provider for super types. + */ + public ConcreteReferenceTargetSample1PropertiesEditionProvider() { + super(); + } + + /** + * Constructor with providers for super types. + * @param superProviders providers to use for super types. + */ + public ConcreteReferenceTargetSample1PropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { + super(superProviders); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) + * + */ + public boolean provides(PropertiesEditingContext editingContext) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) + && (FiltersPackage.eINSTANCE.getConcreteReferenceTargetSample1() == editingContext.getEObject().eClass()); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public boolean provides(PropertiesEditingContext editingContext, String part) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) && (ConcreteReferenceTargetSample1PropertiesEditionComponent.BASE_PART.equals(part)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) && (refinement == ConcreteReferenceTargetSample1PropertiesEditionComponent.class); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) && ((ConcreteReferenceTargetSample1PropertiesEditionComponent.BASE_PART.equals(part) && refinement == ConcreteReferenceTargetSample1PropertiesEditionComponent.class)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) { + return new ConcreteReferenceTargetSample1PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) { + if (ConcreteReferenceTargetSample1PropertiesEditionComponent.BASE_PART.equals(part)) + return new ConcreteReferenceTargetSample1PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) + */ + @SuppressWarnings("unchecked") + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample1) { + if (ConcreteReferenceTargetSample1PropertiesEditionComponent.BASE_PART.equals(part) + && refinement == ConcreteReferenceTargetSample1PropertiesEditionComponent.class) + return new ConcreteReferenceTargetSample1PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample2PropertiesEditionProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample2PropertiesEditionProvider.java new file mode 100644 index 000000000..9bc62cd43 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/ConcreteReferenceTargetSample2PropertiesEditionProvider.java @@ -0,0 +1,122 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import java.util.List;
+
+import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2;
+import org.eclipse.emf.eef.eefnr.filters.FiltersPackage;
+import org.eclipse.emf.eef.filters.components.ConcreteReferenceTargetSample2PropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
+import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
+import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
+ +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class ConcreteReferenceTargetSample2PropertiesEditionProvider extends PropertiesEditingProviderImpl { + + /** + * Constructor without provider for super types. + */ + public ConcreteReferenceTargetSample2PropertiesEditionProvider() { + super(); + } + + /** + * Constructor with providers for super types. + * @param superProviders providers to use for super types. + */ + public ConcreteReferenceTargetSample2PropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { + super(superProviders); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) + * + */ + public boolean provides(PropertiesEditingContext editingContext) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) + && (FiltersPackage.eINSTANCE.getConcreteReferenceTargetSample2() == editingContext.getEObject().eClass()); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public boolean provides(PropertiesEditingContext editingContext, String part) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) && (ConcreteReferenceTargetSample2PropertiesEditionComponent.BASE_PART.equals(part)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) && (refinement == ConcreteReferenceTargetSample2PropertiesEditionComponent.class); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) + * + */ + @SuppressWarnings("unchecked") + public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { + return (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) && ((ConcreteReferenceTargetSample2PropertiesEditionComponent.BASE_PART.equals(part) && refinement == ConcreteReferenceTargetSample2PropertiesEditionComponent.class)); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) { + return new ConcreteReferenceTargetSample2PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) + * + */ + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) { + if (ConcreteReferenceTargetSample2PropertiesEditionComponent.BASE_PART.equals(part)) + return new ConcreteReferenceTargetSample2PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part); + } + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) + */ + @SuppressWarnings("unchecked") + public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { + if (editingContext.getEObject() instanceof ConcreteReferenceTargetSample2) { + if (ConcreteReferenceTargetSample2PropertiesEditionComponent.BASE_PART.equals(part) + && refinement == ConcreteReferenceTargetSample2PropertiesEditionComponent.class) + return new ConcreteReferenceTargetSample2PropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); + } + return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/FiltersEEFAdapterFactory.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/FiltersEEFAdapterFactory.java new file mode 100644 index 000000000..d0b0e3398 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/org/eclipse/emf/eef/filters/providers/FiltersEEFAdapterFactory.java @@ -0,0 +1,73 @@ +/*******************************************************************************
+ * Copyright (c) 2009 - 2010 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/ +package org.eclipse.emf.eef.filters.providers; + +import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory;
+import org.eclipse.emf.eef.references.providers.AbstractSamplePropertiesEditionProvider;
+ + +/** + * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> + * + */ +public class FiltersEEFAdapterFactory extends FiltersAdapterFactory { + + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractSampleAdapter() + * + */ + public Adapter createAbstractSampleAdapter() { + return new AbstractSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractReferenceOwnerSampleAdapter() + * + */ + public Adapter createAbstractReferenceOwnerSampleAdapter() { + return new AbstractReferenceOwnerSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createAbstractReferenceTargetSampleAdapter() + * + */ + public Adapter createAbstractReferenceTargetSampleAdapter() { + return new AbstractReferenceTargetSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceOwnerSampleAdapter() + * + */ + public Adapter createConcreteReferenceOwnerSampleAdapter() { + return new ConcreteReferenceOwnerSamplePropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceTargetSample1Adapter() + * + */ + public Adapter createConcreteReferenceTargetSample1Adapter() { + return new ConcreteReferenceTargetSample1PropertiesEditionProvider(); + } + /** + * {@inheritDoc} + * @see org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory#createConcreteReferenceTargetSample2Adapter() + * + */ + public Adapter createConcreteReferenceTargetSample2Adapter() { + return new ConcreteReferenceTargetSample2PropertiesEditionProvider(); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/references_properties.plugin.xml b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/references_properties.plugin.xml index ff2273ea1..f8c14ce4e 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/references_properties.plugin.xml +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src-gen/references_properties.plugin.xml @@ -13,25 +13,31 @@ <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider + providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + </PropertiesEditionPartProvider> + </extension> + <extension + point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> + <PropertiesEditionPartProvider providerClass="org.eclipse.emf.eef.eefnr.providers.EefnrPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.filters.providers.FiltersPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.references.providers.ReferencesPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> <extension point="org.eclipse.emf.eef.runtime.PropertiesEditionPartProvider"> <PropertiesEditionPartProvider - providerClass="org.eclipse.emf.eef.eefnrext.providers.EefnrextPropertiesEditionPartProvider"> + providerClass="org.eclipse.emf.eef.eefnr.navigation.providers.NavigationPropertiesEditionPartProvider"> </PropertiesEditionPartProvider> </extension> diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceOwnerSampleItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceOwnerSampleItemProvider.java new file mode 100644 index 000000000..ee8fd58a3 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceOwnerSampleItemProvider.java @@ -0,0 +1,155 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AbstractReferenceOwnerSampleItemProvider.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample; +import org.eclipse.emf.eef.eefnr.filters.FiltersPackage; + +import org.eclipse.emf.eef.eefnr.provider.AbstractSampleItemProvider; +import org.eclipse.emf.eef.eefnr.provider.EefnrEditPlugin; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.eef.eefnr.filters.AbstractReferenceOwnerSample} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class AbstractReferenceOwnerSampleItemProvider + extends AbstractSampleItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AbstractReferenceOwnerSampleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addAbstractTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Abstract Target feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addAbstractTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_AbstractReferenceOwnerSample_abstractTarget_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_AbstractReferenceOwnerSample_abstractTarget_feature", "_UI_AbstractReferenceOwnerSample_type"), + FiltersPackage.Literals.ABSTRACT_REFERENCE_OWNER_SAMPLE__ABSTRACT_TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns AbstractReferenceOwnerSample.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/AbstractReferenceOwnerSample")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((AbstractReferenceOwnerSample)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_AbstractReferenceOwnerSample_type") : + getString("_UI_AbstractReferenceOwnerSample_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return EefnrEditPlugin.INSTANCE; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceTargetSampleItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceTargetSampleItemProvider.java new file mode 100644 index 000000000..446f95ada --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/AbstractReferenceTargetSampleItemProvider.java @@ -0,0 +1,130 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AbstractReferenceTargetSampleItemProvider.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample; + +import org.eclipse.emf.eef.eefnr.provider.AbstractSampleItemProvider; +import org.eclipse.emf.eef.eefnr.provider.EefnrEditPlugin; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.eef.eefnr.filters.AbstractReferenceTargetSample} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class AbstractReferenceTargetSampleItemProvider + extends AbstractSampleItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AbstractReferenceTargetSampleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns AbstractReferenceTargetSample.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/AbstractReferenceTargetSample")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((AbstractReferenceTargetSample)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_AbstractReferenceTargetSample_type") : + getString("_UI_AbstractReferenceTargetSample_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return EefnrEditPlugin.INSTANCE; + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceOwnerSampleItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceOwnerSampleItemProvider.java new file mode 100644 index 000000000..58362361d --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceOwnerSampleItemProvider.java @@ -0,0 +1,188 @@ +/** + * <copyright> + * </copyright> + * + * $Id: ConcreteReferenceOwnerSampleItemProvider.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample; +import org.eclipse.emf.eef.eefnr.filters.FiltersFactory; +import org.eclipse.emf.eef.eefnr.filters.FiltersPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ConcreteReferenceOwnerSampleItemProvider + extends AbstractReferenceOwnerSampleItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ConcreteReferenceOwnerSampleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Target feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ConcreteReferenceOwnerSample_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ConcreteReferenceOwnerSample_target_feature", "_UI_ConcreteReferenceOwnerSample_type"), + FiltersPackage.Literals.CONCRETE_REFERENCE_OWNER_SAMPLE__TARGET, + false, + false, + false, + null, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(FiltersPackage.Literals.CONCRETE_REFERENCE_OWNER_SAMPLE__STRICT_TYPING); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns ConcreteReferenceOwnerSample.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ConcreteReferenceOwnerSample")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ConcreteReferenceOwnerSample)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ConcreteReferenceOwnerSample_type") : + getString("_UI_ConcreteReferenceOwnerSample_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(ConcreteReferenceOwnerSample.class)) { + case FiltersPackage.CONCRETE_REFERENCE_OWNER_SAMPLE__STRICT_TYPING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (FiltersPackage.Literals.CONCRETE_REFERENCE_OWNER_SAMPLE__STRICT_TYPING, + FiltersFactory.eINSTANCE.createConcreteReferenceTargetSample1())); + + newChildDescriptors.add + (createChildParameter + (FiltersPackage.Literals.CONCRETE_REFERENCE_OWNER_SAMPLE__STRICT_TYPING, + FiltersFactory.eINSTANCE.createConcreteReferenceTargetSample2())); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample1ItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample1ItemProvider.java new file mode 100644 index 000000000..1d9bc57c1 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample1ItemProvider.java @@ -0,0 +1,114 @@ +/** + * <copyright> + * </copyright> + * + * $Id: ConcreteReferenceTargetSample1ItemProvider.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ConcreteReferenceTargetSample1ItemProvider + extends AbstractReferenceTargetSampleItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ConcreteReferenceTargetSample1ItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns ConcreteReferenceTargetSample1.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ConcreteReferenceTargetSample1")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ConcreteReferenceTargetSample1)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ConcreteReferenceTargetSample1_type") : + getString("_UI_ConcreteReferenceTargetSample1_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample2ItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample2ItemProvider.java new file mode 100644 index 000000000..945bcf2c7 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/ConcreteReferenceTargetSample2ItemProvider.java @@ -0,0 +1,114 @@ +/** + * <copyright> + * </copyright> + * + * $Id: ConcreteReferenceTargetSample2ItemProvider.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ConcreteReferenceTargetSample2ItemProvider + extends AbstractReferenceTargetSampleItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ConcreteReferenceTargetSample2ItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns ConcreteReferenceTargetSample2.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ConcreteReferenceTargetSample2")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ConcreteReferenceTargetSample2)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ConcreteReferenceTargetSample2_type") : + getString("_UI_ConcreteReferenceTargetSample2_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/FiltersItemProviderAdapterFactory.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/FiltersItemProviderAdapterFactory.java new file mode 100644 index 000000000..c74aaf6f1 --- /dev/null +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/filters/provider/FiltersItemProviderAdapterFactory.java @@ -0,0 +1,251 @@ +/** + * <copyright> + * </copyright> + * + * $Id: FiltersItemProviderAdapterFactory.java,v 1.1 2011/02/01 09:55:15 glefur Exp $ + */ +package org.eclipse.emf.eef.eefnr.filters.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.emf.eef.eefnr.filters.util.FiltersAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class FiltersItemProviderAdapterFactory extends FiltersAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<Object> supportedTypes = new ArrayList<Object>(); + + /** + * This constructs an instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FiltersItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ConcreteReferenceOwnerSampleItemProvider concreteReferenceOwnerSampleItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceOwnerSample}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createConcreteReferenceOwnerSampleAdapter() { + if (concreteReferenceOwnerSampleItemProvider == null) { + concreteReferenceOwnerSampleItemProvider = new ConcreteReferenceOwnerSampleItemProvider(this); + } + + return concreteReferenceOwnerSampleItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ConcreteReferenceTargetSample1ItemProvider concreteReferenceTargetSample1ItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample1}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createConcreteReferenceTargetSample1Adapter() { + if (concreteReferenceTargetSample1ItemProvider == null) { + concreteReferenceTargetSample1ItemProvider = new ConcreteReferenceTargetSample1ItemProvider(this); + } + + return concreteReferenceTargetSample1ItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ConcreteReferenceTargetSample2ItemProvider concreteReferenceTargetSample2ItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.eef.eefnr.filters.ConcreteReferenceTargetSample2}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createConcreteReferenceTargetSample2Adapter() { + if (concreteReferenceTargetSample2ItemProvider == null) { + concreteReferenceTargetSample2ItemProvider = new ConcreteReferenceTargetSample2ItemProvider(this); + } + + return concreteReferenceTargetSample2ItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void dispose() { + if (concreteReferenceOwnerSampleItemProvider != null) concreteReferenceOwnerSampleItemProvider.dispose(); + if (concreteReferenceTargetSample1ItemProvider != null) concreteReferenceTargetSample1ItemProvider.dispose(); + if (concreteReferenceTargetSample2ItemProvider != null) concreteReferenceTargetSample2ItemProvider.dispose(); + } + +} diff --git a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/provider/RootItemProvider.java b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/provider/RootItemProvider.java index 70b6a4a07..8b03c02de 100644 --- a/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/provider/RootItemProvider.java +++ b/tests/org.eclipse.emf.eef.tests.nonreg.edit/src/org/eclipse/emf/eef/eefnr/provider/RootItemProvider.java @@ -2,7 +2,7 @@ * <copyright> * </copyright> * - * $Id: RootItemProvider.java,v 1.9 2010/11/30 08:24:13 glefur Exp $ + * $Id: RootItemProvider.java,v 1.10 2011/02/01 09:55:16 glefur Exp $ */ package org.eclipse.emf.eef.eefnr.provider; @@ -29,6 +29,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.emf.eef.eefnr.EefnrFactory; import org.eclipse.emf.eef.eefnr.EefnrPackage; import org.eclipse.emf.eef.eefnr.Root; +import org.eclipse.emf.eef.eefnr.filters.FiltersFactory; import org.eclipse.emf.eef.eefnr.navigation.NavigationFactory; import org.eclipse.emf.eef.eefnr.references.ReferencesFactory; import org.eclipse.emf.eef.eefnrext.EefnrextFactory; @@ -282,6 +283,21 @@ public class RootItemProvider newChildDescriptors.add (createChildParameter (EefnrPackage.Literals.ROOT__SAMPLES, + FiltersFactory.eINSTANCE.createConcreteReferenceOwnerSample())); + + newChildDescriptors.add + (createChildParameter + (EefnrPackage.Literals.ROOT__SAMPLES, + FiltersFactory.eINSTANCE.createConcreteReferenceTargetSample1())); + + newChildDescriptors.add + (createChildParameter + (EefnrPackage.Literals.ROOT__SAMPLES, + FiltersFactory.eINSTANCE.createConcreteReferenceTargetSample2())); + + newChildDescriptors.add + (createChildParameter + (EefnrPackage.Literals.ROOT__SAMPLES, EefnrextFactory.eINSTANCE.createTableCompositionTargetExtensionEditorSample())); newChildDescriptors.add |