Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick tessier2014-02-10 07:45:32 -0500
committerPatrick tessier2014-02-10 07:45:32 -0500
commitdf1d4d493dc8ea4b4a81ad8da993f91df220431a (patch)
treef9621c66abaacba819a508e5626c3ced2c43b056
parent74550693a485c6ff27748a6c5a9bfdae21b8bd5b (diff)
downloadorg.eclipse.papyrus-df1d4d493dc8ea4b4a81ad8da993f91df220431a.tar.gz
org.eclipse.papyrus-df1d4d493dc8ea4b4a81ad8da993f91df220431a.tar.xz
org.eclipse.papyrus-df1d4d493dc8ea4b4a81ad8da993f91df220431a.zip
386118: [EMF Facet] Papyrus should progressively support EMF Facet 0.2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386118 Import EMF Facet
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.checkstyle18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.jdt.core.prefs18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/META-INF/MANIFEST.MF14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/OSGI-INF/l10n/bundle.properties16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/README.txt3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/build.properties19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/Activator.java47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/utils/StringMatcher.java500
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.checkstyle18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/META-INF/MANIFEST.MF23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties17
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/plugin.xml52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Activator.java53
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Messages.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/PersistableColumn.java217
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/Column.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java30
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IColumnDescription.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java68
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/messages.properties11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/preference/pages/EmfFacetRootPreferencePage.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/AbstractTreeView.java176
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsView.java208
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsViewFactory.java52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.checkstyle22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.jdt.core.prefs81
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/META-INF/MANIFEST.MF16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/OSGI-INF/l10n/bundle.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/build.properties22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.ecore36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.genmodel21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/plugin.xml25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogFactory.java63
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogPackage.java266
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/FacetSetCatalog.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/QuerySetCatalog.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogFactoryImpl.java118
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogPackageImpl.java257
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/FacetSetCatalogImpl.java248
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/QuerySetCatalogImpl.java248
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogAdapterFactory.java168
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogSwitch.java176
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/plugin/Activator.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.checkstyle9
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.pmd7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.project46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/OSGI-INF/l10n/bundle.properties17
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/build.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/plugin.xml45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/derivedTypedElementImplementationRegistration.exsd127
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/internal.resolver.exsd108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/org.eclipse.emf.facet.efacet.core.query.evaluatorregistration.exsd95
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/queryImplementationRegistration.exsd122
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/FacetUtils.java705
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IDerivedTypedElementManager.java201
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IEFacetManager.java87
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetAction.java135
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetActions.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactory.java193
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactoryFactory.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManager.java244
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerFactory.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerListener.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManager.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManagerFactory.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/DerivedTypedElementException.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/FacetManagerException.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryException.java39
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryExecutionException.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryTypeCheckingException.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/Activator.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/CastUtils.java88
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementManager.java877
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementUtils.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EFacetManager.java197
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EmfUtils.java103
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionImpl.java205
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActions2Impl.java231
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionsImpl.java78
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCatalogManagerFactory.java30
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryFactory.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryImpl.java511
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetManager.java593
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetManagerContext.java554
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetManagerFactory.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/Messages.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/ResolverManager.java113
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/catalog/EFacetCatalogManager.java58
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/catalog/EFacetCatalogManager2.java72
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/DerivedTypedElementEvaluationException.java44
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/DerivedTypedElementTypeCheckingException.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/FacetConformanceEvaluationException.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/NonApplicableFacetException.java21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/NonConformingEObjectException.java21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/SaveStructuralFeatureInstanceModelException.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exception/UnmatchingExpectedTypeException.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exported/IResolver.java61
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/exported/IResolverManager.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/incubatingapi/IFacetActions2.java208
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/messages.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/DerivedTypedElementImplementationFactoryRegistry.java121
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/EObjectLiteralQueryImplementation.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/EObjectLiteralQueryImplementationFactory.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/FalseLiteralQueryImplementation.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/FalseLiteralQueryImplementationFactory.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/FloatLiteralQueryImplementation.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/FloatLiteralQueryImplementationFactory.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/IntegerLiteralQueryImplementation.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/IntegerLiteralQueryImplementationFactory.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/IsOneOfQueryImplementation.java52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/IsOneOfQueryImplementationFactory.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/NavigationQueryImplementation.java80
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/NavigationQueryImplementationFactory.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/NullLiteralQueryImplementation.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/NullLiteralQueryImplementationFactory.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/OperationCallQueryImplementation.java68
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/OperationCallQueryImplementationFactory.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/QueryEvaluatorFactoryRegistry.java100
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/QueryImplementationFactoryRegistry.java114
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/QueryUtils.java121
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/QueryUtilsImpl.java64
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/StringLiteralQueryImplementation.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/StringLiteralQueryImplementationFactory.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/TrueLiteralQueryImplementation.java48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/query/TrueLiteralQueryImplementationFactory.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/serialization/ILinkToExtendedEObjectReference.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/serialization/ILinkToExtendedEObjectReferenceAdapterFactory.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/serialization/LinkToExtendedEObjectReferenceAdapter.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/serialization/LinkToExtendedEObjectReferenceAdapterFactory.java29
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/serialization/SerializationManager.java432
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IDerivedTypedElementCollectionImplementation.java92
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IDerivedTypedElementImplementation.java93
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IDerivedTypedElementImplementationFactory.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryCollectionImplementation.java97
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryEvaluator.java111
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryEvaluatorFactory.java42
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryImplementation.java85
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryImplementationFactory.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/query/IQueryUtils.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/.checkstyle22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/.settings/org.eclipse.jdt.core.prefs73
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/FacetIcons.xcfbin0 -> 12146 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/META-INF/MANIFEST.MF19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/build.properties22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/icons/full/obj16/Facet.gifbin0 -> 805 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/icons/full/obj16/FacetAttribute.gifbin0 -> 584 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/icons/full/obj16/FacetReference.gifbin0 -> 592 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/icons/full/obj16/FacetSet.gifbin0 -> 605 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/icons/full/obj16/Shortcut.gifbin0 -> 129 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/plugin.properties42
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/plugin.xml33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetAttributeItemProvider.java197
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetEditPlugin.java107
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetItemProvider.java216
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetItemProviderAdapterFactory.java307
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetReferenceItemProvider.java196
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetSetItemProvider.java198
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/FacetStructuralFeatureItemProvider.java166
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.edit/src/org/eclipse/emf/facet/infra/facet/edit/provider/ShortcutItemProvider.java190
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/.checkstyle22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/.settings/org.eclipse.jdt.core.prefs71
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/META-INF/MANIFEST.MF27
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/build.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/icons/full/obj16/Facet.gifbin0 -> 805 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/icons/full/obj16/FacetModelFile.gifbin0 -> 346 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/icons/full/wizban/NewFacet.gifbin0 -> 820 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/plugin.properties61
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/plugin.xml50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/Messages.java30
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/messages.properties15
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/FacetActionBarContributor.java498
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/FacetEditor.java1842
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/FacetEditorPlugin.java109
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/FacetModelWizard.java659
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/LoadEmfFacetResourceAction.java108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet.editor/src/org/eclipse/emf/facet/infra/facet/editor/presentation/LoadMetaModelResourceAction.java106
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/.checkstyle24
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/.settings/org.eclipse.jdt.core.prefs73
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/API.README.txt25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/META-INF/MANIFEST.MF20
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/build.properties20
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/model/facet.ecore47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/model/facet.ecorediag394
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/model/facet.genmodel36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/plugin.properties93
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/plugin.xml564
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/Facet.java92
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetAttribute.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetFactory.java93
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetPackage.java1491
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetReference.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetSet.java93
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/FacetStructuralFeature.java92
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/Shortcut.java83
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetAttributeImpl.java265
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetFactoryImpl.java152
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetImpl.java196
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetPackageImpl.java389
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetReferenceImpl.java265
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetSetImpl.java235
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/FacetStructuralFeatureImpl.java230
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/impl/ShortcutImpl.java205
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/plugin/FacetPlugin.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/util/FacetAdapterFactory.java392
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/util/FacetSwitch.java412
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/EValidatorAdapter.java119
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/ExtendedClassValidation.java63
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/FacetSetName.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/FacetSetRoot.java39
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/NonEmptyName.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.infra.facet/src/org/eclipse/emf/facet/infra/facet/validation/UniqueName.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.checkstyle17
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/API.README.txt14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/META-INF/MANIFEST.MF21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/OSGI-INF/l10n/bundle.properties14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/build.properties19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/plugin.xml26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IJavaQuery.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IJavaQuery2.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IParameterValueList.java68
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IParameterValueList2.java66
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IParameterValueListFactory.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/IParameterValueListFactory2.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/ParameterValueList.java108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/ParameterValueList2.java107
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/ParameterValueListFactoryImpl.java30
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/ParameterValueListFactoryImpl2.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/evaluator/JavaQueryEvaluator.java76
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/evaluator/JavaQueryEvaluatorFactory.java88
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/evaluator/JavaQueryImplementation.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/evaluator/JavaQueryImplementationFactory.java84
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/exceptions/ClassAlreadyExistsException.java21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/exceptions/ResourceURIExpectedException.java21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/src/org/eclipse/emf/facet/query/java/core/internal/plugin/Activator.java68
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/.project34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/.settings/org.eclipse.jdt.core.prefs82
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/META-INF/MANIFEST.MF14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/OSGI-INF/l10n/bundle.properties3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/build.properties8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/model/javaQuery-0.2.0.ecore10
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/model/javaQuery-0.2.0.genmodel15
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/plugin.properties14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/plugin.xml16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/internal/Activator.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/JavaQuery.java61
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/JavaQueryFactory.java56
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/JavaQueryPackage.java182
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/impl/JavaQueryFactoryImpl.java106
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/impl/JavaQueryImpl.java175
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/impl/JavaQueryPackageImpl.java199
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/util/JavaQueryAdapterFactory.java151
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.metamodel/src/org/eclipse/emf/facet/query/java/metamodel/v0_2_0/javaquery/util/JavaQuerySwitch.java155
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/.checkstyle21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/.settings/org.eclipse.jdt.core.prefs74
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/META-INF/MANIFEST.MF15
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/OSGI-INF/l10n/bundle.properties14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/build.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/model/javaQuery.ecore10
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/model/javaQuery.genmodel15
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/plugin.xml25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/JavaQuery.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/JavaqueryFactory.java55
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/JavaqueryPackage.java289
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/impl/JavaQueryImpl.java175
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/impl/JavaqueryFactoryImpl.java107
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/impl/JavaqueryPackageImpl.java202
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/util/JavaqueryAdapterFactory.java207
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java/src/org/eclipse/emf/facet/query/java/javaquery/util/JavaquerySwitch.java216
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/.checkstyle10
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/.settings/.api_filters19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/API.README.txt24
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/META-INF/MANIFEST.MF15
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/OSGI-INF/l10n/bundle.properties14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/README.txt3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/build.properties17
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/DebugUtils.java106
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/Logger.java135
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/exception/DebuggingRuntimeException.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/Activator.java47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/ErrorHandlingUtils.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/JavaUtils.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/Messages.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/AbstractRegistry.java112
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/FileUtils.java192
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/FolderUtils.java108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/IFilter.java29
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/ListUtils.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/exported/StringUtils.java108
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.core/src/org/eclipse/emf/facet/util/core/internal/messages.properties18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/.checkstyle21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/.settings/org.eclipse.jdt.core.prefs74
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/META-INF/MANIFEST.MF13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/OSGI-INF/l10n/bundle.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/build.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/model/catalog.ecore33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/model/catalog.genmodel23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/plugin.xml27
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/Catalog.java87
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/CatalogFactory.java53
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/CatalogPackage.java256
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/CatalogSet.java60
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/impl/CatalogFactoryImpl.java106
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/impl/CatalogPackageImpl.java232
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/impl/CatalogSetImpl.java163
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/plugin/Activator.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/util/CatalogAdapterFactory.java151
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.catalog/src/org/eclipse/emf/facet/util/emf/catalog/util/CatalogSwitch.java158
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/.checkstyle11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/.settings/org.eclipse.jdt.core.prefs77
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/API.README.txt13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/META-INF/MANIFEST.MF34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/OSGI-INF/l10n/bundle.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/build.properties21
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/model/serialization.ecore8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/model/serialization.genmodel12
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/plugin.xml48
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/schema/catalogmanager.exsd96
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/schema/modelViewer.exsd185
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/schema/org.eclipse.emf.facet.util.emf.core.modeldeclaration.exsd95
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/schema/serialization.exsd136
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/CommandFactory.java53
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/EmfDebugUtils.java90
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/IBrowserRegistry.java86
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/ICatalogManager.java57
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/ICatalogSetManager.java64
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/ICatalogSetManager2.java83
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/ICatalogSetManagerFactory.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/IEObjectBrowserOpener.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/IEPackageBrowserOpener.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/IResourceBrowserOpener.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/ModelUtils.java253
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/command/EmfCommandUtils.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/command/ICommandFactoryResult.java24
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/command/ICommandFactoryResultFactory.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/command/ILockableUndoCommand.java23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/exception/DebugRuntimeException.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/exception/InvalidFacetSetException.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/Activator.java47
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/EMFUtils.java162
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/catalog/CatalogSetManager.java187
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/catalog/CatalogSetManagerFactory.java36
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/command/CommandFactoryResult.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/command/CommandFactoryResultFactory.java23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/command/SetResourceContentCommand.java105
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/exported/ICommandFactory.java71
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/preferences/PreferenceConstants.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/preferences/PreferenceInitializer.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/registry/BrowserRegistry.java212
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/SerializationRegistry.java133
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/SerializationService.java66
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/serializers/BooleanSerializer.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/serializers/EMFURISerializer.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/serializers/IResourceSerializer.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/serializers/IntegerSerializer.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/internal/serialization/serializers/StringSerializer.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/ISerializationRegistry.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/ISerializationService.java29
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/ISerializer.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/model/serialization/SerializationFactory.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/model/serialization/SerializationPackage.java121
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/model/serialization/impl/SerializationFactoryImpl.java151
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.core/src/org/eclipse/emf/facet/util/emf/core/serialization/model/serialization/impl/SerializationPackageImpl.java170
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/.checkstyle19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/.pmd7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/.project46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/OSGI-INF/l10n/bundle.properties11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/build.properties19
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/icons/EPackageView.gifbin0 -> 825 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/icons/ModelIcon.gifbin0 -> 103 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/icons/catalog.pngbin0 -> 583 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/icons/logoEmfFacetMini.gifbin0 -> 1078 bytes
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/plugin.xml117
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/Activator.java73
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/EmfLabelProvider.java140
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/EmfLabelProviderFactory.java24
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/Messages.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/ResourceUiUtils.java97
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/actions/OpenModelFromEmfRegistryAction.java58
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/dialogs/CreateInstanceDialog.java76
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/dialogs/SaveAsDialog.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/dialogs/URIComposite.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/dialogs/UriSelectionDialog.java105
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/IEmfLabelProviderFactory.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/composite/EClassifierSelectionControl.java88
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/widget/component/metaclass/AbstractGetMetaclassWidget.java163
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/widget/component/metaclass/MetamodelSelectionControl.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java151
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/SynchronizedSelectETypeWizard.java65
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/SelectEClassifierWizardPage.java188
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/SelectEPackageWizardPage.java190
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/SynchronizedSelectEClassifierWizardPage.java78
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/SynchronizedSelectEPackageWizardPage.java75
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/SynchronizedWizardPage.java260
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/exception/SelectedEClassifierRuntimeException.java39
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/util/wizard/page/exception/SelectedEPackageRuntimeException.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/wizard/ISelectETypeWizard.java25
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/wizard/page/ISelectEClassifierWizardPage.java43
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/exported/wizard/page/ISelectEPackageWizardPage.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/handler/SaveAsHandler.java94
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/handler/SaveHandler.java95
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/messages.properties40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/preference/pages/DefaultBrowserPreferencePage.java106
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/utils/ImageProvider.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/utils/ImageUtils.java55
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/internal/view/PackageRegistryView.java335
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/emf/facet/util/emf/ui/util/EditingUtil.java60
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.checkstyle10
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.options11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.pmd7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.project40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/META-INF/MANIFEST.MF14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/OSGI-INF/l10n/bundle.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/build.properties18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/src/org/eclipse/emf/facet/util/jface/ui/imageprovider/IImageProvider.java64
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/src/org/eclipse/emf/facet/util/jface/ui/imageprovider/IImageProviderFactory.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/src/org/eclipse/emf/facet/util/jface/ui/internal/Activator.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/src/org/eclipse/emf/facet/util/jface/ui/internal/imageprovider/ImageProvider.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.jface.ui/src/org/eclipse/emf/facet/util/jface/ui/internal/imageprovider/ImageProviderFactory.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.checkstyle18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.options11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.project34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/.settings/org.eclipse.jdt.ui.prefs2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/META-INF/MANIFEST.MF17
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/OSGI-INF/l10n/bundle.properties13
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/build.properties18
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/colorprovider/IColorProvider.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/colorprovider/IColorProviderFactory.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/fontprovider/IFontProvider.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/fontprovider/IFontProviderFactory.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/imageprovider/IImageProvider.java27
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/imageprovider/IImageProviderFactory.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/Activator.java45
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/colorprovider/ColorProvider.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/colorprovider/ColorProviderFactory.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/exported/SWTTestUtils.java38
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/exported/TestUtils.java46
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/fontprovider/FontProvider.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/fontprovider/FontProviderFactory.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/imageprovider/ImageProvider.java86
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.swt/src/org/eclipse/emf/facet/util/swt/internal/imageprovider/ImageProviderFactory.java35
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.checkstyle8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.classpath7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.fbprefs127
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.options16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.pmd7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.project52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.settings/.api_filters11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/META-INF/MANIFEST.MF41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/OSGI-INF/l10n/bundle.properties11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/about.html28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/build.properties16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/Activator.java52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/Messages.java37
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/dialog/OkDialog.java168
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/dialog/OkDialogFactory.java105
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/dialog/QuestionDialog.java184
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/dialog/QuestionDialogFactory.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/composite/IFilteredElementSelectionComposite.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IDialog.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IDialogCallback.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IDialogCallbackWithPreCommit.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IDialogWithoutResultCallback.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IOkDialog.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IOkDialogFactory.java52
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IQuestionDialog.java43
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IQuestionDialogFactory.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/dialog/IWithResultDialogCallback.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/AbstractExceptionFreeRunnable.java20
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/AbstractVoidExceptionFreeRunnable.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/AbstractVoidRunnable.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/DisplaySyncRuntimeException.java34
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/IRunnable.java16
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/SynchronizedComposite.java38
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/displaysync/SynchronizedObject.java115
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/handler/HandlerUtils.java90
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/tree/menu/ITreeMenu.java44
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/composite/FilteredElementSelectionComposite.java174
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/composite/SynchronizedFilteredElementSelectionComposite.java89
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java169
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialogWithCallback.java58
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/dialog/AbstractMainDialog.java62
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/dialog/SynchronizedAbstractDialog.java94
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/handler/AbstractSelectionExpectedTypeHandler.java51
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/ExtendedTree.java174
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/item/AbstractTreeItem.java210
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/menu/AbstractTreeMenu.java205
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/menu/AbstractTreeMenuItem.java213
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/menu/AbstractTreeSubMenu.java128
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/tree/menu/ExtendedTreeMenu.java341
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/AbstractWidget.java155
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/command/AbstractCommandWidget.java86
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/command/AbstractGetOrCreateFilteredElementCommandWidget.java147
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/command/ICommandWidget.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/command/IGetOrCreateFilteredElementCommmandWidget.java33
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/CreateElementWidget.java132
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/getorcreate/AbstractGetOrCreateElementWidget.java168
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/getorcreate/AbstractGetOrCreateElementWithButtonWidget.java120
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/getorcreate/AbstractGetOrCreateElementWithDialogButtonWidget.java89
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/getorcreate/AbstractGetOrCreateElementWithWizardButtonWidget.java82
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/properties/AbstractGetPropertyWidget.java159
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/properties/bounds/AbstractGetBoundsWidget.java127
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/properties/name/AbstractGetElementNameWidget.java86
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/component/properties/name/AbstractPrintElementWidget.java59
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/widget/query/AbstractQueryWidget.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/util/wizard/SynchronizedWizard.java314
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/widget/IAbstractWidget.java56
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/widget/getorcreate/IAbstractGetOrCreateElementWidget.java43
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/widget/getorcreate/IAbstractGetOrCreateElementWithButtonWidget.java41
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/exported/wizard/IExtendedWizard.java56
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/messages.properties23
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/sync/generated/SynchronizedAbstractGetOrCreateElementWidget.java92
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/sync/generated/SynchronizedAbstractGetOrCreateElementWithButtonWidget.java112
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/sync/generated/SynchronizedGetOrCreateFilteredElementCommmandWidget.java142
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/sync/generated/SynchronizedOkDialog.java64
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/internal/widget/metaclass/FilteredElementSelectionWidget.java150
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/utils/PropertyElement.java113
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/utils/PropertyElement2.java54
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/utils/UIUtils.java248
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/emf/facet/util/ui/utils/WidgetProperties.java67
593 files changed, 48029 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.checkstyle b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.checkstyle
new file mode 100644
index 00000000000..0a2343a20f6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.checkstyle
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2010 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Nicolas Bros (Mia-Software) - initial API and implementation
+-->
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="EmfFacet" location="../org.eclipse.emf.facet.archi.tech.rules/checkstyle/EmfFacet.checkstyle" type="project" description=""/>
+ <fileset name="all" enabled="true" check-config-name="EmfFacet" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ <file-match-pattern match-pattern="Messages.java" include-pattern="false"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.project
new file mode 100644
index 00000000000..967bbba45ac
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.emf.facet.common.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..4824b802631
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.runtime.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..c522e1f4ae2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..e7929240616
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+###############################################################################
+#Thu Jan 13 10:03:13 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..f3b09276780
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.common.core;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.emf.facet.common.core.internal.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0",
+ com.ibm.icu;bundle-version="4.2.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.emf.facet.common.core.internal,
+ org.eclipse.emf.facet.common.core.internal.utils
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..b2f3223067f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+# Nicolas Guyomar (Mia-Software) - Bug 334000 Simple catalog manager
+###############################################################################
+#Properties file for org.eclipse.emf.facet.common.core
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet Common Core (Incubation)
+extension-point.name = catalogManager
+extension-point.name.0 = modeldeclaration \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/README.txt b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/README.txt
new file mode 100644
index 00000000000..96221b844ca
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/README.txt
@@ -0,0 +1,3 @@
+This plug-in contains classes common to other EMF Facet plug-ins.
+These classes implement functionality that deal with EMF Facet concepts.
+Utility classes not linked to EMF Facet concepts must go in this project instead: org.eclipse.emf.facet.util.core
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/about.html
new file mode 100644
index 00000000000..d1714826b27
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 4, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/build.properties
new file mode 100644
index 00000000000..8de8d60add3
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+# Nicolas Guyomar (Mia-Software) - Bug 334000 Simple catalog manager
+# Gregoire Dupe (Mia-Software) - Bug 334000 Simple catalog manager
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ OSGI-INF/
+src.includes = about.html
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/Activator.java
new file mode 100644
index 00000000000..f3c0a8cb2a5
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/Activator.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+ * Nicolas Guyomar (Mia-Software) - Bug 334000 Simple catalog manager
+ */
+package org.eclipse.emf.facet.common.core.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends Plugin {
+
+ private static BundleContext context;
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static Plugin getDefault() {
+ return Activator.plugin;
+ }
+
+ static BundleContext getContext() {
+ return Activator.context;
+ }
+
+ @Override
+ public void start(final BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ Activator.context = bundleContext;
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ Activator.plugin = null;
+ super.stop(bundleContext);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/utils/StringMatcher.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/utils/StringMatcher.java
new file mode 100644
index 00000000000..5ff5a00674d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.core/src/org/eclipse/emf/facet/common/core/internal/utils/StringMatcher.java
@@ -0,0 +1,500 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.core.internal.utils;
+
+import java.util.Vector;
+
+import com.ibm.icu.lang.UCharacter;
+
+/**
+ * A string pattern matcher. Supports '*' and '?' wildcards.
+ *
+ * FIXME yet another duplicated version of StringMatcher (Bug 269424)
+ */
+public class StringMatcher {
+ private final String fPattern;
+
+ private final int fLength; // pattern length
+
+ private final boolean fIgnoreWildCards;
+
+ private final boolean fIgnoreCase;
+
+ private boolean fHasLeadingStar;
+
+ private boolean fHasTrailingStar;
+
+ private String[] fSegments; // the given pattern is split into * separated
+ // segments
+
+ /* boundary value beyond which we don't need to search in the text */
+ private int fBound = 0;
+
+ private static final char SINGLE_WILD_CARD = '\u0000';
+
+ public static class Position {
+ private final int start; // inclusive
+ private final int end; // exclusive
+
+ public Position(final int start, final int end) {
+ this.start = start;
+ this.end = end;
+ }
+
+ public int getStart() {
+ return this.start;
+ }
+
+ public int getEnd() {
+ return this.end;
+ }
+ }
+
+ /**
+ * StringMatcher constructor takes in a String object that is a simple
+ * pattern which may contain '*' for 0 and many characters and '?' for
+ * exactly one character.
+ *
+ * Literal '*' and '?' characters must be escaped in the pattern e.g.,
+ * "\*" means literal "*", etc.
+ *
+ * Escaping any other character (including the escape character itself),
+ * just results in that character in the pattern. e.g., "\a" means "a" and
+ * "\\" means "\"
+ *
+ * If invoking the StringMatcher with string literals in Java, don't forget
+ * escape characters are represented by "\\".
+ *
+ * @param pattern
+ * the pattern to match text against
+ * @param ignoreCase
+ * if true, case is ignored
+ * @param ignoreWildCards
+ * if true, wild cards and their escape sequences are ignored
+ * (everything is taken literally).
+ */
+ public StringMatcher(final String pattern, final boolean ignoreCase,
+ final boolean ignoreWildCards) {
+ if (pattern == null) {
+ throw new IllegalArgumentException();
+ }
+ this.fIgnoreCase = ignoreCase;
+ this.fIgnoreWildCards = ignoreWildCards;
+ this.fPattern = pattern;
+ this.fLength = pattern.length();
+
+ if (this.fIgnoreWildCards) {
+ parseNoWildCards();
+ } else {
+ parseWildCards();
+ }
+ }
+
+ /**
+ * Find the first occurrence of the pattern between <code>start</code>
+ * )(inclusive) and <code>end</code>(exclusive).
+ *
+ * @param text
+ * the String object to search in
+ * @param start
+ * the starting index of the search range, inclusive
+ * @param end
+ * the ending index of the search range, exclusive
+ * @return a <code>StringMatcher.Position</code> object that keeps the
+ * starting (inclusive) and ending positions (exclusive) of the
+ * first occurrence of the pattern in the specified range of the
+ * text; return null if not found or subtext is empty (start==end).
+ * A pair of zeros is returned if pattern is empty string Note that
+ * for pattern like "*abc*" with leading and trailing stars,
+ * position of "abc" is returned. For a pattern like"*??*" in text
+ * "abcdf", (1,3) is returned
+ */
+ public StringMatcher.Position find(final String text, final int start,
+ final int end) {
+ int newStart = start;
+ int newEnd = end;
+
+ if (text == null) {
+ throw new IllegalArgumentException();
+ }
+
+ int tlen = text.length();
+ if (newStart < 0) {
+ newStart = 0;
+ }
+ if (newEnd > tlen) {
+ newEnd = tlen;
+ }
+ if (newEnd < 0 || newStart >= newEnd) {
+ return null;
+ }
+ if (this.fLength == 0) {
+ return new Position(newStart, newStart);
+ }
+ if (this.fIgnoreWildCards) {
+ int x = posIn(text, newStart, newEnd);
+ if (x < 0) {
+ return null;
+ }
+ return new Position(x, x + this.fLength);
+ }
+
+ int segCount = this.fSegments.length;
+ if (segCount == 0) {
+ // pattern contains only '*'(s)
+ return new Position(newStart, newEnd);
+ }
+
+ int curPos = newStart;
+ int matchStart = -1;
+ int i;
+ for (i = 0; i < segCount && curPos < newEnd; ++i) {
+ String current = this.fSegments[i];
+ int nextMatch = regExpPosIn(text, curPos, newEnd, current);
+ if (nextMatch < 0) {
+ return null;
+ }
+ if (i == 0) {
+ matchStart = nextMatch;
+ }
+ curPos = nextMatch + current.length();
+ }
+ if (i < segCount) {
+ return null;
+ }
+ return new Position(matchStart, curPos);
+ }
+
+ /**
+ * match the given <code>text</code> with the pattern
+ *
+ * @return true if matched otherwise false
+ * @param text
+ * a String object
+ */
+ public boolean match(final String text) {
+ return match(text, 0, text.length());
+ }
+
+ /**
+ * Given the starting (inclusive) and the ending (exclusive) positions in
+ * the <code>text</code>, determine if the given substring matches with
+ * aPattern
+ *
+ * @return true if the specified portion of the text matches the pattern
+ * @param text
+ * a String object that contains the substring to match
+ * @param start
+ * marks the starting position (inclusive) of the substring
+ * @param end
+ * marks the ending index (exclusive) of the substring
+ */
+ public boolean match(final String text, final int start, final int end) {
+ int newStart = start;
+ int newEnd = end;
+
+ if (null == text) {
+ throw new IllegalArgumentException();
+ }
+
+ if (newStart > newEnd) {
+ return false;
+ }
+
+ if (this.fIgnoreWildCards) {
+ return (newEnd - newStart == this.fLength)
+ && this.fPattern.regionMatches(this.fIgnoreCase, 0, text,
+ newStart, this.fLength);
+ }
+ int segCount = this.fSegments.length;
+ if (segCount == 0 && (this.fHasLeadingStar || this.fHasTrailingStar)) {
+ // pattern contains only '*'(s)
+ return true;
+ }
+ if (newStart == newEnd) {
+ return this.fLength == 0;
+ }
+ if (this.fLength == 0) {
+ return newStart == newEnd;
+ }
+
+ int tlen = text.length();
+ if (newStart < 0) {
+ newStart = 0;
+ }
+ if (newEnd > tlen) {
+ newEnd = tlen;
+ }
+
+ int tCurPos = newStart;
+ int bound = newEnd - this.fBound;
+ if (bound < 0) {
+ return false;
+ }
+ int i = 0;
+ String current = this.fSegments[i];
+ int segLength = current.length();
+
+ /* process first segment */
+ if (!this.fHasLeadingStar) {
+ if (!regExpRegionMatches(text, newStart, current, 0, segLength)) {
+ return false;
+ }
+ ++i;
+ tCurPos = tCurPos + segLength;
+ }
+ if ((this.fSegments.length == 1) && (!this.fHasLeadingStar)
+ && (!this.fHasTrailingStar)) {
+ // only one segment to match, no wildcards specified
+ return tCurPos == newEnd;
+ }
+ /* process middle segments */
+ for (; i < segCount && tCurPos <= bound; ++i) {
+ current = this.fSegments[i];
+ int currentMatch;
+ int k = current.indexOf(StringMatcher.SINGLE_WILD_CARD);
+ if (k < 0) {
+ currentMatch = textPosIn(text, tCurPos, newEnd, current);
+ if (currentMatch < 0) {
+ return false;
+ }
+ } else {
+ currentMatch = regExpPosIn(text, tCurPos, newEnd, current);
+ if (currentMatch < 0) {
+ return false;
+ }
+ }
+ tCurPos = currentMatch + current.length();
+ }
+
+ /* process final segment */
+ if (!this.fHasTrailingStar && tCurPos != newEnd) {
+ int clen = current.length();
+ return regExpRegionMatches(text, newEnd - clen, current, 0, clen);
+ }
+ return i == segCount;
+ }
+
+ /**
+ * This method parses the given pattern into segments seperated by wildcard
+ * '*' characters. Since wildcards are not being used in this case, the
+ * pattern consists of a single segment.
+ */
+ private void parseNoWildCards() {
+ this.fSegments = new String[1];
+ this.fSegments[0] = this.fPattern;
+ this.fBound = this.fLength;
+ }
+
+ /**
+ * Parses the given pattern into segments separated by wildcard '*'
+ * characters.
+ */
+ private void parseWildCards() {
+ if (this.fPattern.startsWith("*")) { //$NON-NLS-1$
+ this.fHasLeadingStar = true;
+ }
+ if (this.fPattern.endsWith("*")) { //$NON-NLS-1$
+ /* make sure it's not an escaped wildcard */
+ if (this.fLength > 1
+ && this.fPattern.charAt(this.fLength - 2) != '\\') {
+ this.fHasTrailingStar = true;
+ }
+ }
+
+ Vector<String> temp = new Vector<String>();
+
+ int pos = 0;
+ StringBuffer buf = new StringBuffer();
+ while (pos < this.fLength) {
+ char c = this.fPattern.charAt(pos++);
+ switch (c) {
+ case '\\':
+ if (pos >= this.fLength) {
+ buf.append(c);
+ } else {
+ char next = this.fPattern.charAt(pos++);
+ /* if it's an escape sequence */
+ if (next == '*' || next == '?' || next == '\\') {
+ buf.append(next);
+ } else {
+ /* not an escape sequence, just insert literally */
+ buf.append(c);
+ buf.append(next);
+ }
+ }
+ break;
+ case '*':
+ if (buf.length() > 0) {
+ /* new segment */
+ temp.addElement(buf.toString());
+ this.fBound += buf.length();
+ buf.setLength(0);
+ }
+ break;
+ case '?':
+ /* append special character representing single match wildcard */
+ buf.append(StringMatcher.SINGLE_WILD_CARD);
+ break;
+ default:
+ buf.append(c);
+ }
+ }
+
+ /* add last buffer to segment list */
+ if (buf.length() > 0) {
+ temp.addElement(buf.toString());
+ this.fBound += buf.length();
+ }
+
+ this.fSegments = new String[temp.size()];
+ temp.copyInto(this.fSegments);
+ }
+
+ /**
+ * @param text
+ * a string which contains no wildcard
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int posIn(final String text, final int start, final int end) {
+ int max = end - this.fLength;
+
+ if (!this.fIgnoreCase) {
+ int i = text.indexOf(this.fPattern, start);
+ if (i == -1 || i > max) {
+ return -1;
+ }
+ return i;
+ }
+
+ for (int i = start; i <= max; ++i) {
+ if (text.regionMatches(true, i, this.fPattern, 0, this.fLength)) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * @param text
+ * a simple regular expression that may only contain '?'(s)
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @param p
+ * a simple regular expression that may contains '?'
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int regExpPosIn(final String text, final int start,
+ final int end, final String p) {
+ int plen = p.length();
+
+ int max = end - plen;
+ for (int i = start; i <= max; ++i) {
+ if (regExpRegionMatches(text, i, p, 0, plen)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ *
+ * @return boolean
+ * @param text
+ * a String to match
+ * @param tStart
+ * indicates the starting index of match, inclusive
+ * @param p
+ * a simple regular expression that may contain '?'
+ */
+ protected boolean regExpRegionMatches(final String text, final int tStart,
+ final String p, final int pStart, final int plen) {
+ int curTStart = tStart;
+ int curPStart = pStart;
+ int curPlen = plen;
+
+ while (curPlen-- > 0) {
+ char tchar = text.charAt(curTStart++);
+ char pchar = p.charAt(curPStart++);
+
+ /* process wild cards */
+ if (!this.fIgnoreWildCards) {
+ /* skip single wild cards */
+ if (pchar == StringMatcher.SINGLE_WILD_CARD) {
+ continue;
+ }
+ }
+ if (pchar == tchar) {
+ continue;
+ }
+ if (this.fIgnoreCase) {
+ if (UCharacter.toUpperCase(tchar) == UCharacter
+ .toUpperCase(pchar)) {
+ continue;
+ }
+ // comparing after converting to upper case doesn't handle all
+ // cases;
+ // also compare after converting to lower case
+ if (UCharacter.toLowerCase(tchar) == UCharacter
+ .toLowerCase(pchar)) {
+ continue;
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param text
+ * the string to match
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @param p
+ * a string that has no wildcard
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int textPosIn(final String text, final int start, final int end,
+ final String p) {
+
+ int plen = p.length();
+ int max = end - plen;
+
+ if (!this.fIgnoreCase) {
+ int i = text.indexOf(p, start);
+ if (i == -1 || i > max) {
+ return -1;
+ }
+ return i;
+ }
+
+ for (int i = start; i <= max; ++i) {
+ if (text.regionMatches(true, i, p, 0, plen)) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.checkstyle b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.checkstyle
new file mode 100644
index 00000000000..cf229b786b2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.checkstyle
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2010 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Nicolas Guyomar (Mia-Software)
+-->
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="EmfFacet" location="../org.eclipse.emf.facet.archi.tech.rules/checkstyle/EmfFacet.checkstyle" type="project" description=""/>
+ <fileset name="all" enabled="true" check-config-name="EmfFacet" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ <file-match-pattern match-pattern="Messages.java" include-pattern="false"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.project
new file mode 100644
index 00000000000..1ea287d168c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.emf.facet.common.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..0475629b705
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//src/org/eclipse/emf/facet/common/ui/internal/messages.properties=ISO-8859-1
+encoding/<project>=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.runtime.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..c522e1f4ae2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt
new file mode 100644
index 00000000000..74b3fd9e6ee
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 339723 - Add x-friend on EMF Facet internal package
+ * Gregoire Dupe (Mia-Software) - Bug 339710 - org.eclipse.emf.facet.common.ui API Cleaning
+ *******************************************************************************/
+
+ org.eclipse.emf.facet.common.ui.internal.controls
+ x-internal:=used by org.eclipse.emf.facet.infra.*. No x-friends because we don't care about the warning in the "infra" plug-ins.
+
+ org.eclipse.emf.facet.common.ui.internal.views
+ x-friends:="org.eclipse.emf.facet.util.emf.ui" for EMF Facet internal utilization
+
+org.eclipse.emf.facet.common.ui.internal.widgets
+ x-friends:="org.eclipse.emf.facet.efacet.ui" for EMF Facet internal utilization
+ x-friends:="org.eclipse.emf.facet.util.emf.ui" for EMF Facet internal utilization \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..3b5b221702b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.common.ui;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.emf.facet.common.ui.internal.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.emf.facet.util.core;bundle-version="0.1.0",
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.ui.ide;bundle-version="3.6.0",
+ org.eclipse.papyrus.emf.facet.common.core;bundle-version="0.4.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.emf.facet.common.ui.internal,
+ org.eclipse.emf.facet.common.ui.internal.controls,
+ org.eclipse.emf.facet.common.ui.internal.controls.wrappers,
+ org.eclipse.emf.facet.common.ui.internal.exported.views,
+ org.eclipse.emf.facet.common.ui.internal.preference.pages,
+ org.eclipse.emf.facet.common.ui.internal.views,
+ org.eclipse.emf.facet.common.ui.internal.widgets
+
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..1d886dbddc4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Gregoire Dupe (Mia-Software) - Bug 366804 - [Restructuring] Table widget upgrade
+# Grégoire Dupé (Mia-Software) - Bug 388422 - [Table] Queries for InstanciationMethod needs to have 2 parameters
+###############################################################################
+#Properties file for org.eclipse.emf.facet.common.ui
+page.name = EMF Facet
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet Common UI (Incubation)
+category.name = EMF Facet
+emf.facet.examples = EMF Facet Examples \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html
new file mode 100644
index 00000000000..d1714826b27
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 4, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties
new file mode 100644
index 00000000000..c25a5e13db3
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.xml,\
+ OSGI-INF/
+src.includes = about.html
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/plugin.xml
new file mode 100644
index 00000000000..03a577f902b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/plugin.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2011 Mia-Software.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+ Gregoire Dupe (Mia-Software) - Bug 366804 - [Restructuring] Table widget upgrade
+ Grégoire Dupé (Mia-Software) - Bug 388422 - [Table] Queries for InstanciationMethod needs to have 2 parameters
+ -->
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.emf.facet.common.ui.internal.preference.pages.EmfFacetRootPreferencePage"
+ id="org.eclipse.emf.facet.common.ui.preference.pages.EmfFacetRootPreferencePage"
+ name="%page.name">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.emf.facet.common.ui.views"
+ name="%category.name">
+ </category>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <category
+ id="org.eclipse.emf.facet.common.ui.wizardsCategory"
+ name="%category.name">
+ </category>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ id="org.eclipse.emf.facet.common.ui.menu.examples"
+ label="%emf.facet.examples">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ </extension>
+</plugin>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Activator.java
new file mode 100644
index 00000000000..c5b166774cc
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Activator.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+ */
+package org.eclipse.emf.facet.common.ui.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.emf.facet.common.ui"; //$NON-NLS-1$
+
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ Activator.plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return Activator.plugin;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Messages.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Messages.java
new file mode 100644
index 00000000000..e7cbdcb86fd
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/Messages.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.emf.facet.common.ui.internal.messages"; //$NON-NLS-1$
+ public static String ElementsView_refreshJobTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/PersistableColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/PersistableColumn.java
new file mode 100644
index 00000000000..56a7b5875aa
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/PersistableColumn.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.Column;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.SortableTable;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.SortableTree;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.SortableWidget;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.SortableWidgetFactory;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.TableColumn;
+import org.eclipse.emf.facet.common.ui.internal.controls.wrappers.TreeColumn;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerColumn;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * A column in a {@link TreeViewer} or {@link TableViewer} that is sortable (using the given
+ * {@link ColumnLabelProvider}) and can save its width to an {@link IMemento}.
+ */
+public class PersistableColumn {
+
+ /**
+ * Saved column widths, static because we want to be able to save column widths during the
+ * session (if a view is closed and re-opened), instead of only when the workbench is closed
+ * (which is the case with {@link ViewPart#saveState(org.eclipse.ui.IMemento)})
+ */
+ private static final Map<String, Integer> COLUMN_WIDTHS = new HashMap<String, Integer>();
+
+ /** The unique id associated to this column */
+ private String fUniqueID;
+
+ /** The underlying JFace column */
+ private final ViewerColumn fViewerColumn;
+
+ private Column getColumn() {
+ if (this.fViewerColumn instanceof TreeViewerColumn) {
+ TreeViewerColumn treeViewerColumn = (TreeViewerColumn) this.fViewerColumn;
+ return new TreeColumn(treeViewerColumn.getColumn());
+ } else if (this.fViewerColumn instanceof TableViewerColumn) {
+ TableViewerColumn tableViewerColumn = (TableViewerColumn) this.fViewerColumn;
+ return new TableColumn(tableViewerColumn.getColumn());
+ }
+ throw new IllegalStateException("neither a table nor tree column"); //$NON-NLS-1$
+ }
+
+ /**
+ * Initialize a sortable column that can be persisted to an {@link IMemento} .
+ *
+ * @param columnText
+ * the title of the column
+ * @param uniqueID
+ * a unique id used to persist the column width
+ * @param defaultWidth
+ * the width to use if no previous information was saved
+ * @param columnLabelProvider
+ * the label provider for this column
+ */
+ protected void init(final String columnText, final String uniqueID, final int defaultWidth,
+ final ColumnLabelProvider columnLabelProvider) {
+ this.fUniqueID = uniqueID;
+ final Column column = getColumn();
+ column.setText(columnText);
+
+ Integer width = PersistableColumn.getColumnWidths().get(uniqueID);
+ if (width != null) {
+ column.setWidth(width.intValue());
+ } else {
+ column.setWidth(defaultWidth);
+ }
+ column.addControlListener(new ControlAdapter() {
+ @Override
+ public void controlResized(final ControlEvent e) {
+ PersistableColumn.getColumnWidths().put(uniqueID, new Integer(column.getWidth()));
+ }
+ });
+
+ this.fViewerColumn.setLabelProvider(columnLabelProvider);
+ }
+
+ /**
+ * Create a sortable column that can be persisted to an {@link IMemento}.
+ *
+ * @param columnText
+ * the title of the column
+ * @param uniqueID
+ * a unique id used to persist the column width
+ * @param defaultWidth
+ * the width to use if no previous information was saved
+ * @param columnLabelProvider
+ * the label provider for this column
+ * @param treeViewer
+ * the {@link TreeViewer} in which to create the column
+ */
+ public PersistableColumn(final String columnText, final String uniqueID,
+ final int defaultWidth, final ColumnLabelProvider columnLabelProvider,
+ final TreeViewer treeViewer) {
+ TreeViewerColumn treeViewerColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
+ this.fViewerColumn = treeViewerColumn;
+ init(columnText, uniqueID, defaultWidth, columnLabelProvider);
+
+ addSorter(new TreeColumn(treeViewerColumn.getColumn()),
+ getViewerSorter(columnLabelProvider), new SortableTree(treeViewer));
+ }
+
+ /**
+ * Create a sortable column that can be persisted to an {@link IMemento}.
+ *
+ * @param columnText
+ * the title of the column
+ * @param uniqueID
+ * a unique id used to persist the column width
+ * @param defaultWidth
+ * the width to use if no previous information was saved
+ * @param columnLabelProvider
+ * the label provider for this column
+ * @param tableViewer
+ * the {@link TableViewer} in which to create the column
+ */
+ public PersistableColumn(final String columnText, final String uniqueID,
+ final int defaultWidth, final ColumnLabelProvider columnLabelProvider,
+ final TableViewer tableViewer) {
+ TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
+ this.fViewerColumn = tableViewerColumn;
+ init(columnText, uniqueID, defaultWidth, columnLabelProvider);
+
+ addSorter(new TableColumn(tableViewerColumn.getColumn()),
+ getViewerSorter(columnLabelProvider), new SortableTable(tableViewer));
+ }
+
+ private static ViewerSorter getViewerSorter(final ColumnLabelProvider columnLabelProvider) {
+ return new ViewerSorter() {
+ @Override
+ public int compare(final Viewer viewer, final Object e1, final Object e2) {
+ String text1 = columnLabelProvider.getText(e1);
+ String text2 = columnLabelProvider.getText(e2);
+ if (text1 == null) {
+ return -1;
+ }
+ int compare = text1.compareTo(text2);
+ SortableWidget sortableWidget = SortableWidgetFactory.createSortableWidget(viewer);
+ if (sortableWidget.getSortDirection() == SWT.DOWN) {
+ compare = compare * -1;
+ }
+ return compare;
+ }
+ };
+ }
+
+ private static void addSorter(final Column column, final ViewerSorter viewerSorter,
+ final SortableWidget sortableWidget) {
+ column.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ sortableWidget.setSorter(viewerSorter);
+ sortableWidget.setSortColumn(column);
+ if (sortableWidget.getSortDirection() == SWT.UP) {
+ sortableWidget.setSortDirection(SWT.DOWN);
+ } else if (sortableWidget.getSortDirection() == SWT.DOWN) {
+ sortableWidget.setSortDirection(SWT.UP);
+ } else {
+ sortableWidget.setSortDirection(SWT.UP);
+ }
+ sortableWidget.refresh();
+ }
+ });
+ }
+
+ public void saveState(final IMemento memento) {
+ Integer width = PersistableColumn.getColumnWidths().get(this.fUniqueID);
+ if (width != null) {
+ memento.putInteger(this.fUniqueID, width.intValue());
+ }
+ }
+
+ /**
+ * Loads the saved state from the given {@link IMemento}. Columns created using the given id
+ * after this call will have their width set to the value that was loaded.
+ */
+ public static void loadState(final IMemento memento, final String columnID) {
+ Integer width = memento.getInteger(columnID);
+ if (width != null) {
+ PersistableColumn.getColumnWidths().put(columnID, width);
+ }
+ }
+
+ public void setWidth(final int width) {
+ getColumn().setWidth(width);
+ }
+
+ protected static Map<String, Integer> getColumnWidths() {
+ return PersistableColumn.COLUMN_WIDTHS;
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/Column.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/Column.java
new file mode 100644
index 00000000000..74ceb3887e2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/Column.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TreeColumn;
+
+/** Provides a unified API over both SWT {@link TreeColumn} and {@link TableColumn} */
+public interface Column {
+ void setText(String columnText);
+
+ void addControlListener(ControlListener controlListener);
+
+ void addSelectionListener(SelectionListener selectionListener);
+
+ void setWidth(int width);
+
+ int getWidth();
+
+ Item getColumn();
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java
new file mode 100644
index 00000000000..ef0b7552551
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+/**
+ * Implements {@link SortableWidget}'s unified API for the JFace {@link TableViewer}.
+ */
+public class SortableTable implements SortableWidget {
+ private final TableViewer tableViewer;
+
+ public SortableTable(final TableViewer tableViewer) {
+ this.tableViewer = tableViewer;
+ }
+
+ public void setSorter(final ViewerSorter viewerSorter) {
+ this.tableViewer.setSorter(viewerSorter);
+ }
+
+ public int getSortDirection() {
+ return this.tableViewer.getTable().getSortDirection();
+ }
+
+ public void setSortDirection(final int direction) {
+ this.tableViewer.getTable().setSortDirection(direction);
+ }
+
+ public void setSortColumn(final Column column) {
+ this.tableViewer.getTable().setSortColumn(
+ (org.eclipse.swt.widgets.TableColumn) column.getColumn());
+ }
+
+ public void refresh() {
+ this.tableViewer.refresh();
+ }
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java
new file mode 100644
index 00000000000..3f66f24fb0e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+/**
+ * Implements {@link SortableWidget}'s unified API for the JFace {@link TreeViewer}.
+ */
+public class SortableTree implements SortableWidget {
+ private final TreeViewer treeViewer;
+
+ public SortableTree(final TreeViewer treeViewer) {
+ this.treeViewer = treeViewer;
+ }
+
+ public void setSorter(final ViewerSorter viewerSorter) {
+ this.treeViewer.setSorter(viewerSorter);
+ }
+
+ public int getSortDirection() {
+ return this.treeViewer.getTree().getSortDirection();
+ }
+
+ public void setSortDirection(final int direction) {
+ this.treeViewer.getTree().setSortDirection(direction);
+ }
+
+ public void setSortColumn(final Column column) {
+ this.treeViewer.getTree().setSortColumn(
+ (org.eclipse.swt.widgets.TreeColumn) column.getColumn());
+ }
+
+ public void refresh() {
+ this.treeViewer.refresh();
+ }
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java
new file mode 100644
index 00000000000..ff9dfd9e921
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+
+/** Provides a unified API over both SWT {@link Tree} and {@link Table} */
+public interface SortableWidget {
+ void setSorter(ViewerSorter viewerSorter);
+
+ int getSortDirection();
+
+ void setSortDirection(int direction);
+
+ void setSortColumn(Column column);
+
+ void refresh();
+
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java
new file mode 100644
index 00000000000..ea310f5ab6b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+
+/**
+ * A factory to obtain a {@link SortableWidget}, that provides a unified API over both SWT
+ * {@link Tree} and {@link Table}.
+ */
+public final class SortableWidgetFactory {
+
+ private SortableWidgetFactory() {
+ // utility class
+ }
+
+ /**
+ * Get a {@link SortableWidget} for the given {@link Viewer}, that can be either a
+ * {@link TreeViewer} or a {@link TableViewer}.
+ *
+ * @param viewer
+ * a {@link TreeViewer} or a {@link TableViewer}
+ * @return a {@link SortableWidget} that delegates to the given viewer
+ */
+ public static SortableWidget createSortableWidget(final Viewer viewer) {
+ if (viewer instanceof TreeViewer) {
+ TreeViewer treeViewer = (TreeViewer) viewer;
+ return new SortableTree(treeViewer);
+ } else if (viewer instanceof TableViewer) {
+ TableViewer tableViewer = (TableViewer) viewer;
+ return new SortableTable(tableViewer);
+ }
+ throw new IllegalArgumentException();
+ }
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java
new file mode 100644
index 00000000000..141a06fa1f9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionListener;
+
+/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TableColumn} */
+public class TableColumn implements Column {
+ private final org.eclipse.swt.widgets.TableColumn column;
+
+ public TableColumn(final org.eclipse.swt.widgets.TableColumn column) {
+ this.column = column;
+ }
+
+ public void setText(final String columnText) {
+ this.column.setText(columnText);
+ }
+
+ public void setWidth(final int width) {
+ this.column.setWidth(width);
+
+ }
+
+ public void addControlListener(final ControlListener controlListener) {
+ this.column.addControlListener(controlListener);
+ }
+
+ public void addSelectionListener(final SelectionListener selectionListener) {
+ this.column.addSelectionListener(selectionListener);
+ }
+
+ public int getWidth() {
+ return this.column.getWidth();
+ }
+
+ public org.eclipse.swt.widgets.TableColumn getColumn() {
+ return this.column;
+ }
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java
new file mode 100644
index 00000000000..c30a1fb87c7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.controls.wrappers;
+
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionListener;
+
+/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TreeColumn} */
+public class TreeColumn implements Column {
+ private final org.eclipse.swt.widgets.TreeColumn column;
+
+ public TreeColumn(final org.eclipse.swt.widgets.TreeColumn column) {
+ this.column = column;
+ }
+
+ public void setText(final String columnText) {
+ this.column.setText(columnText);
+ }
+
+ public void setWidth(final int width) {
+ this.column.setWidth(width);
+
+ }
+
+ public void addControlListener(final ControlListener controlListener) {
+ this.column.addControlListener(controlListener);
+ }
+
+ public void addSelectionListener(final SelectionListener selectionListener) {
+ this.column.addSelectionListener(selectionListener);
+ }
+
+ public int getWidth() {
+ return this.column.getWidth();
+ }
+
+ public org.eclipse.swt.widgets.TreeColumn getColumn() {
+ return this.column;
+ }
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IColumnDescription.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IColumnDescription.java
new file mode 100644
index 00000000000..6aa019910c6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IColumnDescription.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.exported.views;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+
+/**
+ * Contains the data necessary to create a column in a view created by
+ * {@link IElementsViewFactory#createElementsView(java.util.Collection, org.eclipse.jface.viewers.ITreeContentProvider, Object, String, org.eclipse.swt.graphics.Image, org.eclipse.jface.viewers.IOpenListener) IElementsViewFactory#createElementsView}
+ */
+public interface IColumnDescription {
+ /** The column's label */
+ String getTitle();
+
+ /** A unique id for the column */
+ String getUniqueID();
+
+ /** The default width that will be used the first time the column is displayed */
+ int getDefaultWidth();
+
+ /**
+ * A label provider that returns the text (and optionally image and other font attributes) for each element in this
+ * column
+ */
+ ColumnLabelProvider getColumnLabelProvider();
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java
new file mode 100644
index 00000000000..271e4c969a0
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+
+package org.eclipse.emf.facet.common.ui.internal.exported.views;
+
+import java.util.Collection;
+
+import org.eclipse.emf.facet.common.ui.internal.views.ElementsViewFactory;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * Creates Eclipse views to display lists of elements. To be able to register this view in a non-RCP Eclipse, you will
+ * have to register an IExecutableExtensionFactory that will do the actual instantiation.
+ */
+public interface IElementsViewFactory {
+ IElementsViewFactory DEFAULT = new ElementsViewFactory();
+
+ /**
+ * Creates a view with columns. Each column has a default width, and memorizes its width once resized.
+ *
+ * @param columnDescriptions
+ * describes the columns
+ * @param contentProvider
+ * provides the content from the input
+ * @param input
+ * the view's input
+ * @param title
+ * the part's label
+ * @param titleImage
+ * the part's image
+ * @param openListener
+ * a listener called when hitting Enter or double-clicking on an element in the view
+ * @return the view part
+ */
+ ViewPart createElementsView(Collection<? extends IColumnDescription> columnDescriptions,
+ ITreeContentProvider contentProvider, Object input, String title, Image titleImage, IOpenListener openListener);
+
+ /**
+ * Creates a column description for
+ * {@link IElementsViewFactory#createElementsView(Collection, ITreeContentProvider, Object, String, Image, IOpenListener)
+ * createElementsView}
+ *
+ * @param title
+ * the column label
+ * @param uniqueID
+ * a unique ID that will identify the column (used for serialization)
+ * @param defaultWidth
+ * the initial width of the column, before the user resizes it
+ * @param columnLabelProvider
+ * A label provider that returns the text (and optionally image and other font attributes) for each
+ * element in this column
+ * @return a column description
+ */
+ IColumnDescription createColumnDescription(String title, String uniqueID,
+ int defaultWidth, ColumnLabelProvider columnLabelProvider);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/messages.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/messages.properties
new file mode 100644
index 00000000000..8505a5f4b7a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/messages.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2012 CEA LIST.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+###############################################################################
+ElementsView_refreshJobTitle=Refreshing view {0}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/preference/pages/EmfFacetRootPreferencePage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/preference/pages/EmfFacetRootPreferencePage.java
new file mode 100644
index 00000000000..28708ad05ef
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/preference/pages/EmfFacetRootPreferencePage.java
@@ -0,0 +1,59 @@
+/**********************************************************************************
+ * Copyright (c) 2011 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
+ ***********************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.preference.pages;
+
+import org.eclipse.emf.facet.common.ui.internal.Activator;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * This class is the EmfFacet root preference page that is contributed to the
+ * Preferences dialog. By sub-classing {@link FieldEditorPreferencePage}, we can
+ * use the field support built into JFace that allows us to create a page that
+ * is small and knows how to save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences, that are stored in the preference
+ * store that belongs to the main plug-in class. That way, preferences can be
+ * accessed directly via the preference store.
+ */
+
+public class EmfFacetRootPreferencePage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public static final String P_DEFAULT_EPACKAGE_VIEWER = "emf_facet_default_epackage_viewer"; //$NON-NLS-1$
+
+ public EmfFacetRootPreferencePage() {
+ super(FieldEditorPreferencePage.GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of the common
+ * GUI blocks needed to manipulate various types of preferences. Each field
+ * editor knows how to save and restore itself.
+ */
+ @Override
+ public void createFieldEditors() {
+ // The page is empty for now
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(final IWorkbench workbench) {
+ // Nothing to do
+ }
+
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/AbstractTreeView.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/AbstractTreeView.java
new file mode 100644
index 00000000000..5b176128e26
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/AbstractTreeView.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ *******************************************************************************/
+
+package org.eclipse.emf.facet.common.ui.internal.views;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.facet.common.ui.internal.Activator;
+import org.eclipse.emf.facet.common.ui.internal.controls.PersistableColumn;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+/** An abstract Eclipse view that displays a list of elements. */
+public abstract class AbstractTreeView extends ViewPart {
+
+ private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>();
+ private final Map<String, Integer> persistedValues = new HashMap<String, Integer>();
+
+ private static final int JOB_SCHEDULE_DELAY = 500;
+ private Job fRefreshJob = null;
+
+ private TreeViewer fTreeViewer;
+
+ public TreeViewer getViewer() {
+ return this.fTreeViewer;
+ }
+
+ @Override
+ public void createPartControl(final Composite parent) {
+ parent.setLayout(new FillLayout());
+
+ this.fTreeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE
+ | SWT.FULL_SELECTION);
+ this.fTreeViewer.getTree().setLinesVisible(true);
+ this.fTreeViewer.getTree().setHeaderVisible(true);
+
+ this.fTreeViewer.addOpenListener(new IOpenListener() {
+ public void open(final OpenEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) AbstractTreeView.this
+ .getViewer().getSelection();
+ openElement(selection.getFirstElement());
+ }
+ });
+
+ createColumns();
+
+ this.fTreeViewer.setContentProvider(getContentProvider());
+
+ createContextMenu();
+ getSite().setSelectionProvider(this.fTreeViewer);
+ refresh(false);
+ }
+
+ protected void createContextMenu() {
+ final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
+ contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ final Menu menu = contextMenu.createContextMenu(getViewer().getControl());
+ getViewer().getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, getViewer());
+ }
+
+ protected abstract void createColumns();
+
+ protected abstract IContentProvider getContentProvider();
+
+ protected abstract void openElement(Object element);
+
+ @Override
+ public void setFocus() {
+ this.fTreeViewer.getControl().setFocus();
+ }
+
+ /** Optionally delayed refresh */
+ protected void refresh(final boolean delayed) {
+ if (this.fRefreshJob == null) {
+ this.fRefreshJob = new Job(getRefreshMessage()) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ doRefresh();
+ return Status.OK_STATUS;
+ }
+ };
+ }
+ // delayed until it stops changing
+ this.fRefreshJob.cancel();
+ if (delayed) {
+ this.fRefreshJob.setPriority(Job.DECORATE);
+ this.fRefreshJob.schedule(AbstractTreeView.JOB_SCHEDULE_DELAY);
+ } else {
+ this.fRefreshJob.setPriority(Job.INTERACTIVE);
+ this.fRefreshJob.schedule();
+ }
+ }
+
+ protected abstract String getRefreshMessage();
+
+ protected abstract Object getInput();
+
+ protected void doRefresh() {
+ // Accesses the catalog, which can block if done inside the UI thread.
+ final Object input = getInput();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ getViewer().setInput(input);
+ getViewer().refresh();
+ }
+ });
+ }
+
+ protected void createColumn(final String columnText, final String uniqueID,
+ final int defaultWidth, final ColumnLabelProvider columnLabelProvider) {
+ PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID,
+ defaultWidth, columnLabelProvider, this.fTreeViewer);
+ this.columns.add(persistableColumn);
+ Integer width = this.persistedValues.get(uniqueID);
+ if (width != null) {
+ persistableColumn.setWidth(width.intValue());
+ }
+ }
+
+ @Override
+ public void saveState(final IMemento memento) {
+ super.saveState(memento);
+ try {
+ for (PersistableColumn column : this.columns) {
+ column.saveState(memento);
+ }
+ } catch (Exception e) {
+ Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void init(final IViewSite site, final IMemento memento) throws PartInitException {
+ super.init(site, memento);
+ if (memento != null) {
+ String[] attributeKeys = memento.getAttributeKeys();
+ for (String key : attributeKeys) {
+ this.persistedValues.put(key, memento.getInteger(key));
+ }
+ }
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsView.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsView.java
new file mode 100644
index 00000000000..28d18adac5c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsView.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.views;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.facet.common.ui.internal.Activator;
+import org.eclipse.emf.facet.common.ui.internal.Messages;
+import org.eclipse.emf.facet.common.ui.internal.controls.PersistableColumn;
+import org.eclipse.emf.facet.common.ui.internal.exported.views.IColumnDescription;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+public class ElementsView extends ViewPart {
+
+ private static final int JOB_SCHEDULE_DELAY = 500;
+ private final Collection<? extends IColumnDescription> columnDescriptions;
+ private final ITreeContentProvider contentProvider;
+ private final Object input;
+ private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>();
+ private final Map<String, Integer> persistedValues = new HashMap<String, Integer>();
+ private TreeViewer treeViewer;
+ private Job refreshJob = null;
+ private final IOpenListener openListener;
+ private final String title;
+ private final Image titleImage;
+
+ public ElementsView(final Collection<? extends IColumnDescription> columnDescriptions,
+ final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) {
+ this.columnDescriptions = columnDescriptions;
+ this.contentProvider = contentProvider;
+ this.input = input;
+ this.title = title;
+ this.titleImage = titleImage;
+ this.openListener = openListener;
+ }
+
+ public TreeViewer getViewer() {
+ return this.treeViewer;
+ }
+
+ @Override
+ public void createPartControl(final Composite parent) {
+ setPartName(this.title);
+ setTitleImage(this.titleImage);
+ parent.setLayout(new FillLayout());
+
+ this.treeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE
+ | SWT.FULL_SELECTION);
+ this.treeViewer.getTree().setLinesVisible(true);
+ this.treeViewer.getTree().setHeaderVisible(true);
+
+ this.treeViewer.addOpenListener(new IOpenListener() {
+ public void open(final OpenEvent event) {
+ ElementsView.this.open(event);
+ }
+ });
+
+ createColumns();
+ this.treeViewer.setContentProvider(getContentProvider());
+ createContextMenu();
+ getSite().setSelectionProvider(this.treeViewer);
+ refresh(false);
+ }
+
+ protected void createContextMenu() {
+ final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
+ contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ final Menu menu = contextMenu.createContextMenu(getViewer().getControl());
+ getViewer().getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, getViewer());
+ }
+
+ protected void createColumns() {
+ for (IColumnDescription columnDescription : this.columnDescriptions) {
+ createColumn(columnDescription.getTitle(), columnDescription.getUniqueID(),
+ columnDescription.getDefaultWidth(), columnDescription.getColumnLabelProvider());
+ }
+ }
+
+ protected IContentProvider getContentProvider() {
+ return this.contentProvider;
+ }
+
+ protected void open(final OpenEvent event) {
+ if (this.openListener != null) {
+ this.openListener.open(event);
+ }
+ }
+
+ @Override
+ public void setFocus() {
+ this.treeViewer.getControl().setFocus();
+ }
+
+ /** Optionally delayed refresh */
+ protected void refresh(final boolean delayed) {
+ if (this.refreshJob == null) {
+ this.refreshJob = new Job(getRefreshMessage()) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ doRefresh();
+ return Status.OK_STATUS;
+ }
+ };
+ }
+ // delayed until it stops changing
+ this.refreshJob.cancel();
+ if (delayed) {
+ this.refreshJob.setPriority(Job.DECORATE);
+ this.refreshJob.schedule(ElementsView.JOB_SCHEDULE_DELAY);
+ } else {
+ this.refreshJob.setPriority(Job.INTERACTIVE);
+ this.refreshJob.schedule();
+ }
+ }
+
+ protected String getRefreshMessage() {
+ return NLS.bind(Messages.ElementsView_refreshJobTitle, this.title);
+ }
+
+ protected Object getInput() {
+ return this.input;
+ }
+
+ protected void doRefresh() {
+ // Accesses the catalog, which can block if done inside the UI thread.
+ final Object viewerInput = getInput();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ getViewer().setInput(viewerInput);
+ getViewer().refresh();
+ }
+ });
+ }
+
+ protected void createColumn(final String columnText, final String uniqueID,
+ final int defaultWidth, final ColumnLabelProvider columnLabelProvider) {
+ PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID,
+ defaultWidth, columnLabelProvider, this.treeViewer);
+ this.columns.add(persistableColumn);
+ Integer width = this.persistedValues.get(uniqueID);
+ if (width != null) {
+ persistableColumn.setWidth(width.intValue());
+ }
+ }
+
+ @Override
+ public void saveState(final IMemento memento) {
+ super.saveState(memento);
+ try {
+ for (PersistableColumn column : this.columns) {
+ column.saveState(memento);
+ }
+ } catch (Exception e) {
+ Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void init(final IViewSite site, final IMemento memento) throws PartInitException {
+ super.init(site, memento);
+ if (memento != null) {
+ String[] attributeKeys = memento.getAttributeKeys();
+ for (String key : attributeKeys) {
+ this.persistedValues.put(key, memento.getInteger(key));
+ }
+ }
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsViewFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsViewFactory.java
new file mode 100644
index 00000000000..ed4539ab2d4
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/views/ElementsViewFactory.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+
+package org.eclipse.emf.facet.common.ui.internal.views;
+
+import java.util.Collection;
+
+import org.eclipse.emf.facet.common.ui.internal.exported.views.IColumnDescription;
+import org.eclipse.emf.facet.common.ui.internal.exported.views.IElementsViewFactory;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.part.ViewPart;
+
+public class ElementsViewFactory implements IElementsViewFactory {
+
+ public ViewPart createElementsView(final Collection<? extends IColumnDescription> columns,
+ final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) {
+ return new ElementsView(columns, contentProvider, input, title, titleImage, openListener);
+ }
+
+ public IColumnDescription createColumnDescription(final String columnText,
+ final String uniqueID, final int defaultWidth,
+ final ColumnLabelProvider columnLabelProvider) {
+ return new IColumnDescription() {
+ public String getUniqueID() {
+ return uniqueID;
+ }
+
+ public int getDefaultWidth() {
+ return defaultWidth;
+ }
+
+ public String getTitle() {
+ return columnText;
+ }
+
+ public ColumnLabelProvider getColumnLabelProvider() {
+ return columnLabelProvider;
+ }
+ };
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java
new file mode 100644
index 00000000000..393a2adc01b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software)
+ *******************************************************************************/
+package org.eclipse.emf.facet.common.ui.internal.widgets;
+
+import org.eclipse.emf.facet.common.core.internal.utils.StringMatcher;
+import org.eclipse.ui.dialogs.FilteredList.FilterMatcher;
+
+/** This is a matcher that matches anywhere, not just at the beginning. */
+public class AnywhereFilterMatcher implements FilterMatcher {
+ private StringMatcher fMatcher;
+
+ public void setFilter(final String pattern, final boolean ignoreCase,
+ final boolean ignoreWildCards) {
+ this.fMatcher = new StringMatcher('*' + pattern + '*', ignoreCase, ignoreWildCards);
+ }
+
+ public boolean match(final Object element) {
+ return this.fMatcher.match(element.toString());
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.checkstyle b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.checkstyle
new file mode 100644
index 00000000000..0c5acfea9be
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.checkstyle
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2011 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Nicolas Guyomar (Mia-Software) - initial API and implementation
+-->
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <local-check-config name="EmfFacet" location="../org.eclipse.emf.facet.archi.tech.rules/checkstyle/EmfFacet.checkstyle" type="project" description=""/>
+ <fileset name="all" enabled="true" check-config-name="EmfFacet" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ <file-match-pattern match-pattern="Messages.java" include-pattern="false"/>
+ </fileset>
+ <filter name="FilesFromPackage" enabled="true">
+ <filter-data value="src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog"/>
+ <filter-data value="src/org/eclipse/emf/facet/efacet/catalog/v0_2_0"/>
+ </filter>
+</fileset-config>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.classpath
new file mode 100644
index 00000000000..45f024e850e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.project
new file mode 100644
index 00000000000..1f680ea0e54
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.emf.facet.efacet.catalog</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..bd87dd8a73f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Wed Sep 21 10:44:03 CEST 2011
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..1602c39b6fa
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,81 @@
+#Tue Oct 25 17:54:12 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=warning
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=warning
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=warning
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=warning
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=warning
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..bab0de2b63e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.efacet.catalog;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %Bundle-Vendor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore,
+ org.eclipse.papyrus.emf.facet.util.emf.catalog,
+ org.eclipse.emf.facet.efacet,
+ org.eclipse.emf.facet.efacet.metamodel;bundle-version="0.2.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.emf.facet.efacet.catalog.plugin.Activator
+Export-Package: org.eclipse.emf.facet.efacet.catalog.efacetcatalog
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..4c0e9ee0d96
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2011 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+###############################################################################
+#Properties file for org.eclipse.emf.facet.efacet.core
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet eFacet catalog (Deprecated) (Incubation) \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/about.html
new file mode 100644
index 00000000000..05cdf47ada9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 10, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/build.properties
new file mode 100644
index 00000000000..d37e40ae981
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/build.properties
@@ -0,0 +1,22 @@
+###########################################################################
+# Copyright (c) 2011 Mia-Software.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Gregoire Dupe (Mia-Software) - Design
+# Nicolas Guyomar (Mia-Software) - Implementation - Bug 333553 - The user has not to deal with two files to create a facet
+###########################################################################
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ OSGI-INF/,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.ecore b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.ecore
new file mode 100644
index 00000000000..1a64fe197bd
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.ecore
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage 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" name="efacetcatalog"
+ nsURI="http://www.eclipse.org/emf/facet/eFacetCatalog/0.1.incubation" nsPrefix="efacetcatalog">
+ <eClassifiers xsi:type="ecore:EClass" name="QuerySetCatalog" eSuperTypes="platform:/plugin/org.eclipse.emf.facet.util.emf.catalog/model/catalog.ecore#//Catalog">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="A QuerySetCatalog aims at referencing EMF Facet QuerySet."/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="installedQuerySets" upperBound="-1"
+ eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.efacet/model/efacet.ecore#//QuerySet"
+ volatile="true" transient="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="validationDelegates" value="self.installedQuerySets = self.installedEntries"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="&quot;installedQuerySets&quot; derived link aims at providing a direct access to QuerySet objects in the catalog."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="FacetSetCatalog" eSuperTypes="platform:/plugin/org.eclipse.emf.facet.util.emf.catalog/model/catalog.ecore#//Catalog">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="A FacetSetCatalog aims at referencing EMF Facet FacetSet."/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="installedFacetSets" upperBound="-1"
+ eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.efacet/model/efacet.ecore#//FacetSet"
+ volatile="true" transient="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+ <details key="validationDelegates" value="self.installedFacetSets = self.installedEntries"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="&quot;installedFacetSets&quot; derived link aims at providing a direct access to FacetSet objects in the catalog."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.genmodel b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.genmodel
new file mode 100644
index 00000000000..1d74cd4a58e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/model/efacetcatalog.genmodel
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText=" Copyright (c) 2011 Mia-Software.&#xD;&#xA; &#xD;&#xA; All rights reserved. This program and the accompanying materials&#xD;&#xA; are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA; which accompanies this distribution, and is available at&#xD;&#xA; http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA; &#xD;&#xA; Contributors:&#xD;&#xA;&#x9;Gregoire Dupe (Mia-Software) - Design&#xD;&#xA;&#x9;Nicolas Guyomar (Mia-Software) - Implementation&#xD;&#xA; "
+ modelDirectory="/org.eclipse.emf.facet.efacet.catalog/src" editDirectory="/org.eclipse.emf.facet.efacet.catalog.edit/src"
+ editorDirectory="/org.eclipse.emf.facet.efacet.catalog.editor/src" modelPluginID="org.eclipse.emf.facet.efacet.catalog"
+ modelName="Efacetcatalog" nonNLSMarkers="true" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false" editPluginID="org.eclipse.emf.facet.efacet.catalog.edit"
+ editorPluginID="org.eclipse.emf.facet.efacet.catalog.editor" runtimeVersion="2.6"
+ usedGenPackages="platform:/plugin/org.eclipse.emf.facet.util.emf.catalog/model/catalog.genmodel#//catalog platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.emf.facet.efacet/model/efacet.genmodel#//efacet">
+ <foreignModel>efacetcatalog.ecore</foreignModel>
+ <genPackages prefix="Efacetcatalog" basePackage="org.eclipse.emf.facet.efacet.catalog"
+ disposableProviderFactory="true" ecorePackage="efacetcatalog.ecore#/">
+ <genClasses ecoreClass="efacetcatalog.ecore#//QuerySetCatalog">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference efacetcatalog.ecore#//QuerySetCatalog/installedQuerySets"/>
+ </genClasses>
+ <genClasses ecoreClass="efacetcatalog.ecore#//FacetSetCatalog">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference efacetcatalog.ecore#//FacetSetCatalog/installedFacetSets"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/plugin.xml
new file mode 100644
index 00000000000..4ead0b974e3
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/emf/facet/eFacetCatalog/0.1.incubation"
+ class="org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage"
+ genModel="model/efacetcatalog.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogFactory.java
new file mode 100644
index 00000000000..3daa6287f00
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogFactory.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each
+ * non-abstract class of the model. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public interface EfacetcatalogFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EfacetcatalogFactory eINSTANCE = org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Query Set Catalog</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Query Set Catalog</em>'.
+ * @generated
+ */
+ QuerySetCatalog createQuerySetCatalog();
+
+ /**
+ * Returns a new object of class '<em>Facet Set Catalog</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Facet Set Catalog</em>'.
+ * @generated
+ */
+ FacetSetCatalog createFacetSetCatalog();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ EfacetcatalogPackage getEfacetcatalogPackage();
+
+} //EfacetcatalogFactory
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogPackage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogPackage.java
new file mode 100644
index 00000000000..32c357fe603
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/EfacetcatalogPackage.java
@@ -0,0 +1,266 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.facet.util.emf.catalog.CatalogPackage;
+
+/**
+ * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta
+ * objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogFactory
+ * @model kind="package"
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public interface EfacetcatalogPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "efacetcatalog"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/emf/facet/eFacetCatalog/0.1.incubation"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "efacetcatalog"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EfacetcatalogPackage eINSTANCE = org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl <em>Query Set Catalog</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogPackageImpl#getQuerySetCatalog()
+ * @generated
+ */
+ int QUERY_SET_CATALOG = 0;
+
+ /**
+ * The feature id for the '<em><b>Installed Entries</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUERY_SET_CATALOG__INSTALLED_ENTRIES = CatalogPackage.CATALOG__INSTALLED_ENTRIES;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUERY_SET_CATALOG__NAME = CatalogPackage.CATALOG__NAME;
+
+ /**
+ * The feature id for the '<em><b>Installed Query Sets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUERY_SET_CATALOG__INSTALLED_QUERY_SETS = CatalogPackage.CATALOG_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Query Set Catalog</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int QUERY_SET_CATALOG_FEATURE_COUNT = CatalogPackage.CATALOG_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl <em>Facet Set Catalog</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogPackageImpl#getFacetSetCatalog()
+ * @generated
+ */
+ int FACET_SET_CATALOG = 1;
+
+ /**
+ * The feature id for the '<em><b>Installed Entries</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACET_SET_CATALOG__INSTALLED_ENTRIES = CatalogPackage.CATALOG__INSTALLED_ENTRIES;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACET_SET_CATALOG__NAME = CatalogPackage.CATALOG__NAME;
+
+ /**
+ * The feature id for the '<em><b>Installed Facet Sets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACET_SET_CATALOG__INSTALLED_FACET_SETS = CatalogPackage.CATALOG_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Facet Set Catalog</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACET_SET_CATALOG_FEATURE_COUNT = CatalogPackage.CATALOG_FEATURE_COUNT + 1;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog <em>Query Set Catalog</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Query Set Catalog</em>'.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog
+ * @generated
+ */
+ EClass getQuerySetCatalog();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog#getInstalledQuerySets <em>Installed Query Sets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Installed Query Sets</em>'.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog#getInstalledQuerySets()
+ * @see #getQuerySetCatalog()
+ * @generated
+ */
+ EReference getQuerySetCatalog_InstalledQuerySets();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog <em>Facet Set Catalog</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Facet Set Catalog</em>'.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog
+ * @generated
+ */
+ EClass getFacetSetCatalog();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog#getInstalledFacetSets <em>Installed Facet Sets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Installed Facet Sets</em>'.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog#getInstalledFacetSets()
+ * @see #getFacetSetCatalog()
+ * @generated
+ */
+ EReference getFacetSetCatalog_InstalledFacetSets();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ EfacetcatalogFactory getEfacetcatalogFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl <em>Query Set Catalog</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogPackageImpl#getQuerySetCatalog()
+ * @generated
+ */
+ EClass QUERY_SET_CATALOG = eINSTANCE.getQuerySetCatalog();
+
+ /**
+ * The meta object literal for the '<em><b>Installed Query Sets</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference QUERY_SET_CATALOG__INSTALLED_QUERY_SETS = eINSTANCE.getQuerySetCatalog_InstalledQuerySets();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl <em>Facet Set Catalog</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.EfacetcatalogPackageImpl#getFacetSetCatalog()
+ * @generated
+ */
+ EClass FACET_SET_CATALOG = eINSTANCE.getFacetSetCatalog();
+
+ /**
+ * The meta object literal for the '<em><b>Installed Facet Sets</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference FACET_SET_CATALOG__INSTALLED_FACET_SETS = eINSTANCE.getFacetSetCatalog_InstalledFacetSets();
+
+ }
+
+} //EfacetcatalogPackage
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/FacetSetCatalog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/FacetSetCatalog.java
new file mode 100644
index 00000000000..9b395a804f5
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/FacetSetCatalog.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.facet.efacet.FacetSet;
+import org.eclipse.emf.facet.util.emf.catalog.Catalog;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Facet Set Catalog</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> A FacetSetCatalog aims at referencing EMF Facet FacetSet. <!--
+ * end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog#getInstalledFacetSets
+ * <em>Installed Facet Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage#getFacetSetCatalog()
+ * @model
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public interface FacetSetCatalog extends Catalog {
+ /**
+ * Returns the value of the '<em><b>Installed Facet Sets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.facet.efacet.FacetSet}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * "installedFacetSets" derived link aims at providing a direct access to FacetSet objects in the catalog.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Installed Facet Sets</em>' reference list.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage#getFacetSetCatalog_InstalledFacetSets()
+ * @model transient="true" volatile="true" derived="true"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore validationDelegates='self.installedFacetSets = self.installedEntries'"
+ * @generated
+ */
+ EList<FacetSet> getInstalledFacetSets();
+
+} // FacetSetCatalog
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/QuerySetCatalog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/QuerySetCatalog.java
new file mode 100644
index 00000000000..674883a72a9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/QuerySetCatalog.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.facet.efacet.QuerySet;
+import org.eclipse.emf.facet.util.emf.catalog.Catalog;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Query Set Catalog</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> A QuerySetCatalog aims at referencing EMF Facet QuerySet. <!--
+ * end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog#getInstalledQuerySets
+ * <em>Installed Query Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage#getQuerySetCatalog()
+ * @model
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public interface QuerySetCatalog extends Catalog {
+ /**
+ * Returns the value of the '<em><b>Installed Query Sets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.facet.efacet.QuerySet}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * "installedQuerySets" derived link aims at providing a direct access to QuerySet objects in the catalog.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Installed Query Sets</em>' reference list.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage#getQuerySetCatalog_InstalledQuerySets()
+ * @model transient="true" volatile="true" derived="true"
+ * annotation="http://www.eclipse.org/emf/2002/Ecore validationDelegates='self.installedQuerySets = self.installedEntries'"
+ * @generated
+ */
+ EList<QuerySet> getInstalledQuerySets();
+
+} // QuerySetCatalog
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogFactoryImpl.java
new file mode 100644
index 00000000000..40bab2035b2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogFactoryImpl.java
@@ -0,0 +1,118 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogFactory;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
+ *
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class EfacetcatalogFactoryImpl extends EFactoryImpl implements EfacetcatalogFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static EfacetcatalogFactory init() {
+ try {
+ EfacetcatalogFactory theEfacetcatalogFactory = (EfacetcatalogFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/facet/eFacetCatalog/0.1.incubation"); //$NON-NLS-1$
+ if (theEfacetcatalogFactory != null) {
+ return theEfacetcatalogFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new EfacetcatalogFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EfacetcatalogFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(final EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG: return createQuerySetCatalog();
+ case EfacetcatalogPackage.FACET_SET_CATALOG: return createFacetSetCatalog();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuerySetCatalog createQuerySetCatalog() {
+ QuerySetCatalogImpl querySetCatalog = new QuerySetCatalogImpl();
+ return querySetCatalog;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FacetSetCatalog createFacetSetCatalog() {
+ FacetSetCatalogImpl facetSetCatalog = new FacetSetCatalogImpl();
+ return facetSetCatalog;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EfacetcatalogPackage getEfacetcatalogPackage() {
+ return (EfacetcatalogPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static EfacetcatalogPackage getPackage() {
+ return EfacetcatalogPackage.eINSTANCE;
+ }
+
+} //EfacetcatalogFactoryImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogPackageImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogPackageImpl.java
new file mode 100644
index 00000000000..a195260fcee
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/EfacetcatalogPackageImpl.java
@@ -0,0 +1,257 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.facet.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogFactory;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog;
+import org.eclipse.emf.facet.util.emf.catalog.CatalogPackage;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
+ *
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class EfacetcatalogPackageImpl extends EPackageImpl implements EfacetcatalogPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass querySetCatalogEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass facetSetCatalogEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private EfacetcatalogPackageImpl() {
+ super(eNS_URI, EfacetcatalogFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link EfacetcatalogPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static EfacetcatalogPackage init() {
+ if (isInited) return (EfacetcatalogPackage)EPackage.Registry.INSTANCE.getEPackage(EfacetcatalogPackage.eNS_URI);
+
+ // Obtain or create and register package
+ EfacetcatalogPackageImpl theEfacetcatalogPackage = (EfacetcatalogPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EfacetcatalogPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EfacetcatalogPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ CatalogPackage.eINSTANCE.eClass();
+ EFacetPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theEfacetcatalogPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theEfacetcatalogPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theEfacetcatalogPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(EfacetcatalogPackage.eNS_URI, theEfacetcatalogPackage);
+ return theEfacetcatalogPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getQuerySetCatalog() {
+ return querySetCatalogEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getQuerySetCatalog_InstalledQuerySets() {
+ return (EReference)querySetCatalogEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getFacetSetCatalog() {
+ return facetSetCatalogEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getFacetSetCatalog_InstalledFacetSets() {
+ return (EReference)facetSetCatalogEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EfacetcatalogFactory getEfacetcatalogFactory() {
+ return (EfacetcatalogFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ querySetCatalogEClass = createEClass(QUERY_SET_CATALOG);
+ createEReference(querySetCatalogEClass, QUERY_SET_CATALOG__INSTALLED_QUERY_SETS);
+
+ facetSetCatalogEClass = createEClass(FACET_SET_CATALOG);
+ createEReference(facetSetCatalogEClass, FACET_SET_CATALOG__INSTALLED_FACET_SETS);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ CatalogPackage theCatalogPackage = (CatalogPackage)EPackage.Registry.INSTANCE.getEPackage(CatalogPackage.eNS_URI);
+ EFacetPackage theEFacetPackage = (EFacetPackage)EPackage.Registry.INSTANCE.getEPackage(EFacetPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ querySetCatalogEClass.getESuperTypes().add(theCatalogPackage.getCatalog());
+ facetSetCatalogEClass.getESuperTypes().add(theCatalogPackage.getCatalog());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(querySetCatalogEClass, QuerySetCatalog.class, "QuerySetCatalog", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEReference(getQuerySetCatalog_InstalledQuerySets(), theEFacetPackage.getQuerySet(), null, "installedQuerySets", null, 0, -1, QuerySetCatalog.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ initEClass(facetSetCatalogEClass, FacetSetCatalog.class, "FacetSetCatalog", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEReference(getFacetSetCatalog_InstalledFacetSets(), theEFacetPackage.getFacetSet(), null, "installedFacetSets", null, 0, -1, FacetSetCatalog.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://www.eclipse.org/emf/2002/Ecore
+ createEcoreAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createEcoreAnnotations() {
+ String source = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$
+ addAnnotation
+ (getQuerySetCatalog_InstalledQuerySets(),
+ source,
+ new String[] {
+ "validationDelegates", "self.installedQuerySets = self.installedEntries" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getFacetSetCatalog_InstalledFacetSets(),
+ source,
+ new String[] {
+ "validationDelegates", "self.installedFacetSets = self.installedEntries" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ }
+
+} //EfacetcatalogPackageImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/FacetSetCatalogImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/FacetSetCatalogImpl.java
new file mode 100644
index 00000000000..498e2aedba5
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/FacetSetCatalogImpl.java
@@ -0,0 +1,248 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectEList;
+import org.eclipse.emf.ecore.util.EObjectEList.Unsettable;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.emf.facet.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Facet Set Catalog</b></em>
+ * '. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl#getInstalledEntries
+ * <em>Installed Entries</em>}</li>
+ * <li>{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl#getName
+ * <em>Name</em>}</li>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.FacetSetCatalogImpl#getInstalledFacetSets
+ * <em>Installed Facet Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class FacetSetCatalogImpl extends EObjectImpl implements FacetSetCatalog {
+ /**
+ * The cached value of the '{@link #getInstalledEntries() <em>Installed Entries</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInstalledEntries()
+ * @generated
+ * @ordered
+ */
+ protected EList<EObject> installedEntries;
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FacetSetCatalogImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EfacetcatalogPackage.Literals.FACET_SET_CATALOG;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EObject> getInstalledEntries() {
+ if (installedEntries == null) {
+ installedEntries = new EObjectResolvingEList<EObject>(EObject.class, this, EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_ENTRIES);
+ }
+ return installedEntries;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(final String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EfacetcatalogPackage.FACET_SET_CATALOG__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public EList<FacetSet> getInstalledFacetSets() {
+ Unsettable<FacetSet> unsettableList = new EObjectEList.Unsettable<FacetSet>(
+ FacetSet.class, this, EfacetcatalogPackage.eINSTANCE
+ .getFacetSetCatalog_InstalledFacetSets().getFeatureID());
+ for (Object object : this.installedEntries) {
+ if (object instanceof FacetSet) {
+ FacetSet querySetImpl = (FacetSet) object;
+ unsettableList.add(querySetImpl);
+ }
+ }
+ return unsettableList;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
+ switch (featureID) {
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_ENTRIES:
+ return getInstalledEntries();
+ case EfacetcatalogPackage.FACET_SET_CATALOG__NAME:
+ return getName();
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_FACET_SETS:
+ return getInstalledFacetSets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(final int featureID, final Object newValue) {
+ switch (featureID) {
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_ENTRIES:
+ getInstalledEntries().clear();
+ getInstalledEntries().addAll((Collection<? extends EObject>)newValue);
+ return;
+ case EfacetcatalogPackage.FACET_SET_CATALOG__NAME:
+ setName((String)newValue);
+ return;
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_FACET_SETS:
+ getInstalledFacetSets().clear();
+ getInstalledFacetSets().addAll((Collection<? extends FacetSet>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(final int featureID) {
+ switch (featureID) {
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_ENTRIES:
+ getInstalledEntries().clear();
+ return;
+ case EfacetcatalogPackage.FACET_SET_CATALOG__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_FACET_SETS:
+ getInstalledFacetSets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(final int featureID) {
+ switch (featureID) {
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_ENTRIES:
+ return installedEntries != null && !installedEntries.isEmpty();
+ case EfacetcatalogPackage.FACET_SET_CATALOG__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case EfacetcatalogPackage.FACET_SET_CATALOG__INSTALLED_FACET_SETS:
+ return !getInstalledFacetSets().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //FacetSetCatalogImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/QuerySetCatalogImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/QuerySetCatalogImpl.java
new file mode 100644
index 00000000000..9e50fabe58a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/impl/QuerySetCatalogImpl.java
@@ -0,0 +1,248 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectEList;
+import org.eclipse.emf.ecore.util.EObjectEList.Unsettable;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.emf.facet.efacet.QuerySet;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Query Set Catalog</b></em>
+ * '. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl#getInstalledEntries
+ * <em>Installed Entries</em>}</li>
+ * <li>{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl#getName
+ * <em>Name</em>}</li>
+ * <li>
+ * {@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.impl.QuerySetCatalogImpl#getInstalledQuerySets
+ * <em>Installed Query Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class QuerySetCatalogImpl extends EObjectImpl implements QuerySetCatalog {
+ /**
+ * The cached value of the '{@link #getInstalledEntries() <em>Installed Entries</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInstalledEntries()
+ * @generated
+ * @ordered
+ */
+ protected EList<EObject> installedEntries;
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuerySetCatalogImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EfacetcatalogPackage.Literals.QUERY_SET_CATALOG;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EObject> getInstalledEntries() {
+ if (installedEntries == null) {
+ installedEntries = new EObjectResolvingEList<EObject>(EObject.class, this, EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_ENTRIES);
+ }
+ return installedEntries;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(final String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EfacetcatalogPackage.QUERY_SET_CATALOG__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public EList<QuerySet> getInstalledQuerySets() {
+ Unsettable<QuerySet> unsettableList = new EObjectEList.Unsettable<QuerySet>(
+ QuerySet.class, this, EfacetcatalogPackage.eINSTANCE
+ .getQuerySetCatalog_InstalledQuerySets().getFeatureID());
+ for (Object object : this.getInstalledEntries()) {
+ if (object instanceof QuerySet) {
+ QuerySet querySetImpl = (QuerySet) object;
+ unsettableList.add(querySetImpl);
+ }
+ }
+ return unsettableList;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
+ switch (featureID) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_ENTRIES:
+ return getInstalledEntries();
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__NAME:
+ return getName();
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_QUERY_SETS:
+ return getInstalledQuerySets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(final int featureID, final Object newValue) {
+ switch (featureID) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_ENTRIES:
+ getInstalledEntries().clear();
+ getInstalledEntries().addAll((Collection<? extends EObject>)newValue);
+ return;
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__NAME:
+ setName((String)newValue);
+ return;
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_QUERY_SETS:
+ getInstalledQuerySets().clear();
+ getInstalledQuerySets().addAll((Collection<? extends QuerySet>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(final int featureID) {
+ switch (featureID) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_ENTRIES:
+ getInstalledEntries().clear();
+ return;
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_QUERY_SETS:
+ getInstalledQuerySets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(final int featureID) {
+ switch (featureID) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_ENTRIES:
+ return installedEntries != null && !installedEntries.isEmpty();
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case EfacetcatalogPackage.QUERY_SET_CATALOG__INSTALLED_QUERY_SETS:
+ return !getInstalledQuerySets().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuerySetCatalogImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogAdapterFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogAdapterFactory.java
new file mode 100644
index 00000000000..c677081027b
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogAdapterFactory.java
@@ -0,0 +1,168 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog;
+import org.eclipse.emf.facet.util.emf.catalog.Catalog;
+
+/**
+ * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter
+ * <code>createXXX</code> method for each class of the model. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class EfacetcatalogAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EfacetcatalogPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EfacetcatalogAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = EfacetcatalogPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(final Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EfacetcatalogSwitch<Adapter> modelSwitch =
+ new EfacetcatalogSwitch<Adapter>() {
+ @Override
+ public Adapter caseQuerySetCatalog(final QuerySetCatalog object) {
+ return createQuerySetCatalogAdapter();
+ }
+ @Override
+ public Adapter caseFacetSetCatalog(final FacetSetCatalog object) {
+ return createFacetSetCatalogAdapter();
+ }
+ @Override
+ public Adapter caseCatalog(final Catalog object) {
+ return createCatalogAdapter();
+ }
+ @Override
+ public Adapter defaultCase(final EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(final Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog <em>Query Set Catalog</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog
+ * @generated
+ */
+ public Adapter createQuerySetCatalogAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog <em>Facet Set Catalog</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog
+ * @generated
+ */
+ public Adapter createFacetSetCatalogAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.facet.util.emf.catalog.Catalog <em>Catalog</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.facet.util.emf.catalog.Catalog
+ * @generated
+ */
+ public Adapter createCatalogAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //EfacetcatalogAdapterFactory
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogSwitch.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogSwitch.java
new file mode 100644
index 00000000000..d295757dd7c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/efacetcatalog/util/EfacetcatalogSwitch.java
@@ -0,0 +1,176 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Design
+ * Nicolas Guyomar (Mia-Software) - Implementation
+ *
+ */
+package org.eclipse.emf.facet.efacet.catalog.efacetcatalog.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.FacetSetCatalog;
+import org.eclipse.emf.facet.efacet.catalog.efacetcatalog.QuerySetCatalog;
+import org.eclipse.emf.facet.util.emf.catalog.Catalog;
+
+/**
+ * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the
+ * call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for
+ * each class of the model, starting with the actual class of the object and proceeding up the
+ * inheritance hierarchy until a non-null result is returned, which is the result of the switch.
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.facet.efacet.catalog.efacetcatalog.EfacetcatalogPackage
+ * @generated
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class EfacetcatalogSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EfacetcatalogPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EfacetcatalogSwitch() {
+ if (modelPackage == null) {
+ modelPackage = EfacetcatalogPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(final EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(final EClass theEClass, final EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(final int classifierID, final EObject theEObject) {
+ switch (classifierID) {
+ case EfacetcatalogPackage.QUERY_SET_CATALOG: {
+ QuerySetCatalog querySetCatalog = (QuerySetCatalog)theEObject;
+ T result = caseQuerySetCatalog(querySetCatalog);
+ if (result == null) result = caseCatalog(querySetCatalog);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case EfacetcatalogPackage.FACET_SET_CATALOG: {
+ FacetSetCatalog facetSetCatalog = (FacetSetCatalog)theEObject;
+ T result = caseFacetSetCatalog(facetSetCatalog);
+ if (result == null) result = caseCatalog(facetSetCatalog);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Query Set Catalog</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Query Set Catalog</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseQuerySetCatalog(final QuerySetCatalog object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Facet Set Catalog</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Facet Set Catalog</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseFacetSetCatalog(final FacetSetCatalog object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Catalog</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Catalog</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCatalog(final Catalog object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(final EObject object) {
+ return null;
+ }
+
+} //EfacetcatalogSwitch
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/plugin/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/plugin/Activator.java
new file mode 100644
index 00000000000..c72859b2b91
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.catalog/src/org/eclipse/emf/facet/efacet/catalog/plugin/Activator.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ */
+package org.eclipse.emf.facet.efacet.catalog.plugin;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @deprecated cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=373672
+ */
+@Deprecated
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return Activator.context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(final BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(final BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.checkstyle b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.checkstyle
new file mode 100644
index 00000000000..d18c65877b9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.checkstyle
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <local-check-config name="EmfFacet" location="../org.eclipse.emf.facet.archi.tech.rules/checkstyle/EmfFacet.checkstyle" type="project" description=""/>
+ <fileset name="all" enabled="true" check-config-name="EmfFacet" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ <file-match-pattern match-pattern="Messages.java" include-pattern="false"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath
new file mode 100644
index 00000000000..45f024e850e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.pmd b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.pmd
new file mode 100644
index 00000000000..efcd2dbd830
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.pmd
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd>
+ <useProjectRuleSet>true</useProjectRuleSet>
+ <ruleSetFile>../org.eclipse.emf.facet.archi.tech.rules/pmd/ruleset.xml</ruleSetFile>
+ <includeDerivedFiles>false</includeDerivedFiles>
+ <violationsAsErrors>true</violationsAsErrors>
+</pmd>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.project b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.project
new file mode 100644
index 00000000000..4f29aa24113
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.project
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.emf.facet.efacet.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..0d9ebf5995c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,4 @@
+#Thu Sep 22 10:54:33 CEST 2011
+eclipse.preferences.version=1
+encoding//src/org/eclipse/emf/facet/efacet/core/internal/messages.properties=ISO-8859-1
+encoding/<project>=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..060c5ee3d2e
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..23efb85ec1d
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.efacet.core;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.emf.facet.efacet.core.internal.Activator
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0",
+ org.eclipse.emf.ecore;bundle-version="2.6.0",
+ org.eclipse.papyrus.emf.facet.efacet.catalog;bundle-version="0.1.0";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.util.emf.core;bundle-version="0.1.0";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.util.core;bundle-version="0.1.0",
+ org.eclipse.emf.edit;bundle-version="2.6.0",
+ org.eclipse.emf.facet.efacet.metamodel;bundle-version="0.2.0",
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.emf.facet.efacet;bundle-version="0.2.0";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.util.emf.ui;bundle-version="0.3.0",
+ org.eclipse.emf.facet.util.pde.core;bundle-version="0.4.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %Bundle-Vendor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.facet.efacet.core,
+ org.eclipse.emf.facet.efacet.core.exception,
+ org.eclipse.emf.facet.efacet.core.internal.exported,
+ org.eclipse.emf.facet.efacet.core.internal.incubatingapi,
+ org.eclipse.emf.facet.efacet.core.internal.query,
+ org.eclipse.emf.facet.efacet.core.query
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..1b22fb0d477
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,17 @@
+###########################################################################
+# Copyright (c) 2011, 2012 Mia-Software.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+# Nicolas Guyomar (Mia-Software) - Bug 339899 - everything must be externalized before UI freeze
+###########################################################################
+#Properties file for org.eclipse.emf.facet.efacet.core
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = EMF Facet Core (Incubation)
+queryEvaluatorRegistration.extension-point.name = QueryEvaluatorRegistration
+derivedTypedElementImplementationRegistration.extension-point.name = Derived Typed Element Evaluator Registration \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/about.html
new file mode 100644
index 00000000000..05cdf47ada9
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 10, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/build.properties
new file mode 100644
index 00000000000..f7d2767d4da
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/build.properties
@@ -0,0 +1,21 @@
+###########################################################################
+# Copyright (c) 2011 Mia-Software.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+# Nicolas Guyomar (Mia-Software) - Bug 339899 - everything must be externalized before UI freeze
+###########################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ about.html,\
+ plugin.xml,\
+ schema/
+src.includes = about.html
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/plugin.xml
new file mode 100644
index 00000000000..53778bd8fa7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/plugin.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+
+<!--
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ Nicolas Guyomar (Mia-Software) - Bug 339899 - everything must be externalized before UI freeze
+ Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ Olivier Remaud (Soft-Maint) - Bug 369824 - Add a simple way to return string literal constants from a customization query
+ Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
+ Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model
+ -->
+
+<plugin>
+ <extension-point id="org.eclipse.emf.facet.efacet.core.query.evaluatorregistration" name="%queryEvaluatorRegistration.extension-point.name" schema="schema/org.eclipse.emf.facet.efacet.core.query.evaluatorregistration.exsd"/>
+ <extension-point id="derivedTypedElementImplementationRegistration" name="%derivedTypedElementImplementationRegistration.extension-point.name" schema="schema/derivedTypedElementImplementationRegistration.exsd"/>
+ <extension-point id="queryImplementationRegistration" name="EMF Facet Query implementation registration" schema="schema/queryImplementationRegistration.exsd"/>
+ <extension-point id="org.eclipse.emf.facet.efacet.core.internal.resolver" name="Resolver" schema="schema/internal.resolver.exsd"/>
+
+ <extension point="org.eclipse.emf.facet.util.emf.core.catalogmanager">
+ <catalog class="org.eclipse.emf.facet.efacet.core.internal.catalog.EFacetCatalogManager"/>
+ <catalog class="org.eclipse.emf.facet.efacet.core.internal.catalog.EFacetCatalogManager2"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.facet.efacet.core.queryImplementationRegistration">
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.NavigationQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.IsOneOfQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.StringLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.FalseLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.TrueLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.NullLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.EObjectLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.FloatLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.IntegerLiteralQueryImplementationFactory"/>
+ <queryImplementationRegistration class="org.eclipse.emf.facet.efacet.core.internal.query.OperationCallQueryImplementationFactory"/>
+ </extension>
+</plugin>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/derivedTypedElementImplementationRegistration.exsd b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/derivedTypedElementImplementationRegistration.exsd
new file mode 100644
index 00000000000..382d10b4e40
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/derivedTypedElementImplementationRegistration.exsd
@@ -0,0 +1,127 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.facet.efacet.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.facet.efacet.core" id="derivedTypedElementImplementationRegistration" name="Derived Typed Element Evaluator Registration"/>
+ </appinfo>
+ <documentation>
+ Allow the registration of an IderivedTypedElementImplementationFactory, that instantiates IDerivedTypedElementImplementation that conform to the EMF Facet framework.
+The IDerivedTypedElementImplementation provides an implementation for a given type of queries (e.g. Java queries, OCL queries, ...)
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element deprecated="true" replacement="queryImplementationRegistration" />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="derivedTypedElementImplementationRegistration" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="derivedTypedElementImplementationRegistration">
+ <annotation>
+ <appinfo>
+ <meta.element deprecated="true"/>
+ </appinfo>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Provides an implementation for a IDerivedTypedElementImplementationFactory, which instantiates IDerivedTypedElementImplementation for a given type of queries.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementationFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.2.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.emf.facet.efacet.core.derivedTypedElementImplementationRegistration&quot;&gt;
+ &lt;derivedTypedElementImplementationRegistration
+ class=&quot;org.eclipse.emf.facet.efacet.core.tests.internal.DummyQueryEvaluatorFactory&quot;&gt;
+ &lt;/derivedTypedElementImplementationRegistration&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ &lt;p&gt;
+See plug-ins:
+&lt;ul&gt;
+&lt;li&gt;org.eclipse.emf.facet.query.java.core
+&lt;/ul&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/internal.resolver.exsd b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/internal.resolver.exsd
new file mode 100644
index 00000000000..ecdcc741fd3
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/internal.resolver.exsd
@@ -0,0 +1,108 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.facet.efacet.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.facet.efacet.core" id="internal.resolver" name="Resolver"/>
+ </appinfo>
+ <documentation>
+ This is an internal extension point. It must only be used by EMF Facet&apos;s components.
+
+This extension allows to plug specific behavior in to the facet components. It has been created avoid to have dependences from the main EMF Facet components to the aggregate components.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="resolver"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="resolver">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.facet.efacet.core.internal.exported.IResolver"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.2
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;extension
+ point=&quot;org.eclipse.emf.facet.efacet.core.internal.resolver&quot;&gt;
+ &lt;resolver
+ class=&quot;org.eclipse.emf.facet.aggregate.metamodel.notgenerated.internal.Resolver&quot;&gt;
+ &lt;/resolver&gt;
+ &lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2012 CEA-LIST.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List&lt;ETypedElement&gt;, List&lt;FacetSet&gt;)
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/org.eclipse.emf.facet.efacet.core.query.evaluatorregistration.exsd b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/org.eclipse.emf.facet.efacet.core.query.evaluatorregistration.exsd
new file mode 100644
index 00000000000..0e51031ea76
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/org.eclipse.emf.facet.efacet.core.query.evaluatorregistration.exsd
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.facet.efacet.core.query.evaluatorregistration" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.facet.efacet.core.query.evaluatorregistration" id="evaluatorregistration" name="QueryEvaluatorRegistration"/>
+ </appinfo>
+ <documentation>
+ Allow the registration of a queryEvaluatorFactory.
+This factory allows the user to create queryEvaluators conform to the EMF Facet framework.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="queryEvaluatorRegistration" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="queryEvaluatorRegistration">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.facet.efacet.core.query.IQueryEvaluatorFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.1.0
+ </documentation>
+ </annotation>
+
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ - Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/queryImplementationRegistration.exsd b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/queryImplementationRegistration.exsd
new file mode 100644
index 00000000000..69514675381
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/schema/queryImplementationRegistration.exsd
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.facet.efacet.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.facet.efacet.core" id="queryImplementationRegistration" name="EMF Facet Query Implementation Registration"/>
+ </appinfo>
+ <documentation>
+ Used to register an IQueryImplementationFactory, that creates instances of IQueryImplementation. The IQueryImplementation provides an implementation for a given type of queries (e.g. Java queries, OCL queries, ...)
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="queryImplementationRegistration" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="queryImplementationRegistration">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Provides an implementation for an IQueryImplementationFactory, which instantiates IQueryImplementation for a given type of queries.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.facet.efacet.core.query.IQueryImplementationFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.2.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.emf.facet.efacet.core.queryImplementationRegistration&quot;&gt;
+ &lt;queryImplementationRegistration
+ class=&quot;org.eclipse.emf.facet.efacet.core.tests.internal.DummyQueryEvaluatorFactory&quot;&gt;
+ &lt;/queryImplementationRegistration&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ &lt;p&gt;
+See plug-ins:
+&lt;ul&gt;
+&lt;li&gt;org.eclipse.emf.facet.query.java.core
+&lt;/ul&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011, 2012 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/FacetUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/FacetUtils.java
new file mode 100644
index 00000000000..7e92efd86aa
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/FacetUtils.java
@@ -0,0 +1,705 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Nicolas Bros (Mia-Software) - Bug 361817 - [Restructuring] Dynamic load to the facet catalog
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Nicolas Bros (Mia-Software) - Bug 371367 - Hierarchical FacetSets
+ * Gregoire Dupe (Mia-Software) - Bug 371367 - Hierarchical FacetSets
+ * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
+ * Gregoire Dupe (Mia-Software) - Bug 373510 - EditingDomain, ResourceSet, Catalogs, etc. have to be properly managed between editors and views
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ * Gregoire Dupe (Mia-Software) - Bug 374903 - [Table] ITableWidget.setLoadedFacetSets
+ * Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
+ * Olivier Remaud (Soft-Maint) - Bug 361794 - [Restructuring] EMF Facet customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] EMF Facet customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates
+ * Nicolas Bros (Mia-Software) - Bug 372626 - Aggregates
+ * Gregoire Dupe (Mia-Software) - Bug 376576 - [EFacet] Change the multiplicity of Facet::extendedFacet
+ * Vincent Lorenzo (CEA-LIST) - Bug 357621 - Improve the label displayed for Customization and Facets
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Gregoire Dupe (Mia-Software) - Bug 377870 - [EFacet] ETypedElementDialog doesn't show all available ETypedElement (library example problem?)
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 391442 - Select ETypedElement Dialog doesn't used the subpackages (subEFacetSet)
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.efacet.core.exception.FacetManagerException;
+import org.eclipse.emf.facet.efacet.core.internal.exported.IResolverManager;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementEObjectListResult;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementEObjectResult;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementPrimitiveTypeListResult;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementPrimitiveTypeResult;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementResult;
+import org.eclipse.emf.facet.util.emf.core.ModelUtils;
+import org.eclipse.emf.facet.util.emf.core.internal.EMFUtils;
+
+/**
+ * @since 0.2
+ */
+public final class FacetUtils {
+
+ private FacetUtils() {
+ // static methods only
+ }
+
+ /**
+ * Find a Facet in a FacetSet
+ *
+ * @param facetSet
+ * the FacetSet
+ * @param facetName
+ * the name of the Facet to look for
+ * @return the Facet with the given name in the given FacetSet
+ */
+ public static Facet getFacet(final FacetSet facetSet, final String facetName) {
+ Facet result = null;
+ final List<Facet> facets = FacetUtils.getFacets(facetSet);
+ for (Facet facet : facets) {
+ if (facetName.equals(facet.getName())) {
+ result = facet;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public static <T extends ETypedElement> T getETypedElement(
+ final Facet facet, final String name, final Class<T> classs) {
+ T result = null;
+ final List<ETypedElement> eTypedElements = new ArrayList<ETypedElement>();
+ eTypedElements.addAll(facet.getFacetElements());
+ eTypedElements.addAll(facet.getFacetOperations());
+ for (ETypedElement eTypedElement : eTypedElements) {
+ if (name.equals(eTypedElement.getName())
+ && classs.isInstance(eTypedElement)) {
+ @SuppressWarnings("unchecked")
+ // @SuppressWarnings("unchecked") This assignment is check by
+ // the call 'classs.isInstance(structuralFeature)'
+ final T castResult = (T) eTypedElement;
+ result = castResult;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public static Object getResultValue(final ETypedElementResult eTEresult) {
+ Object result = null;
+ if (eTEresult instanceof ETypedElementEObjectListResult<?>) {
+ final ETypedElementEObjectListResult<?> eObjectList = (ETypedElementEObjectListResult<?>) eTEresult;
+ result = eObjectList.getResultList();
+ } else if (eTEresult instanceof ETypedElementEObjectResult<?>) {
+ final ETypedElementEObjectResult<?> eObjectRef = (ETypedElementEObjectResult<?>) eTEresult;
+ result = eObjectRef.getResult();
+ } else if (eTEresult instanceof ETypedElementPrimitiveTypeListResult<?>) {
+ final ETypedElementPrimitiveTypeListResult<?> objectList = (ETypedElementPrimitiveTypeListResult<?>) eTEresult;
+ result = objectList.getDerivedTypedElement();
+ } else if (eTEresult instanceof ETypedElementPrimitiveTypeResult<?>) {
+ final ETypedElementPrimitiveTypeResult<?> objectRef = (ETypedElementPrimitiveTypeResult<?>) eTEresult;
+ result = objectRef.getResult();
+ } else {
+ throw new IllegalStateException(
+ "Unknown ETypedElementResult type: " + eTEresult.getClass()); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ /**
+ * Find a FacetSet with the given name among the given list of FacetSets. If several FacetSets have the same name,
+ * then return the first one.
+ *
+ * @param facetSets
+ * where to look for
+ * @param name
+ * the name of the FacetSet to find
+ * @return the FacetSet, or <code>null</code> if not found in the given list
+ */
+ public static FacetSet getFacetSet(final Collection<FacetSet> facetSets, final String name) {
+ FacetSet result = null;
+ for (FacetSet facetSet : facetSets) {
+ if (name.equals(facetSet.getName())) {
+ result = facetSet;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Find all FacetSets with the given name among the given list of FacetSets.
+ *
+ * @param facetSets
+ * where to look for
+ * @param name
+ * the name of the FacetSets to find
+ * @return the FacetSets with the given name
+ */
+ public static List<FacetSet> getFacetSets(
+ final Collection<FacetSet> facetSets, final String name) {
+ final List<FacetSet> result = new ArrayList<FacetSet>();
+ for (FacetSet facetSet : facetSets) {
+ if (name.equals(facetSet.getName())) {
+ result.add(facetSet);
+ }
+ }
+ return result;
+ }
+
+ /**
+ *
+ * @param facetSet
+ * a facetSet
+ * @return a set with all the EPackage extended by the facetSet and its
+ * owned facetSet
+ * @since 0.2
+ */
+ public static Set<EPackage> getAllExtendedEPackage(final FacetSet facetSet) {
+ final Set<EPackage> extendedEPackages = new HashSet<EPackage>();
+ final EPackage res1 = getExtendedEPackage(facetSet);
+ if (res1 != null) {
+ extendedEPackages.add(res1);
+ }
+ for (FacetSet current : facetSet.getFacetSets()) {
+ extendedEPackages.addAll(getAllExtendedEPackage(current));
+ }
+ final EList<EPackage> pack = facetSet.getESubpackages();
+ for (EPackage current : pack) {
+ if (current instanceof FacetSet) {
+ extendedEPackages
+ .addAll(getAllExtendedEPackage((FacetSet) current));
+ }
+ }
+ return extendedEPackages;
+ }
+
+ /**
+ * Find all the FacetSets with the given path among the given list of root
+ * FacetSets. For example: <code>getFacetSetsByPath("a", "b", "c")</code>
+ * returns a FacetSet named "c", contained in a FacetSet named "b",
+ * contained in a registered FacetSet named "a".
+ *
+ * @param path
+ * a list of FacetSet names, starting from the root registered
+ * FacetSets, and leading to the wanted FacetSet(s)
+ * @return the FacetSets that have the given path
+ */
+ public static List<FacetSet> getFacetSetsByPath(
+ final Collection<FacetSet> rootFacetSets, final String... path) {
+ if (path.length == 0) {
+ throw new IllegalArgumentException("The given path cannot be empty"); //$NON-NLS-1$
+ }
+ List<FacetSet> facetSets = new ArrayList<FacetSet>(rootFacetSets);
+ for (int i = 0; i < path.length; i++) {
+ if (i > 0) {
+ facetSets = getSubFacetSets(facetSets);
+ }
+ final String name = path[i];
+ facetSets = getFacetSets(facetSets, name);
+ if (facetSets.isEmpty()) {
+ break;
+ }
+
+ }
+ return facetSets;
+ }
+
+ private static List<FacetSet> getSubFacetSets(
+ final Collection<FacetSet> parents) {
+ final List<FacetSet> subFacetSets = new ArrayList<FacetSet>();
+ for (FacetSet facetSet : parents) {
+ final EList<EPackage> eSubpackages = facetSet.getESubpackages();
+ for (EPackage ePackage : eSubpackages) {
+ if (ePackage instanceof FacetSet) {
+ final FacetSet subFacetSet = (FacetSet) ePackage;
+ subFacetSets.add(subFacetSet);
+ }
+ }
+ }
+ return subFacetSets;
+ }
+
+ /**
+ * Find a Facet with the given name among the given list of Facets.
+ *
+ * @param facets
+ * where to look
+ * @param name
+ * the name of the Facet that is being looked for
+ * @return the first {@link Facet} with this name, or <code>null</code> if
+ * none
+ */
+ public static Facet getFacet(final Collection<Facet> facets,
+ final String name) {
+ Facet result = null;
+ for (Facet facet : facets) {
+ if (name.equals(facet.getName())) {
+ result = facet;
+ }
+ }
+ return result;
+ }
+
+ public static FacetSet getRootFacetSet(final Facet facet) {
+ FacetSet result = (FacetSet) facet.eContainer();
+ while (result != null && result.eContainer() instanceof FacetSet) {
+ result = (FacetSet) result.eContainer();
+ }
+ return result;
+ }
+
+ public static FacetSet getRootFacetSet(final FacetSet facetSet) {
+ FacetSet result = facetSet;
+ while (result != null && result.eContainer() instanceof FacetSet) {
+ result = (FacetSet) result.eContainer();
+ }
+ return result;
+ }
+
+ /**
+ * This methods returns all the known (registered) eTypedElements.
+ *
+ * @param resourceSet
+ * the eTypedElement search will be done in/using this resourceSet
+ * @return all the known (registered) eTypedElements
+ */
+ public static Set<? extends ETypedElement> getETypedElements(
+ final ResourceSet resourceSet) {
+ final Set<ETypedElement> result = new HashSet<ETypedElement>();
+ final Collection<Object> ePackages = EPackage.Registry.INSTANCE
+ .values();
+ for (Object object : ePackages) {
+ EPackage ePackage = null;
+ if (object instanceof EPackage) {
+ ePackage = (EPackage) object;
+ } else if (object instanceof EPackage.Descriptor) {
+ final EPackage.Descriptor descriptor = (EPackage.Descriptor) object;
+ ePackage = descriptor.getEPackage();
+ }
+ if (ePackage != null) {
+ result.addAll(getETypedElements(ePackage));
+ }
+ }
+ result.addAll(getFacetETypedElements(resourceSet));
+ return result;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static Set<? extends ETypedElement> getFacetETypedElements(
+ final ResourceSet resourceSet) {
+ final Set<ETypedElement> result = new HashSet<ETypedElement>();
+ final Collection<FacetSet> facetSets = IFacetSetCatalogManagerFactory.DEFAULT
+ .getOrCreateFacetSetCatalogManager(resourceSet)
+ .getRegisteredFacetSets();
+ for (FacetSet facetSet : facetSets) {
+ result.addAll(getETypedElements(facetSet));
+ }
+ return result;
+ }
+
+ public static List<ETypedElement> getETypedElements(final EPackage ePackage) {
+ final List<ETypedElement> result = new LinkedList<ETypedElement>();
+ for (EClassifier eClassifier : ePackage.getEClassifiers()) {
+ result.addAll(getETypedElements(eClassifier));
+ }
+ for (EPackage subPackage : ePackage.getESubpackages()) {
+ result.addAll(getETypedElements(subPackage));
+ }
+ return result;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static List<ETypedElement> getETypedElements(
+ final EClassifier eClassifier) {
+ final List<ETypedElement> result = new ArrayList<ETypedElement>();
+ if (eClassifier instanceof Facet) {
+ final Facet facet = (Facet) eClassifier;
+ result.addAll(facet.getFacetElements());
+ result.addAll(facet.getFacetOperations());
+ } else if (eClassifier instanceof EClass) {
+ final EClass eClass = (EClass) eClassifier;
+ result.addAll(eClass.getEAllStructuralFeatures());
+ result.addAll(eClass.getEAllOperations());
+ }
+ return result;
+ }
+
+ public static List<Facet> getFacets(final FacetSet facetSet) {
+ final List<Facet> result = new LinkedList<Facet>();
+ for (EClassifier eClassifier : facetSet.getEClassifiers()) {
+ if (eClassifier instanceof Facet) {
+ final Facet facet = (Facet) eClassifier;
+ result.add(facet);
+ }
+ }
+ return result;
+ }
+
+ public static FacetSet getFacetSet(final Facet facet) {
+ FacetSet result = null;
+ if (facet.getEPackage() instanceof FacetSet) {
+ result = (FacetSet) facet.getEPackage();
+ }
+ return result;
+ }
+
+ // Moved from
+ // org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.impl.FacetSetImpl
+ public static EPackage getExtendedEPackage(final FacetSet facetSet) {
+ final List<Facet> facets = FacetUtils.getFacets(facetSet);
+ EPackage result = null;
+ for (Facet facet : facets) {
+ final EClass extendedMetaclass = facet.getExtendedMetaclass();
+ if (extendedMetaclass != null) {
+ final EPackage ePackage = extendedMetaclass.getEPackage();
+ if (ePackage != null) {
+ if (result != null && !ePackage.equals(result)) {
+ throw new IllegalStateException(
+ "The Facets in a FacetSet must all extend EClasses from the same EPackage"); //$NON-NLS-1$
+ }
+ result = ePackage;
+ }
+ }
+ }
+ return result;
+ }
+
+ // Copied (and refactored) from
+ // org.eclipse.emf.facet.efacet.core.internal.FacetManager
+ public static <T extends ETypedElement> Set<T> getETypedElements(
+ final EObject eObject, final Class<T> classs,
+ final IFacetManager facetManager) throws FacetManagerException {
+ final Set<T> result = new HashSet<T>();
+ for (FacetSet facetSet : facetManager.getManagedFacetSets()) {
+ result.addAll(getETypedElements(eObject, facetSet, classs,
+ facetManager));
+ }
+ return result;
+ }
+
+ // Copied (and refactored) from
+ // org.eclipse.emf.facet.efacet.core.internal.FacetManager
+ private static <T extends ETypedElement> Set<T> getETypedElements(
+ final EObject eObject, final FacetSet facetSet,
+ final Class<T> classs, final IFacetManager manager)
+ throws FacetManagerException {
+ final Set<T> result = new HashSet<T>();
+ for (EClassifier eClassifier : facetSet.getEClassifiers()) {
+ if (eClassifier instanceof Facet) {
+ final Facet facet = (Facet) eClassifier;
+ if (manager.isConforming(eObject, facet)) {
+ result.addAll(getETypedElement(classs, facet));
+ }
+ }
+ }
+ // hierarchical FacetSets
+ for (EPackage ePackage : facetSet.getESubpackages()) {
+ if (ePackage instanceof FacetSet) {
+ final FacetSet subFacetSet = (FacetSet) ePackage;
+ result.addAll(getETypedElements(eObject, subFacetSet, classs,
+ manager));
+ }
+ }
+ // aggregates
+ for (FacetSet subFacetSet : facetSet.getFacetSets()) {
+ result.addAll(getETypedElements(eObject, subFacetSet, classs,
+ manager));
+ }
+ return result;
+ }
+
+ private static <T> Set<T> getETypedElement(final Class<T> classs,
+ final Facet facet) {
+ final Set<T> result = new HashSet<T>();
+ for (ETypedElement eTypedElement : getAllETypedElements(facet)) {
+ if (classs.isInstance(eTypedElement)) {
+ @SuppressWarnings("unchecked")
+ // @SuppressWarnings("unchecked") This type has been
+ // checked using isInstance
+ final T typedSF = (T) eTypedElement;
+ final T resolvedTE = IResolverManager.DEFAULT
+ .resolve(typedSF, classs);
+ if (resolvedTE == null) {
+ result.add(typedSF);
+ } else {
+ result.add(resolvedTE);
+ }
+ }
+ }
+ return result;
+ }
+
+ // Copied (and refactored) from
+ // org.eclipse.emf.facet.efacet.core.internal.FacetManager
+ private static List<ETypedElement> getAllETypedElements(
+ final Facet facet) {
+ final List<ETypedElement> structFeatures = new LinkedList<ETypedElement>();
+ structFeatures.addAll(facet.getFacetElements());
+ structFeatures.addAll(facet.getFacetOperations());
+ for (Facet extFacet : facet.getExtendedFacets()) {
+ structFeatures.addAll(getAllETypedElements(extFacet));
+ }
+ return structFeatures;
+ }
+
+ /**
+ * @param eTypedElement
+ * @return
+ * @since 0.2
+ */
+ public static FacetSet getFacetSet(final ETypedElement eTypedElement) {
+ FacetSet result = null;
+ if (eTypedElement.eContainer() instanceof Facet) {
+ final Facet facet = (Facet) eTypedElement.eContainer();
+ if (facet.eContainer() instanceof FacetSet) {
+ result = (FacetSet) facet.eContainer();
+ }
+ }
+ return result;
+ }
+
+ /**
+ *
+ * @param facetOperation
+ * @return
+ * @since 0.2
+ */
+ public static DerivedTypedElement getSignature(
+ final FacetOperation facetOperation) {
+ DerivedTypedElement current = facetOperation;
+ while (current.getOverride() != null) {
+ current = current.getOverride();
+ }
+ return current;
+ }
+
+ /**
+ *
+ * @param facet
+ * @return
+ * @since 0.2
+ */
+ public static EClass getExtendedMetaclass(final Facet facet) {
+ EClass result = facet.getExtendedMetaclass();
+ if (result == null) {
+ final List<EClass> eClasses = new LinkedList<EClass>();
+ for (Facet extfacet : facet.getExtendedFacets()) {
+ eClasses.add(getExtendedMetaclass(extfacet));
+ }
+ result = EMFUtils.computeLeastCommonSupertype(eClasses);
+ }
+ return result;
+ }
+
+ /**
+ * Find the top level feature in the override chain
+ *
+ * @param feature
+ * @return The top level feature in the override chain or the feature
+ * parameter itself if no override
+ * @throws FacetManagerException
+ * @since 0.2
+ *
+ */
+ // Copied from
+ // org.eclipse.emf.facet.efacet.core.internal.FacetManagerContext
+ // * Contributors:
+ // * Olivier Remaud (Soft-Maint) - Bug 361794 - [Restructuring] EMF Facet
+ // customization meta-model
+ // * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user
+ // must be able to navigate into a model using the Facet.
+ // * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] EMF Facet
+ // customization meta-model
+ // * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ @SuppressWarnings("unchecked")
+ // @SuppressWarnings("unchecked") cf. comment in the method body
+ public static <T extends DerivedTypedElement> T getTopOverrideFeature(
+ final T feature) throws FacetManagerException {
+ T signatureFeature = feature;
+ while (signatureFeature.getOverride() != null) {
+ if (feature.getClass().isInstance(signatureFeature.getOverride())) {
+ // @SuppressWarnings("unchecked") the if test check the
+ // assignment using the method 'isInstance'
+ signatureFeature = (T) signatureFeature.getOverride();
+ } else {
+ // signature feature type name
+ final String sfTypeName = signatureFeature.eClass().getName();
+ // signature feature name
+ final String sfName = ModelUtils
+ .getQualifiedName(signatureFeature);
+ final String ofName = signatureFeature.getOverride().eClass()
+ .getName(); // overridden feature type name
+ throw new FacetManagerException("The " + sfTypeName + " '" //$NON-NLS-1$ //$NON-NLS-2$
+ + sfName + "' overides a " + ofName); //$NON-NLS-1$
+ }
+ }
+ return signatureFeature;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static EClass findExtendedEClass(final Facet facet) {
+ EClass result = facet.getExtendedMetaclass();
+ if (result == null) {
+ for (Facet extFacet : facet.getExtendedFacets()) {
+ result = findExtendedEClass(extFacet);
+ if (result != null) {
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static DerivedTypedElement getContainingDerivedTypedElement(
+ final EObject eObject) {
+ DerivedTypedElement dte = null;
+ if (eObject instanceof DerivedTypedElement) {
+ dte = (DerivedTypedElement) eObject;
+ } else if (eObject != null) {
+ dte = getContainingDerivedTypedElement(eObject.eContainer());
+ }
+ return dte;
+ }
+
+ /**
+ * Return the main facetSet.
+ *
+ * @param eObject
+ * the element in the model selected.
+ * @return the main facetSet.
+ * @since 0.3
+ */
+ public static FacetSet getContainingFacetSet(final EObject eObject) {
+ FacetSet result = null;
+ if (eObject instanceof FacetSet) {
+ result = (FacetSet) eObject;
+ } else {
+ final EObject container = eObject.eContainer();
+ if (container != null) {
+ result = getContainingFacetSet(container);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Return all the operations of the model.
+ *
+ * @param parent
+ * the first FacetSet of the model.
+ * @return the list of operations.
+ * @since 0.3
+ */
+ public static Map<String, FacetOperation> getAllOperationsByName(
+ final FacetSet parent) {
+ final Map<String, FacetOperation> operations = new HashMap<String, FacetOperation>();
+ for (final EClassifier facet : parent.getEClassifiers()) {
+ for (final FacetOperation operation : ((Facet) facet)
+ .getFacetOperations()) {
+ operations.put(operation.getName(), operation);
+ }
+ }
+ for (final EPackage element : parent.getESubpackages()) {
+ operations.putAll(getAllOperationsByName((FacetSet) element));
+ }
+ return operations;
+ }
+
+ /**
+ * Return all the facets of the model.
+ *
+ * @param parent
+ * the first FacetSet of the model.
+ * @return the list of facets.
+ * @since 0.3
+ */
+ public static Map<String, Facet> getAllFacetsByName(final FacetSet parent) {
+ final Map<String, Facet> facets = new HashMap<String, Facet>();
+ for (final EClassifier facet : parent.getEClassifiers()) {
+ facets.put(facet.getName(), (Facet) facet);
+ }
+ for (final EPackage element : parent.getESubpackages()) {
+ facets.putAll(getAllFacetsByName((FacetSet) element));
+ }
+
+ return facets;
+ }
+
+ /**
+ * Return all the facets of the model.
+ *
+ * @param parent
+ * the first FacetSet of the model.
+ * @return the list of facets.
+ * @since 0.3
+ */
+ public static Map<String, FacetSet> getAllFacetSetsByName(
+ final EPackage parent) {
+ final Map<String, FacetSet> facetSets = new HashMap<String, FacetSet>();
+ if (parent instanceof FacetSet) {
+ final FacetSet facetSet = (FacetSet) parent;
+ facetSets.put(parent.getName(), facetSet);
+ }
+ for (final EPackage element : parent.getESubpackages()) {
+ facetSets.putAll(getAllFacetSetsByName(element));
+ }
+ return facetSets;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static List<Facet> getAllFacet(final FacetSet facetSet) {
+ final List<Facet> result = new ArrayList<Facet>();
+ for (EClassifier eClassifier : facetSet.getEClassifiers()) {
+ if (eClassifier instanceof Facet) {
+ final Facet facet = (Facet) eClassifier;
+ result.add(facet);
+ }
+ }
+ for (EPackage ePackage : facetSet.getESubpackages()) {
+ if (ePackage instanceof FacetSet) {
+ final FacetSet subFacetSet = (FacetSet) ePackage;
+ result.addAll(getAllFacet(subFacetSet));
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IDerivedTypedElementManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IDerivedTypedElementManager.java
new file mode 100644
index 00000000000..c1c7e2cf4a1
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IDerivedTypedElementManager.java
@@ -0,0 +1,201 @@
+/**
+ * Copyright (c) 2011, 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
+ * Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.efacet.core.internal.DerivedTypedElementManager;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementResult;
+
+/**
+ * Used to evaluate derived typed elements through their queries.
+ *
+ * @since 0.2
+ */
+public interface IDerivedTypedElementManager {
+ IDerivedTypedElementManager INSTANCE = new DerivedTypedElementManager();
+
+ /**
+ * Evaluates a derived typed element on a model element.
+ * <p>
+ * <b>Note:</b> this method does not return a typed result, and it does not
+ * check the result type. Use
+ * {@link IDerivedTypedElementManager#evaluateSingleValued(DerivedTypedElement, EObject, List, Class)
+ * evaluateSingleValued} or
+ * {@link IDerivedTypedElementManager#evaluateMultiValued(DerivedTypedElement, EObject, List, Class)
+ * evaluateMultiValued} instead if you want a typed and type-checked result.
+ *
+ * @param derivedTE
+ * the derived typed element to evaluate
+ * @param source
+ * the model element on which the derived typed element must be
+ * evaluated
+ * @param parameterValues
+ * the arguments of the derived typed element (in the case of a
+ * {@link FacetOperation}; can be <code>null</code> if there are
+ * no parameters)
+ * @return the derived typed element result: a single Object in the case of
+ * a single-valued derived typed element, or a List in the case of a
+ * multi-valued derived typed element.
+ * @throws DerivedTypedElementException
+ * <ul>
+ * <li>in case of error in the derived typed element</li> <li>in
+ * case of error when evaluating the derived typed element</li>
+ * </ul>
+ */
+ Object evaluate(DerivedTypedElement derivedTE, EObject source,
+ List<ParameterValue> parameterValues, IFacetManager facetManager)
+ throws DerivedTypedElementException;
+
+ /**
+ * Evaluates a query on a model element. Calling this method is discouraged. You should evaluate a
+ * {@link DerivedTypedElement}s (which contains a query) instead of trying to evaluate a {@link Query} directly.
+ * Since the source type, return type and multiplicity of a query are carried by the {@link DerivedTypedElement}
+ * that normally contains it, this method doesn't check the source type, return type or multiplicity.
+ *
+ * @param query
+ * the query to evaluate
+ * @param source
+ * the model element on which the query must be evaluated
+ * @param parameterValues
+ * the arguments of the query (in the case of a query for a {@link FacetOperation}; can be
+ * <code>null</code> if there are no parameters)
+ * @return the query result: may be a single Object or a List.
+ * @throws DerivedTypedElementException
+ * if the evaluation failed
+ */
+ Object evaluate(Query query, EObject source, List<ParameterValue> parameterValues, IFacetManager facetManager)
+ throws DerivedTypedElementException;
+
+ /**
+ * Evaluates a single valued derived typed element on a model element.
+ *
+ * @param derivedTE
+ * the derived typed element to evaluate
+ * @param source
+ * the model element on which the derived typed element is
+ * evaluated
+ * @param parameterValues
+ * the arguments of the derived typed element (in the case of a
+ * {@link FacetOperation}; can be <code>null</code> if there are
+ * no parameters)
+ * @param resultType
+ * the type that the returned value must have
+ * @return the result of the evaluation
+ * @throws DerivedTypedElementException
+ * <ul>
+ * <li>in case of error in the derived typed element</li>
+ * <li>in case of error when evaluating the derived typed
+ * element</li>
+ * <li>
+ * if the effective return type does not match the expected type
+ * </li>
+ * </ul>
+ */
+ <T> T evaluateSingleValued(DerivedTypedElement derivedTE, EObject source,
+ List<ParameterValue> parameterValues, Class<T> resultType,
+ IFacetManager facetManager) throws DerivedTypedElementException;
+
+ /**
+ * Evaluates a multi-valued derived typed element on a model element.
+ *
+ * @param derivedTypedElement
+ * the derived typed element to evaluate
+ * @param source
+ * the model element on which the derived typed element must be
+ * evaluated
+ * @param parameterValues
+ * the arguments of the derived typed element (in the case of a
+ * {@link FacetOperation}; can be <code>null</code> if there are
+ * no parameters)
+ * @param resultType
+ * the type that the returned value must have
+ * @return the result of the evaluation
+ * @throws DerivedTypedElementException
+ * <ul>
+ * <li>in case of error in the derived typed element</li>
+ * <li>in case of error when evaluating the derived typed
+ * element</li>
+ * <li>if the effective return type does not match the expected
+ * type</li>
+ * </ul>
+ */
+ <T> List<T> evaluateMultiValued(DerivedTypedElement derivedTE,
+ EObject source, List<ParameterValue> parameterValues,
+ Class<T> resultType, IFacetManager facetManager)
+ throws DerivedTypedElementException;
+
+ /**
+ * Evaluates a derived typed element on a list of model elements in a single
+ * call.
+ *
+ * @param derivedTE
+ * the derived typed element to evaluate
+ * @param sources
+ * the model elements on which the derived typed element must be
+ * evaluated
+ * @param parameterValues
+ * the arguments of the derived typed element (in the case of a
+ * {@link FacetOperation}; can be <code>null</code> if there are
+ * no parameters)
+ * @param resultType
+ * the expected type of the returned list:
+ * <ul>
+ * <li> {@link DerivedTypedElementEObjectResult} if the
+ * {@link DerivedTypedElement} is a single-valued
+ * {@link EReference} or {@link EOperation} that returns EObjects
+ * <li>{@link DerivedTypedElementEObjectListResult} if the
+ * {@link DerivedTypedElement} is a multi-valued
+ * {@link EReference} or {@link EOperation} that returns EObjects
+ * <li>{@link DerivedTypedElementPrimitiveTypeResult} if the
+ * {@link DerivedTypedElement} is a single-valued
+ * {@link EAttribute} or {@link EOperation} that returns a
+ * primitive type value
+ * <li>{@link DerivedTypedElementPrimitiveTypeListResult} if the
+ * {@link DerivedTypedElement} is a multi-valued
+ * {@link EAttribute} or {@link EOperation} that returns a list
+ * of primitive type values
+ * </ul>
+ * @return one derived typed element result for each source element that was
+ * evaluated
+ * @throws DerivedTypedElementException
+ * <ul>
+ * <li>in case of error in the derived typed element.
+ * <b>Note</b>: an error that happens when evaluating the
+ * derived typed element on any of the given sources is not
+ * thrown but stored in the corresponding element result.</li>
+ * <li>if the effective return type does not match the expected
+ * type</li>
+ * </ul>
+ */
+ <T extends ETypedElementResult> List<T> batchEvaluate(
+ DerivedTypedElement derivedTE,
+ Collection<? extends EObject> sources,
+ List<ParameterValue> parameterValues, Class<T> resultType,
+ IFacetManager facetManager) throws DerivedTypedElementException;
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IEFacetManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IEFacetManager.java
new file mode 100644
index 00000000000..70e95a52cc2
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IEFacetManager.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ * Nicolas Bros (Mia-Software) - Bug 361617 - Deprecation of APIs for the old Facet metamodels
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.ParameterValue;
+import org.eclipse.emf.facet.efacet.Query;
+import org.eclipse.emf.facet.efacet.QueryContext;
+import org.eclipse.emf.facet.efacet.QueryResult;
+import org.eclipse.emf.facet.efacet.core.exception.QueryException;
+import org.eclipse.emf.facet.efacet.core.internal.EFacetManager;
+
+/**
+ * This interface allows the user to use the EMF Facet API for Query and Facet.
+ *
+ * @deprecated use {@link IDerivedTypedElementManager} with the new eFacet2 metamodel (https://bugs.eclipse.org/bugs/show_bug.cgi?id=381225)
+ */
+@Deprecated
+public interface IEFacetManager {
+ IEFacetManager INSTANCE = new EFacetManager();
+
+ /**
+ * This method is used to evaluate the given {@link Query} on the given {@link EObject} taking
+ * into consideration some {@link ParameterValue}
+ */
+ QueryResult evaluate(final Query query, final EObject eObject,
+ final List<ParameterValue> parameterValues);
+
+ /**
+ * This method is used to evaluate the given {@link Query} on the given {@link EObject}
+ */
+ QueryResult evaluate(final Query query, final EObject eObject);
+
+ /**
+ * This method is equivalent to {@link IEFacetManager#evaluate(Query, EObject, List)} but rather
+ * than return the errors into a {@link QueryResult} instance, it throws an exception.
+ *
+ * @param eObject
+ * The query evaluation context
+ * @return The query result.
+ * @throws QueryException
+ */
+ Object basicEvaluate(final Query query, final EObject eObject,
+ final List<ParameterValue> parameterValues) throws QueryException;
+
+ /**
+ * This method is equivalent to {@link IEFacetManager#evaluate(Query, EObject)} but rather than
+ * return the errors into a {@link QueryResult} instance, it throws an exception.
+ *
+ * @param eObject
+ * The query evaluation context
+ * @return The query result.
+ * @throws QueryException
+ */
+ Object basicEvaluate(final Query query, final EObject eObject)
+ throws QueryException;
+
+ /**
+ * Evaluate the query on a set of models and model elements described by the
+ * <code>queryContext</code> parameter.
+ *
+ * The query is evaluated on each contextually referred model element and on each element of a
+ * contextually referred model.
+ *
+ * @param queryContext
+ * The query evaluation context described by a QueryContext instance.
+ * @param parameterValues
+ * The query parameter values.
+ * @return A list of QueryResult (one per evaluation)
+ * @throws QueryException
+ */
+ List<QueryResult> evaluate(final Query query,
+ final QueryContext queryContext,
+ final List<ParameterValue> parameterValues) throws QueryException;
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetAction.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetAction.java
new file mode 100644
index 00000000000..86eefb3817f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetAction.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 338813 - [EMF Facet Framework] basic Facet actions
+ * Nicolas Bros (Mia-Software) - Bug 361617 - Deprecation of APIs for the old Facet metamodels
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.Facet;
+import org.eclipse.emf.facet.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.core.internal.FacetActionImpl;
+import org.eclipse.emf.facet.efacet.core.internal.incubatingapi.IFacetActions2;
+import org.eclipse.emf.facet.util.emf.core.exception.InvalidFacetSetException;
+
+/**
+ * This interface contains methods declaration to deal with {@link Facet} and
+ * {@link FacetSet}.
+ *
+ * @since 0.1
+ * @noimplement
+ * @noextend
+ * @deprecated use {@link IFacetActions2} with the new eFacet2 metamodel (https://bugs.eclipse.org/bugs/show_bug.cgi?id=381226)
+ */
+@Deprecated
+public interface IFacetAction {
+
+ IFacetAction INSTANCE = new FacetActionImpl();
+
+ /**
+ * Add the given facetSet to the given facetSet model file, which will be created
+ *
+ * @param facetSet
+ * the facetSet to be created. Cannot be <code>null</code>
+ * @param project
+ * the new file in which the facetSet has to be created. Cannot be <code>null</code>,
+ * and cannot already exist
+ * @since 0.2
+ */
+ void createFacetSet(FacetSet facetSet, IFile file) throws IOException,
+ InvalidFacetSetException;
+
+ /**
+ * Add the given {@link Facet} to the given {@link FacetSet}
+ *
+ * @param facetSet
+ * the parent facetSet, cannot be null
+ * @param facet
+ * the {@link Facet}, cannot be null, or contained by a resource
+ * @param editingDomain
+ * the editing domain needed to perform the Add EMF command, cannot be null
+ */
+ Facet createFacetInFacetSet(FacetSet facetSet, Facet facet,
+ EditingDomain editingDomain);
+
+ /**
+ * Add the given {@link FacetAttribute} to the given {@link Facet}
+ *
+ * @param facet
+ * the parent {@link Facet}, cannot be null
+ * @param facetAttribute
+ * the {@link FacetAttribute}, cannot be null, or contained by a resource
+ * @param editingDomain
+ * the editing domain needed to perform the Add Emf command, cannot be null
+ */
+ void addAttributeInFacet(Facet facet, FacetAttribute facetAttribute,
+ EditingDomain editingDomain);
+
+ /**
+ * Add the given {@link FacetReference} to the given {@link Facet}
+ *
+ * @param facet
+ * the parent {@link Facet}, cannot be null
+ * @param facetReference
+ * the {@link FacetReference}, cannot be null, or contained by a resource
+ * @param editingDomain
+ * the editing domain needed to perform the Add Emf command, cannot be null
+ */
+ void addReferenceInFacet(Facet facet, FacetReference facetReference,
+ EditingDomain editingDomain);
+
+ /**
+ * Add a new {@link FacetOperation} to the given {@link Facet}
+ *
+ * @param facet
+ * the parent {@link Facet}, cannot be null
+ * @param facetOperation
+ * the new {@link FacetOperation}, cannot be null, or contained by a resource
+ * @param editingDomain
+ * the editing domain needed to perform the Add Emf command, cannot be null
+ */
+ void addOperationInFacet(Facet facet, FacetOperation facetOperation,
+ EditingDomain editingDomain);
+
+ /**
+ * Add a new {@link EParameter} to the given {@link FacetOperation}
+ *
+ * @param operation
+ * the parent {@link EOperation}
+ * @param parameter
+ * the new {@link EParameter}
+ * @param editingDomain
+ * the editing domain needed to perform the Add Emf command, cannot be null
+ */
+ void addParameterInOperation(FacetOperation operation,
+ EParameter parameter, EditingDomain editingDomain);
+
+ /**
+ * Set the given URI to the given {@link FacetSet}
+ *
+ * @param facetSet
+ * the {@link FacetSet} to be modified
+ * @param nsUri
+ * the Uri
+ * @param editingDomain
+ * the editing domain needed to perform the Set Emf command, cannot be null
+ */
+ void setFacetSetNsUri(FacetSet facetSet, String nsUri,
+ EditingDomain editingDomain);
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetActions.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetActions.java
new file mode 100644
index 00000000000..c09141dc386
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetActions.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.facet.efacet.core.internal.FacetActionsImpl;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.util.emf.core.exception.InvalidFacetSetException;
+
+/**
+ * This interface contains methods to create {@link FacetSet}s.
+ *
+ * @since 0.3
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IFacetActions {
+
+ IFacetActions INSTANCE = new FacetActionsImpl();
+
+ /**
+ * Add the given facetSet to the given facetSet model file, which will be
+ * created
+ *
+ * @param facetSet
+ * the facetSet to be created. Cannot be <code>null</code>
+ * @param file
+ * the new file in which the facetSet has to be created. Cannot
+ * be <code>null</code>, and cannot already exist
+ */
+ void saveFacetSet(FacetSet facetSet, IFile file) throws IOException,
+ InvalidFacetSetException;
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactory.java
new file mode 100644
index 00000000000..be139944096
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactory.java
@@ -0,0 +1,193 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+
+/**
+ * This interface provide a command factory. A command modify the editingDomain.
+ *
+ * @since 0.3
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IFacetCommandFactory {
+
+ /**
+ * Create the command to add a FacetSet (facetSet) to an existing FacetSet
+ * (parent).
+ *
+ * @param parent
+ * the parent of the facetSet to add.
+ * @param facetSet
+ * the facetSet to add.
+ * @return the command.
+ */
+ Command createFacetSetInFacetSetCommand(FacetSet parent, FacetSet facetSet);
+
+ /**
+ * Create the command to add a Facet (facet) to an existing FacetSet
+ * (parent).
+ *
+ * @param parent
+ * the parent of the facet to add.
+ * @param facet
+ * the facet to add.
+ * @return the command.
+ */
+ Command createFacetInFacetSetCommand(FacetSet parent, Facet facet);
+
+ /**
+ * Create the command to add an Attribute (facetAttrbute) to an existing
+ * Facet (parent).
+ *
+ * @param parent
+ * the parent of the attribute to add.
+ * @param facetAttrbute
+ * the attribute to add.
+ * @return the command.
+ */
+ Command createEditFacetStructuralFeatureCommand(
+ final DerivedTypedElement feature, final Facet container,
+ final String name, final int lowerBd, final int upperBd,
+ final EClassifier type, final boolean ordered,
+ final boolean unique, final Query query, final boolean volatilee,
+ final boolean change, final boolean derived,
+ final boolean transientt);
+
+ /**
+ * Create the command to add a Reference (facetReference) to an existing
+ * Facet (parent).
+ *
+ * @param parent
+ * the parent of the reference to add.
+ * @param facetReference
+ * the reference to add.
+ * @return the command.
+ */
+ Command createAddReferenceInFacetCommand(Facet parent,
+ FacetReference facetReference);
+
+ /**
+ * Create the command to add an Operation (FacetOperation) to an existing
+ * Facet (parent).
+ *
+ * @param parent
+ * the parent of the operation to add.
+ * @param facetOperation
+ * the operation to add.
+ * @return the command.
+ */
+ Command createAddOperationInFacetCommand(Facet parent,
+ FacetOperation facetOperation);
+
+ /**
+ * Create the command to add a Parameter (operationParameter) to an existing
+ * Operation (parent).
+ *
+ * @param parent
+ * the parent of the operation to add.
+ * @param facetOperation
+ * the operation to add.
+ * @return the command.
+ */
+ Command createAddParameterInOperationCommand(FacetOperation parent,
+ EParameter opeParameter);
+
+ /**
+ * Create the command to change the owner of an element.
+ *
+ * @param element
+ * @param newOwner
+ * @return
+ */
+ Command createChangeOwnerCommand(Object element, Object newOwner);
+
+ /**
+ * Create the command to change the attributes of a FacetSet.
+ *
+ * @param initialElement
+ * @param newElement
+ * @param newElement
+ * @return
+ */
+ Command createEditFacetSetCommand(final FacetSet editedFacetSet,
+ final FacetSet container, final String name);
+
+ /**
+ * Create the command to change the attributes of a Facet.
+ *
+ * @param initialElement
+ * @param newElement
+ * @return
+ */
+ Command createEditFacetCommand(Facet facet, FacetSet container,
+ String name, ETypedElement conformance, EClass extendEClass,
+ FacetSet extendedFacetSet);
+
+ /**
+ * Create the command to change the attributes of a FacetAttribute.
+ *
+ * @param initialElement
+ * @param newElement
+ * @return
+ */
+ Command createSetFacetAttributeCommand(final Facet initialContainer,
+ final FacetAttribute initialElement,
+ final FacetAttribute newElement);
+
+ /**
+ * Create the command to change the attributes of a FacetReference.
+ *
+ * @param initialElement
+ * @param newElement
+ * @return
+ */
+ Command createSetFacetReferenceCommand(final Facet initialContainer,
+ final FacetReference initialElement,
+ final FacetReference newElement);
+
+ /**
+ * Create the command to change the attributes of a FacetOperation.
+ *
+ * @param initialElement
+ * @param newElement
+ * @return
+ */
+ Command createEditFacetOperationCommand(DerivedTypedElement dte,
+ Facet facetContainer, String name, int lowerBound, int upperBound,
+ EClassifier type, boolean ordered, boolean unique, Query query);
+
+ /**
+ * Create the command to change the attributes of a FacetAttribute.
+ *
+ * @param initialElement
+ * @param newElement
+ * @return
+ */
+ Command createEditOperationParameterCommand(EParameter parameter,
+ FacetOperation container, String name, int lowerBound,
+ int upperBound, EClassifier type, boolean ordered, boolean unique);
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactoryFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactoryFactory.java
new file mode 100644
index 00000000000..fbd6cec84a6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetCommandFactoryFactory.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.internal.FacetCommandFactoryFactory;
+
+/**
+ * @since 0.3
+ */
+public interface IFacetCommandFactoryFactory {
+
+ IFacetCommandFactoryFactory DEFAULT = new FacetCommandFactoryFactory();
+
+ IFacetCommandFactory createCommandFactory(EditingDomain editingDomain);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManager.java
new file mode 100644
index 00000000000..395ab0e8264
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManager.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Olivier Remaud (Soft-Maint) - Bug 361794 - [Restructuring] EMF Facet customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ * Thomas Cicognani (Soft-Maint) - Bug 416221 - New methods to get references in FacetManager API
+ * Thomas Cicognani (Soft-Maint) - Bug 420193 - Listener on FacetManager
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.exception.FacetManagerException;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementResult;
+
+/**
+ * This interface allows clients to use the EMF Facet API to get and set the values of virtually
+ * added {@link EReference}s and {@link EAttribute}s, and invoke {@link EOperation}s.
+ * <p>
+ * Derived {@link FacetAttribute}s and {@link FacetReference}s are computed by queries, whereas
+ * non-derived {@link FacetAttribute}s and {@link EAttribute}s and {@link EReference}s and
+ * {@link FacetReference}s are stored in the serialization {@link Resource} specified in the
+ * {@link IFacetManagerFactory} that created this {@link IFacetManager}.
+ *
+ * @since 0.2
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IFacetManager {
+
+ /**
+ * Serialize the model containing the structural feature instances.
+ */
+ void saveStructuralFeatureInstanceModel() throws FacetManagerException;
+
+ /**
+ * Returns whether the given model element conforms to the given Facet
+ *
+ * @param eObject
+ * the model element
+ * @param facet
+ * the Facet the applicability of which is being tested
+ * @throws FacetManagerException
+ * if there is an error evaluating the Facet's conformance typed element
+ * @return whether the given model element should be seen as an instance of the given Facet
+ */
+ boolean isConforming(final EObject eObject, final Facet facet)
+ throws FacetManagerException;
+
+ /**
+ * Set the value of the given {@link EStructuralFeature} on the given
+ * {@link EObject} to the given {@link Object} value.
+ *
+ * @param eObject
+ * the model element whose feature must be set
+ * @param structuralFeature
+ * the feature to set
+ * @param newValue
+ * the new value
+ * @param editingDomain
+ * @throws FacetManagerException
+ * <ul>
+ * <li>if the eObject doesn't conform to the Facet of the given
+ * attribute (in the case of a FacetAttribute)</li>
+ * <li>if the Facet of the given attribute is not applicable to
+ * the given eObject (in the case of a FacetAttribute)</li>
+ * <li>
+ * if there is an error evaluating the Facet's conformance typed
+ * element</li>
+ * </ul>
+ */
+ void set(EObject eObject, EStructuralFeature structuralFeature,
+ Object newValue, EditingDomain editingDomain)
+ throws FacetManagerException;
+
+ /**
+ * Evaluate the given {@link EOperation} of the given {@link EObject}. The
+ * returned value has to be of the given expectedType {@link Class}
+ *
+ * @param eObject
+ * the model element on which the operation is evaluated
+ * @param operation
+ * the operation to evaluate
+ * @param resultType
+ * the expected type of the returned value; if the effective type
+ * is not compatible, an UnmatchingExpectedTypeException will be
+ * thrown
+ * @param arguments
+ * the values of the parameters of the EOperation that is
+ * evaluated: they must match both in size, types and
+ * multiplicity
+ * @return the return value of the operation
+ * @throws FacetManagerException
+ * <ul>
+ * <li>if the effective type does not match the expected type</li>
+ * <li>in case of an error in the query that returns the value
+ * (can only happen in the case of a FacetOperation)</li>
+ * <li>in case of an error when delegating to the Ecore
+ * reflexive API (if the given EOperation is not a
+ * FacetOperation)</li>
+ * <li>if the eObject doesn't conform to the Facet of the given
+ * operation (in the case of a FacetOperation)</li>
+ * <li>if the Facet of the given operation is not applicable to
+ * the given eObject (in the case of a FacetOperation)</li>
+ * <li>if there is an error evaluating the Facet's conformance
+ * typed element</li>
+ * <li>if the given actual parameters don't match the
+ * EOperation's formal parameters</li>
+ * </ul>
+ */
+ <T> T invoke(EObject eObject, EOperation operation,
+ Class<T> resultType, EditingDomain editingDomain,
+ Object... arguments) throws FacetManagerException;
+
+ /**
+ * Invoke the given {@link EOperation} on each element of the given
+ * collection of {@link EObject}s.
+ *
+ * @param eObjects
+ * the model elements on which the operation is evaluated
+ * @param operation
+ * the operation to evaluate
+ * @param arguments
+ * the values of the parameters of the EOperation that is
+ * evaluated: they must match both in size, types and
+ * multiplicity
+ * @return the list of results, one for each model element of the given
+ * <code>eObjects</code>
+ * @throws FacetManagerException
+ * <ul>
+ * <li>in case of an error when delegating to the Ecore
+ * reflexive API (if the given EOperation is not a
+ * FacetOperation)</li>
+ * <li>
+ * in case of an error in the derived typed element that returns
+ * the value</li>
+ * </ul>
+ */
+ List<ETypedElementResult> batchInvoke(Collection<EObject> eObjects,
+ EOperation operation, Object... arguments)
+ throws FacetManagerException;
+
+ /**
+ * This method returns the list of loaded facet sets.
+ *
+ * @return a modifiable list of all FacetSets that
+ * constitute the working context of the FacetManager
+ */
+ List<FacetSet> getManagedFacetSets();
+
+ /** @return the resourceSet used to manage the facet models. */
+ ResourceSet getResourceSet();
+
+ <T> T getOrInvoke(EObject element, ETypedElement query, Class<T> aClass)
+ throws FacetManagerException;
+
+ <T> List<T> getOrInvokeMultiValued(EObject eObject, ETypedElement feature,
+ Class<T> aClass) throws FacetManagerException;
+
+ <T> List<ETypedElementResult> batchGetOrInvoke(Collection<EObject> sources,
+ ETypedElement query, Class<T> aClass) throws FacetManagerException;
+
+ /**
+ * Get virtual references from an EObject. References must be defined in a
+ * FacetSet
+ *
+ * @param eObject
+ * Model element
+ * @return All not duplicated virtual references
+ * @throws FacetManagerException
+ * @since 0.4
+ */
+ Set<EReference> getReferences(EObject eObject) throws FacetManagerException;
+
+ /**
+ * Get virtual attributes from an EObject. References must be defined in a
+ * FacetSet
+ *
+ * @param eObject
+ * Model element
+ * @return All not duplicated virtual attributes
+ * @throws FacetManagerException
+ * @since 0.4
+ */
+ Set<EAttribute> getAttributes(EObject eObject) throws FacetManagerException;
+
+ /**
+ * Get virtual references and attributes from an EObject. References must be
+ * defined in a FacetSet
+ *
+ * @param eObject
+ * Model element
+ * @return All not duplicated virtual references and attributes
+ * @throws FacetManagerException
+ * @since 0.4
+ */
+ Set<EStructuralFeature> getStructuralFeature(EObject eObject)
+ throws FacetManagerException;
+
+ /**
+ * Adds a listener to this manager that will be notified when this manager's
+ * state changes.
+ *
+ * @param listener
+ * The listener to be added
+ * @since 0.4
+ */
+ void addListener(IFacetManagerListener listener);
+
+ /**
+ * Removes a listener from this manager.
+ *
+ * @param listener
+ * The listener to be removed
+ * @since 0.4
+ */
+ void removeListener(IFacetManagerListener listener);
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerFactory.java
new file mode 100644
index 00000000000..569a56a8e82
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerFactory.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.efacet.core.internal.FacetManagerFactory;
+
+/**
+ * Factory for {@link IFacetManager}.
+ *
+ * @since 0.2
+ */
+public interface IFacetManagerFactory {
+
+ /**
+ * The singleton instance of the factory.
+ */
+ IFacetManagerFactory DEFAULT = new FacetManagerFactory();
+
+ /**
+ * Create an {@link IFacetManager}.
+ *
+ * @param resource
+ * the {@link Resource} in which virtual {@link EStructuralFeature}s are serialized.
+ * Can be null if no EStructuralFeature provided a Facet are used.
+ */
+ IFacetManager getOrCreateFacetManager(Resource resource);
+
+ /**
+ * Create an {@link IFacetManager}.
+ *
+ * @param resourceSet
+ * the resourceSet which will be used to manage the facet models.
+ *
+ */
+ IFacetManager getOrCreateFacetManager(ResourceSet resourceSet);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerListener.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerListener.java
new file mode 100644
index 00000000000..555af8b0854
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetManagerListener.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Mia-Maint
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Thomas Cicognani (Soft-Maint) - Bug 420193 - Listener on FacetManager
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core;
+
+/**
+ * This interface allows clients to manage listeners added on the
+ * {@link IFacetManager}
+ *
+ * @since 0.4
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IFacetManagerListener {
+
+ /**
+ * Notifies that the {@link IFacetManager} has changed.
+ */
+ void facetManagerChanged();
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManager.java
new file mode 100644
index 00000000000..a155b11a84a
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManager.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core;
+
+import java.util.Collection;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+
+/**
+ * @since 0.2
+ */
+public interface IFacetSetCatalogManager {
+
+ Collection<FacetSet> getRegisteredFacetSets();
+
+ void registerFacetSet(FacetSet facetSet);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManagerFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManagerFactory.java
new file mode 100644
index 00000000000..d79d7eed028
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/IFacetSetCatalogManagerFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.emf.facet.efacet.core;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.efacet.core.internal.FacetCatalogManagerFactory;
+
+/**
+ * @since 0.2
+ */
+public interface IFacetSetCatalogManagerFactory {
+
+ IFacetSetCatalogManagerFactory DEFAULT = new FacetCatalogManagerFactory();
+
+ IFacetSetCatalogManager getOrCreateFacetSetCatalogManager(ResourceSet resourceSet);
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/DerivedTypedElementException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/DerivedTypedElementException.java
new file mode 100644
index 00000000000..f8ab410c436
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/DerivedTypedElementException.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2009 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - initial API and implementation
+ * Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ */
+package org.eclipse.emf.facet.efacet.core.exception;
+
+import org.eclipse.emf.facet.efacet.core.internal.exception.DerivedTypedElementEvaluationException;
+
+/**
+ * This exception is raised when something is wrong with a query, and there is not a more specific
+ * sub-class to describe the error (e.g. {@link DerivedTypedElementEvaluationException} )
+ * @since 0.2
+ */
+public class DerivedTypedElementException extends Exception {
+
+ // This class is a copy of :
+ // org.eclipse.emf.facet.infra.query.core.exception.ModelQueryException
+
+ private static final long serialVersionUID = -3203874059325745157L;
+
+ public DerivedTypedElementException(final String message) {
+ super(message);
+ }
+
+ public DerivedTypedElementException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public DerivedTypedElementException(final Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/FacetManagerException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/FacetManagerException.java
new file mode 100644
index 00000000000..ee949cf9ef8
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/FacetManagerException.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ */
+package org.eclipse.emf.facet.efacet.core.exception;
+
+/**
+ * @since 0.2
+ */
+public class FacetManagerException extends Exception {
+
+ private static final long serialVersionUID = -4670132391244495825L;
+
+ public FacetManagerException() {
+ super();
+ }
+
+ public FacetManagerException(final String message) {
+ super(message);
+ }
+
+ public FacetManagerException(final Throwable cause) {
+ super(cause);
+ }
+
+ public FacetManagerException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryException.java
new file mode 100644
index 00000000000..88c9db848b7
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryException.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2009 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - initial API and implementation
+ */
+package org.eclipse.emf.facet.efacet.core.exception;
+
+/**
+ * This exception is raised when something is wrong with a query, and there is not a more specific
+ * sub-class to describe the error (e.g. {@link QueryExecutionException} )
+ *
+ * @deprecated replaced by {@link DerivedTypedElementException}
+ */
+@Deprecated
+public class QueryException extends Exception {
+
+ // This class is a copy of :
+ // org.eclipse.emf.facet.infra.query.core.exception.ModelQueryException
+
+ private static final long serialVersionUID = -3203874059325745157L;
+
+ public QueryException(final String message) {
+ super(message);
+ }
+
+ public QueryException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public QueryException(final Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryExecutionException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryExecutionException.java
new file mode 100644
index 00000000000..2bad4a43d81
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryExecutionException.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2009 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - initial API and implementation
+ */
+package org.eclipse.emf.facet.efacet.core.exception;
+
+import org.eclipse.emf.facet.efacet.core.internal.exception.DerivedTypedElementEvaluationException;
+
+/**
+ * This exception occurs when something goes wrong during the execution of a
+ * query.
+ *
+ * @deprecated replaced by {@link DerivedTypedElementEvaluationException} cf.
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=374678
+ */
+@Deprecated
+public class QueryExecutionException extends QueryException {
+ // This class is a copy of
+ // org.eclipse.emf.facet.infra.query.core.ModelQueryExecutionException
+
+ private static final long serialVersionUID = -8464252257666617685L;
+
+ public QueryExecutionException(final String message) {
+ super(message);
+ }
+
+ public QueryExecutionException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public QueryExecutionException(final Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryTypeCheckingException.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryTypeCheckingException.java
new file mode 100644
index 00000000000..6026cc1426c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/exception/QueryTypeCheckingException.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2009 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - initial API and implementation
+ */
+package org.eclipse.emf.facet.efacet.core.exception;
+
+import org.eclipse.emf.facet.efacet.core.internal.exception.DerivedTypedElementTypeCheckingException;
+
+/**
+ * This exception occurs when the type of a query result is not the one expected
+ *
+ * @deprecated replaced by {@link DerivedTypedElementTypeCheckingException}
+ */
+@Deprecated
+public class QueryTypeCheckingException extends QueryException {
+
+ private static final long serialVersionUID = -9064274334817642819L;
+
+ public QueryTypeCheckingException(final String message) {
+ super(message);
+ }
+
+ public QueryTypeCheckingException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public QueryTypeCheckingException(final Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/Activator.java
new file mode 100644
index 00000000000..172b3f45387
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/Activator.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends Plugin {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return Activator.context;
+ }
+
+ @Override
+ public void start(final BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ Activator.context = bundleContext;
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ Activator.plugin = null;
+ super.stop(bundleContext);
+ }
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static Plugin getDefault() {
+ return Activator.plugin;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/CastUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/CastUtils.java
new file mode 100644
index 00000000000..3af72f2f222
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/CastUtils.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Grégoire Dupé (Mia-Software) - Bug 361612 - [Restructuring] New core for new version of the Facet metamodel
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.facet.efacet.core.internal.exception.UnmatchingExpectedTypeException;
+
+public final class CastUtils {
+
+ private CastUtils() {
+ //Must no be used.
+ }
+
+ /**
+ * Cast the given value to a List of the given type
+ *
+ * @param value
+ * the list
+ * @param expectedType
+ * the expected type of the list elements
+ * @param checkType
+ * whether to check the type of each element in the given list; should be
+ * <code>true</code> if the list comes from outside the framework, and
+ * <code>false</code> if the list is managed by the framework (and so already
+ * checked)
+ * @return the cast list
+ * @throws UnmatchingExpectedTypeException
+ */
+ @SuppressWarnings("unchecked")
+ //@SuppressWarnings("unchecked") The cast is checked by the both if statement.
+ public static <T> List<T> castToExpectedListType(final Object value, final Class<T> expectedType, final boolean checkType)
+ throws UnmatchingExpectedTypeException {
+ List<T> newList = new LinkedList<T>();
+ if (value instanceof List) {
+ newList = (List<T>) value;
+ } else {
+ newList.add((T) value);
+ }
+ final List<T> list = newList;
+ if (checkType) {
+ checkTypeOfAllListElements(list, expectedType);
+ }
+ return list;
+ }
+
+ @SuppressWarnings("unchecked")
+ //@SuppressWarnings("unchecked") This method is used to isolate unsafe cast.
+ public static <T> T castToExpectedType(final Object value, final Class<T> expectedType)
+ throws UnmatchingExpectedTypeException {
+ try {
+ return (T) value;
+ } catch (ClassCastException e) {
+ throw new UnmatchingExpectedTypeException("Type mismatch. Expected: " + //$NON-NLS-1$
+ expectedType.getClass().getName() + ", got " + value.getClass().getName(), e); //$NON-NLS-1$);
+ }
+ }
+
+ public static void checkTypeOfAllListElements(final List<?> list, final Class<?> expectedType) throws UnmatchingExpectedTypeException {
+ if (expectedType == null) {
+ // null means match everything
+ return;
+ }
+ final Iterator<?> iterator = list.iterator();
+ int index = -1;
+ while (iterator.hasNext()) {
+ final Object object = iterator.next();
+ index++;
+ if (object != null && !expectedType.isInstance(object)) {
+ throw new UnmatchingExpectedTypeException("Type mismatch at index " + index, expectedType, object); //$NON-NLS-1$
+ }
+ }
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementManager.java
new file mode 100644
index 00000000000..cb5d53f4665
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementManager.java
@@ -0,0 +1,877 @@
+/**
+ * Copyright (c) 2011, 2012, 2013 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Nicolas Bros (Mia-Software) - Bug 362191 - [Restructuring] Query mechanism for eFacet2
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ * Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Gregoire Dupe (Mia-Software) - Bug 418885 - ETypedElementSwitchQuery implemented using a deprecated query evaluator extension point
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.core.IDerivedTypedElementManager;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.efacet.core.internal.exception.DerivedTypedElementEvaluationException;
+import org.eclipse.emf.facet.efacet.core.internal.exception.DerivedTypedElementTypeCheckingException;
+import org.eclipse.emf.facet.efacet.core.internal.exception.UnmatchingExpectedTypeException;
+import org.eclipse.emf.facet.efacet.core.internal.query.DerivedTypedElementImplementationFactoryRegistry;
+import org.eclipse.emf.facet.efacet.core.internal.query.QueryImplementationFactoryRegistry;
+import org.eclipse.emf.facet.efacet.core.internal.query.QueryUtils;
+import org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementation;
+import org.eclipse.emf.facet.efacet.core.query.IQueryImplementation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.ETypedElementResult;
+import org.eclipse.emf.facet.util.core.Logger;
+
+public class DerivedTypedElementManager implements IDerivedTypedElementManager {
+
+ public Object evaluate(final DerivedTypedElement derivedTypedElement,
+ final EObject source, final List<ParameterValue> parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ Object result;
+ if (derivedTypedElement.isMany()) {
+ result = evaluateMultiValued(derivedTypedElement, source, parameterValues, null, facetManager);
+ } else {
+ result = evaluateSingleValued(derivedTypedElement, source, parameterValues, null, facetManager);
+ }
+ return result;
+ }
+
+ public Object evaluate(final Query query, final EObject source, final List<ParameterValue> parameterValues, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ final IQueryImplementation evaluator = QueryImplementationFactoryRegistry.INSTANCE.getEvaluatorFor(query, this);
+ final DerivedTypedElement derivedTE = QueryUtils.getOwningDerivedTypedElement(query);
+ Object result;
+ try {
+ result = evaluator.getValue(query, derivedTE, source, parameterValues, facetManager);
+ } catch (Exception e) {
+ throw new DerivedTypedElementEvaluationException(e);
+ }
+ return result;
+ }
+
+ public <T> T evaluateSingleValued(final DerivedTypedElement derivedTypedElement,
+ final EObject source, final List<ParameterValue> parameterValues, final Class<T> expectedType, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ if (derivedTypedElement.isMany()) {
+ throw new IllegalArgumentException("This method doesn't accept a multi-valued derived typed element."); //$NON-NLS-1$
+ }
+
+ Query query = derivedTypedElement.getQuery();
+ if (query == null) {
+ throw new DerivedTypedElementException("The given derived typed element doesn't contain a query"); //$NON-NLS-1$
+ }
+ Object queryResult = evaluate(derivedTypedElement, source, parameterValues, facetManager, query);
+
+ // expectedResultType == null means match everything
+ // And a null value for queryResult matches any type
+ if (expectedType != null && queryResult != null && !expectedType.isInstance(queryResult)) {
+ Exception e1 = new UnmatchingExpectedTypeException(
+ "The derived typed element did not evaluate to the expected type", expectedType, queryResult); //$NON-NLS-1$
+ throw new DerivedTypedElementException(e1);
+ }
+ // just checked
+ @SuppressWarnings("unchecked")
+ T typedQueryResult = (T) queryResult;
+ return typedQueryResult;
+ }
+
+ public <T> List<T> evaluateMultiValued(final DerivedTypedElement derivedTypedElement,
+ final EObject source, final List<ParameterValue> parameterValues, final Class<T> expectedType, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ if (!derivedTypedElement.isMany()) {
+ throw new IllegalArgumentException("This method doesn't accept a single-valued derived typed element."); //$NON-NLS-1$
+ }
+
+ Query query = derivedTypedElement.getQuery();
+ if (query == null) {
+ throw new DerivedTypedElementException("The given derived typed element doesn't contain a query"); //$NON-NLS-1$
+ }
+ Object queryResult = evaluate(derivedTypedElement, source, parameterValues, facetManager, query);
+ queryResult = setAsList(queryResult);
+ List<T> result;
+ if (queryResult instanceof List<?>) {
+ List<?> queryListResult = (List<?>) queryResult;
+ for (Object queryResultElement : queryListResult) {
+ // expectedType == null means match everything
+ // And a null queryResultElement for queryResult matches any type
+ if (expectedType != null && queryResultElement != null && !expectedType.isInstance(queryResultElement)) {
+ Exception e1 = new UnmatchingExpectedTypeException(
+ "The derived typed element did not evaluate to the expected type"); //$NON-NLS-1$
+ throw new DerivedTypedElementException(e1);
+ }
+ }
+ // just checked
+ @SuppressWarnings("unchecked")
+ List<T> typedQueryListResult = (List<T>) queryListResult;
+ result = typedQueryListResult;
+ } else {
+ throw new DerivedTypedElementException("The given multi-valued derived typed element did not evaluate to a List."); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ protected Object evaluate(final DerivedTypedElement derivedTE, final EObject source, final List<ParameterValue> parameterValues,
+ final IFacetManager facetManager, final Query query) throws DerivedTypedElementException {
+ Object queryResult;
+ IQueryImplementation evaluator = null;
+ IDerivedTypedElementImplementation evaluator2 = null;
+ try {
+ evaluator = QueryImplementationFactoryRegistry.INSTANCE.getEvaluatorFor(query, this);
+ } catch (DerivedTypedElementException exc) {
+ final String message = String.format(
+ "%s will try to use a deprected implementation", //$NON-NLS-1$
+ this.getClass().getName());
+ Logger.logError(exc, message, Activator.getDefault());
+ evaluator2 = DerivedTypedElementImplementationFactoryRegistry.INSTANCE.getEvaluatorFor(query, this);
+ }
+ if (evaluator == null) {
+ queryResult = evaluateAndCheck(derivedTE, source, parameterValues, evaluator2, facetManager);
+ } else {
+ queryResult = evaluateAndCheck(derivedTE.getQuery(), source, parameterValues, evaluator, facetManager);
+ }
+ return queryResult;
+ }
+
+ /** @deprecated support for the deprecated {@link IDerivedTypedElementImplementation} */
+ @Deprecated
+ private static Object evaluateAndCheck(final DerivedTypedElement derivedTE, final EObject source,
+ final List<ParameterValue> parameterValues, final IDerivedTypedElementImplementation evaluator, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ Query query = derivedTE.getQuery();
+ checkQuery(query, source);
+ Object result;
+ try {
+ result = evaluator.getValue(derivedTE, source, parameterValues, facetManager);
+ } catch (Throwable e) {
+ if (e instanceof DerivedTypedElementEvaluationException) {
+ throw (DerivedTypedElementEvaluationException) e;
+ }
+ throw new DerivedTypedElementEvaluationException(e);
+ }
+ // result = setAsList(result);
+ // gdupe: I don't understand why the result is wrapped in a list
+ checkResult(query, result, evaluator.getCheckResultType(),
+ isPrimitive(QueryUtils.getReturnType(query)));
+ return result;
+ }
+
+ private static Object evaluateAndCheck(final Query query, final EObject source, final List<ParameterValue> parameterValues,
+ final IQueryImplementation evaluator, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ checkQuery(query, source);
+ Object result;
+ try {
+ result = evaluator.getValue(query, QueryUtils.getOwningDerivedTypedElement(query), source, parameterValues, facetManager);
+ } catch (Throwable e) {
+ if (e instanceof DerivedTypedElementEvaluationException) {
+ throw (DerivedTypedElementEvaluationException) e;
+ }
+ throw new DerivedTypedElementEvaluationException(e);
+ }
+ checkResult(query, result, evaluator.isCheckResultType(), isPrimitive(QueryUtils.getReturnType(query)));
+ return result;
+ }
+
+ private static void checkQuery(final Query query, final EObject source) throws DerivedTypedElementException {
+ if (query == null) {
+ throw new IllegalArgumentException("query cannot be null"); //$NON-NLS-1$
+ }
+
+ EClassifier sourceType = QueryUtils.getSourceType(query);
+ if (sourceType == null && source != null) {
+ throw new DerivedTypedElementException("the query's sourceType is null and the source is not null"); //$NON-NLS-1$
+ }
+
+ // a null value for eObject matches any type
+ if (sourceType != null && source != null && !sourceType.isInstance(source)) {
+ StringBuffer message = new StringBuffer();
+ message.append("Wrong source type (for " + QueryUtils.getQueryDescription(query) + "): '"); //$NON-NLS-1$ //$NON-NLS-2$
+ message.append(source.eClass().getName());
+ message.append("' found; expected '"); //$NON-NLS-1$
+ message.append(sourceType.getName());
+ message.append("'."); //$NON-NLS-1$
+ throw new DerivedTypedElementTypeCheckingException(message.toString());
+ }
+ }
+
+ // public List<? extends AbstractDerivedTypedElementResult> evaluate(final DerivedTypedElement
+ // derivedTypedElement, final Collection<EObject> sources,
+ // final List<ParameterValue> parameterValues) throws DerivedTypedElementException {
+ // if (derivedTypedElement.isMany()) {
+ // try {
+ // return evaluateSingleValued(derivedTypedElement, sources, parameterValues, null);
+ // } catch (UnmatchingExpectedTypeException e) {
+ // // should never happen
+ // throw new IllegalStateException("Unexpected error"); //$NON-NLS-1$
+ // }
+ // } else {
+ // try {
+ // return evaluateMultiValued(derivedTypedElement, sources, parameterValues, null);
+ // } catch (UnmatchingExpectedTypeException e) {
+ // // should never happen
+ // throw new IllegalStateException("Unexpected error"); //$NON-NLS-1$
+ // }
+ // }
+ // }
+
+
+ // batch evaluation disabled : Bug 365429 - DerivedTypedElementManager : re-implement batch evaluation
+
+ public <T extends ETypedElementResult> List<T> batchEvaluate(final DerivedTypedElement derivedTypedElement,
+ final Collection<? extends EObject> sources, final List<ParameterValue> parameterValues, final Class<T> expectedType, final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+
+ throw new UnsupportedOperationException("not implemented yet"); //$NON-NLS-1$
+
+// if (derivedTypedElement == null) {
+// throw new IllegalArgumentException("The given derived typed element must not be null"); //$NON-NLS-1$
+// }
+//
+// List<T> abstractResultList;
+//
+// Query query = derivedTypedElement.getQuery();
+// if (query == null) {
+// throw new DerivedTypedElementException("The given derived typed element doesn't contain a query"); //$NON-NLS-1$
+// }
+// EClassifier eType = derivedTypedElement.getEType();
+// if (eType == null) {
+// throw new DerivedTypedElementException("The given derived typed element has a null type"); //$NON-NLS-1$
+// }
+// IDerivedTypedElementImplementation evaluator = DerivedTypedElementImplementationFactoryRegistry.INSTANCE.getEvaluatorFor(query);
+// if (evaluator == null) {
+// throw new DerivedTypedElementEvaluationException("No evaluator was found for a query of type " + query.getClass().getName()); //$NON-NLS-1$
+// }
+//
+// final boolean primitiveType = isPrimitive(eType);
+//
+// // if the evaluator implements multiple evaluation itself, then use it
+// if (evaluator instanceof IDerivedTypedElementCollectionImplementation) {
+// IDerivedTypedElementCollectionImplementation collectionEvaluator = (IDerivedTypedElementCollectionImplementation) evaluator;
+// if (derivedTypedElement.isMany()) {
+// if (primitiveType) {
+// if (expectedType != DerivedTypedElementPrimitiveTypeListResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is multi-valued, and its type is primitive, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementPrimitiveTypeListResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementPrimitiveTypeListResult<?>> listResultList = batchEvaluateMultiValuedPrimitiveDerivedTypedElementWithCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, collectionEvaluator);
+// // we just checked the type parameter T through expectedType
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) listResultList;
+// abstractResultList = castList;
+// } else {
+// if (expectedType != DerivedTypedElementEObjectListResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is multi-valued, and it returns model elements, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementEObjectListResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementEObjectListResult<?>> listResultList = batchEvaluateMultiValuedEObjectDerivedTypedElementWithCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, collectionEvaluator);
+// // we just checked the type parameter T through expectedType
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) listResultList;
+// abstractResultList = castList;
+// }
+// } else {
+// if (primitiveType) {
+// if (expectedType != DerivedTypedElementPrimitiveTypeResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is single-valued, and its type is primitive, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementPrimitiveTypeResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementPrimitiveTypeResult<?>> resultList = batchEvaluateSingleValuedPrimitiveDerivedTypedElementWithCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, collectionEvaluator);
+// // we just checked the type parameter T through expectedType
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) resultList;
+// abstractResultList = castList;
+// } else {
+// if (expectedType != DerivedTypedElementEObjectResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is single-valued, and it returns a model element, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementEObjectResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementEObjectResult<?>> resultList = batchEvaluateSingleValuedEObjectDerivedTypedElementWithCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, collectionEvaluator);
+// // we just checked the type parameter T through expectedType
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) resultList;
+// abstractResultList = castList;
+// }
+// }
+//
+// } else {
+// // otherwise, do multiple evaluation by calling the evaluator's
+// // single evaluation multiple times
+//
+// if (derivedTypedElement.isMany()) {
+// if (primitiveType) {
+// if (expectedType != DerivedTypedElementPrimitiveTypeListResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is multi-valued, and its type is primitive, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementPrimitiveTypeListResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementPrimitiveTypeListResult<?>> listResultList = batchEvaluateMultiValuedPrimitiveDerivedTypedElementWithSimpleEvaluator(
+// derivedTypedElement, sources, parameterValues, evaluator);
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) listResultList;
+// abstractResultList = castList;
+// } else {
+// if (expectedType != DerivedTypedElementEObjectListResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is multi-valued, and it returns model elements, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementEObjectListResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementEObjectListResult<?>> listResultList = batchEvaluateMultiValuedEObjectDerivedTypedElementWithSimpleEvaluator(
+// derivedTypedElement, sources, parameterValues, evaluator);
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) listResultList;
+// abstractResultList = castList;
+// }
+// } else {
+// if (primitiveType) {
+// if (expectedType != DerivedTypedElementPrimitiveTypeResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is single-valued, and its type is primitive, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementPrimitiveTypeResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementPrimitiveTypeResult<?>> resultList = batchEvaluateSingleValuedPrimitiveDerivedTypedElementWithSimpleCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, evaluator);
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) resultList;
+// abstractResultList = castList;
+// } else {
+// if (expectedType != DerivedTypedElementEObjectResult.class) {
+// throw new UnmatchingExpectedTypeException("The derivedTypedElement is single-valued, and it returns a model element, " + //$NON-NLS-1$
+// "so expectedType must be " + DerivedTypedElementEObjectResult.class.getSimpleName()); //$NON-NLS-1$
+// }
+// List<DerivedTypedElementEObjectResult<?>> resultList = batchEvaluateSingleValuedEObjectDerivedTypedElementWithSimpleCollectionEvaluator(
+// derivedTypedElement, sources, parameterValues, null);
+// @SuppressWarnings("unchecked")
+// List<T> castList = (List<T>) resultList;
+// abstractResultList = castList;
+// }
+// }
+// }
+// return abstractResultList;
+ }
+
+// private static List<DerivedTypedElementPrimitiveTypeListResult<?>> batchEvaluateMultiValuedPrimitiveDerivedTypedElementWithCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementCollectionImplementation collectionEvaluator)
+// throws DerivedTypedElementException {
+//
+// List<? extends AbstractDerivedTypedElementResult> listResultList = collectionEvaluator
+// .getValues(derivedTypedElement, sources, parameterValues);
+//
+// // check the return type from the evaluator in order to be able to cast safely
+// for (int index = 0; index < listResultList.size(); index++) {
+// AbstractDerivedTypedElementResult elementResult = listResultList.get(index);
+// if (elementResult instanceof DerivedTypedElementPrimitiveTypeListResult<?>) {
+// DerivedTypedElementPrimitiveTypeListResult<?> derivedTypedElementPrimitiveTypeListResult = (DerivedTypedElementPrimitiveTypeListResult<?>) elementResult;
+// checkResult(derivedTypedElement.getQuery(), derivedTypedElementPrimitiveTypeListResult.getResultList(),
+// collectionEvaluator.getCheckResultType());
+// } else {
+// throw new DerivedTypedElementEvaluationException(ErrorHandlingUtils.buildWrongTypeMessage(
+// "Wrong element type at index " + index + " in the result from the evaluator: " + collectionEvaluator.getClass().getName(), //$NON-NLS-1$//$NON-NLS-2$
+// DerivedTypedElementPrimitiveTypeListResult.class, elementResult));
+// }
+// }
+//
+// // just checked
+// @SuppressWarnings("unchecked")
+// List<DerivedTypedElementPrimitiveTypeListResult<?>> result = (List<DerivedTypedElementPrimitiveTypeListResult<?>>) listResultList;
+// return result;
+// }
+//
+// private static List<DerivedTypedElementEObjectListResult<?>> batchEvaluateMultiValuedEObjectDerivedTypedElementWithCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementCollectionImplementation collectionEvaluator)
+// throws DerivedTypedElementException {
+// List<? extends AbstractDerivedTypedElementResult> listResultList = collectionEvaluator
+// .getValues(derivedTypedElement, sources, parameterValues);
+//
+// // check the return type from the evaluator in order to be able to cast safely
+// for (int index = 0; index < listResultList.size(); index++) {
+// AbstractDerivedTypedElementResult elementResult = listResultList.get(index);
+// if (elementResult instanceof DerivedTypedElementEObjectListResult<?>) {
+// DerivedTypedElementEObjectListResult<?> derivedTypedElementEObjectListResult = (DerivedTypedElementEObjectListResult<?>) elementResult;
+// checkResult(derivedTypedElement.getQuery(), derivedTypedElementEObjectListResult.getResultList(),
+// collectionEvaluator.getCheckResultType());
+// } else {
+// throw new DerivedTypedElementEvaluationException(ErrorHandlingUtils.buildWrongTypeMessage(
+// "Wrong element type at index " + index + " in the result from the evaluator: " + collectionEvaluator.getClass().getName(), //$NON-NLS-1$//$NON-NLS-2$
+// DerivedTypedElementEObjectListResult.class, elementResult));
+// }
+// }
+//
+// // just checked
+// @SuppressWarnings("unchecked")
+// List<DerivedTypedElementEObjectListResult<?>> result = (List<DerivedTypedElementEObjectListResult<?>>) listResultList;
+// return result;
+// }
+//
+// private static List<DerivedTypedElementPrimitiveTypeResult<?>> batchEvaluateSingleValuedPrimitiveDerivedTypedElementWithCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementCollectionImplementation collectionEvaluator)
+// throws DerivedTypedElementException {
+// // TODO Auto-generated method stub
+// return null;
+// }
+//
+// private static List<DerivedTypedElementEObjectResult<?>> batchEvaluateSingleValuedEObjectDerivedTypedElementWithCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementCollectionImplementation collectionEvaluator) throws DerivedTypedElementException {
+// // TODO Auto-generated method stub
+// return null;
+// }
+//
+// private static List<DerivedTypedElementPrimitiveTypeListResult<?>> batchEvaluateMultiValuedPrimitiveDerivedTypedElementWithSimpleEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementImplementation evaluator) {
+//
+// Query query = derivedTypedElement.getQuery();
+//
+// List<DerivedTypedElementPrimitiveTypeListResult<?>> listResultList = new ArrayList<DerivedTypedElementPrimitiveTypeListResult<?>>();
+// for (EObject eObject : sources) {
+// DerivedTypedElementPrimitiveTypeListResult<Object> primitiveTypeListResult = EFacetFactory.eINSTANCE
+// .createDerivedTypedElementPrimitiveTypeListResult();
+//
+// Throwable error = null;
+// try {
+// primitiveTypeListResult.setSource(eObject);
+// primitiveTypeListResult.setDerivedTypedElement(derivedTypedElement);
+// setParameterValues(primitiveTypeListResult.getParameterValues(), parameterValues);
+// checkSourceType(query.getSourceType(), query, eObject);
+// } catch (Throwable e) {
+// error = e;
+// }
+// if (error != null) {
+// primitiveTypeListResult.setException(error);
+// } else {
+// try {
+// Object evaluationResult = evaluator.getValue(derivedTypedElement, eObject, parameterValues);
+// checkResult(query, evaluationResult, evaluator.getCheckResultType());
+// // checked by checkResult
+// Collection<?> evaluationResultCollection = (Collection<?>) evaluationResult;
+// for (Object object : evaluationResultCollection) {
+// primitiveTypeListResult.getResultList().add(object);
+// }
+// } catch (Throwable e) {
+// primitiveTypeListResult.setException(e);
+// }
+// }
+// listResultList.add(primitiveTypeListResult);
+//
+// }
+// return listResultList;
+// }
+//
+// private static List<DerivedTypedElementEObjectListResult<?>> batchEvaluateMultiValuedEObjectDerivedTypedElementWithSimpleEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementImplementation evaluator) {
+// Query query = derivedTypedElement.getQuery();
+//
+// List<DerivedTypedElementEObjectListResult<?>> listResultList = new ArrayList<DerivedTypedElementEObjectListResult<?>>();
+// for (EObject eObject : sources) {
+// DerivedTypedElementEObjectListResult<EObject> eObjectListResult = EFacetFactory.eINSTANCE
+// .createDerivedTypedElementEObjectListResult();
+//
+// Throwable error = null;
+// try {
+// eObjectListResult.setSource(eObject);
+// eObjectListResult.setDerivedTypedElement(derivedTypedElement);
+// setParameterValues(eObjectListResult.getParameterValues(), parameterValues);
+// checkSourceType(query.getSourceType(), query, eObject);
+// } catch (Throwable e) {
+// error = e;
+// }
+// if (error != null) {
+// eObjectListResult.setException(error);
+// } else {
+// try {
+// Object evaluationResult = evaluator.getValue(derivedTypedElement, eObject, parameterValues);
+// checkResult(query, evaluationResult, evaluator.getCheckResultType(), false);
+// // checked by checkResult
+// @SuppressWarnings("unchecked")
+// Collection<? extends EObject> evaluationResultCollection = (Collection<? extends EObject>) evaluationResult;
+// for (EObject e : evaluationResultCollection) {
+// eObjectListResult.getResultList().add(e);
+// }
+// } catch (Throwable e) {
+// eObjectListResult.setException(e);
+// }
+// }
+// listResultList.add(eObjectListResult);
+//
+// }
+// return listResultList;
+// }
+//
+// private static List<DerivedTypedElementPrimitiveTypeResult<?>> batchEvaluateSingleValuedPrimitiveDerivedTypedElementWithSimpleCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementImplementation evaluator)
+// throws DerivedTypedElementException {
+// // TODO Auto-generated method stub
+// return null;
+// }
+//
+// private static List<DerivedTypedElementEObjectResult<?>> batchEvaluateSingleValuedEObjectDerivedTypedElementWithSimpleCollectionEvaluator(
+// final DerivedTypedElement derivedTypedElement, final Collection<EObject> sources, final List<ParameterValue> parameterValues,
+// final IDerivedTypedElementImplementation evaluator)
+// throws DerivedTypedElementException {
+// // TODO Auto-generated method stub
+// return null;
+// }
+
+// public <T> List<DerivedTypedElementListResult<T>> evaluateMultiValued(final DerivedTypedElement derivedTypedElement,
+// final Collection<? extends EObject> sources, final List<ParameterValue> parameterValues,
+// final Class<T> expectedType)
+// throws DerivedTypedElementException, UnmatchingExpectedTypeException {
+// if (!derivedTypedElement.isMany()) {
+// throw new IllegalArgumentException("This method doesn't accept a single-valued derived typed element."); //$NON-NLS-1$
+// }
+//
+// Query query = derivedTypedElement.getQuery();
+// if (query == null) {
+// throw new DerivedTypedElementException("The given derived typed element doesn't contain a query"); //$NON-NLS-1$
+// }
+// IDerivedTypedElementImplementation evaluator =
+// DerivedTypedElementImplementationFactoryRegistry.INSTANCE.getEvaluatorFor(query);
+//
+// List<?> queryResult = batchEvaluateAndCheck(derivedTypedElement, sources, parameterValues,
+// evaluator);
+// // Java doesn't support co- or contra-variance on generics,
+// // so we can't return the right type
+// @SuppressWarnings("unchecked")
+// List<DerivedTypedElementListResult<T>> multiResultList =
+// (List<DerivedTypedElementListResult<T>>) queryResult;
+//
+// // check each result element in each result list
+// if (expectedType != null) {
+// int sourceIndex = 0;
+// for (DerivedTypedElementListResult<?> derivedTypedElementResult : multiResultList) {
+// EList<?> resultList = derivedTypedElementResult.getResultList();
+// int index = 0;
+// for (Object resultElement : resultList) {
+// // a null value for resultElement matches any type
+// if (resultElement != null && !expectedType.isInstance(resultElement)) {
+// throw new UnmatchingExpectedTypeException(
+// "The element at index " + index + " in the list that resulted from the evaluation of the multi-valued " //$NON-NLS-1$ //$NON-NLS-2$
+// + "derived typed element does not match the expected type " //$NON-NLS-1$
+// + "for the source element at index " + sourceIndex, expectedType, resultElement); //$NON-NLS-1$
+// }
+// index++;
+// }
+// sourceIndex++;
+// }
+// }
+// return multiResultList;
+// }
+//
+// private static List<?> batchEvaluateAndCheck(final DerivedTypedElement derivedTypedElement,
+// final Collection<EObject> eObjects,
+// final List<ParameterValue> parameterValues, final IDerivedTypedElementImplementation
+// evaluator)
+// throws DerivedTypedElementException {
+// List<?> result;
+//
+// Query query = derivedTypedElement.getQuery();
+// if (query == null) {
+// throw new IllegalArgumentException("the query cannot be null"); //$NON-NLS-1$
+// }
+//
+// EClassifier sourceType = query.getSourceType();
+//
+// final boolean primitiveType = derivedTypedElement instanceof EAttribute;
+//
+// if (derivedTypedElement.isMany()) {
+// if (evaluator instanceof IDerivedTypedElementCollectionImplementation) {
+// IDerivedTypedElementCollectionImplementation collectionEvaluator =
+// (IDerivedTypedElementCollectionImplementation) evaluator;
+// // List<? extends AbstractDerivedTypedElementResult> listResultList =
+// // collectionEvaluator
+// // .getValues(derivedTypedElement, eObjects, parameterValues);
+// // int index = 0;
+// // for (AbstractDerivedTypedElementResult listResult : listResultList) {
+// // EList<?> resultList;
+// // if (primitiveType && listResult instanceof
+// // DerivedTypedElementPrimitiveTypeListResult<?>) {
+// // DerivedTypedElementPrimitiveTypeListResult<?> primitiveListResult =
+// // (DerivedTypedElementPrimitiveTypeListResult<?>) listResult;
+// // resultList = primitiveListResult.getResultList();
+// // } else if (!primitiveType && listResult instanceof
+// // DerivedTypedElementEObjectListResult<?>) {
+// // DerivedTypedElementEObjectListResult<?> eObjectListResult =
+// // (DerivedTypedElementEObjectListResult<?>) listResult;
+// // resultList = eObjectListResult.getResultList();
+// // } else {
+// // throw new DerivedTypedElementEvaluationException(
+// // "Wrong element type at index " + index + " in the result from the evaluator " + collectionEvaluator.getClass().getName()); //$NON-NLS-1$//$NON-NLS-2$
+// // }
+// // checkResult(query, resultList, evaluator.getCheckResultType());
+// // index++;
+// // }
+// // result = listResultList;
+// } else {
+//
+// // List<AbstractDerivedTypedElementResult> listResultList = new
+// // ArrayList<AbstractDerivedTypedElementResult>();
+// // for (EObject eObject : eObjects) {
+// // AbstractDerivedTypedElementResult listResult;
+// // List<?> resultList;
+// // if (primitiveType) {
+// // DerivedTypedElementPrimitiveTypeListResult<?> primitiveTypeListResult =
+// // EFacetFactory.eINSTANCE
+// // .createDerivedTypedElementPrimitiveTypeListResult();
+// // listResult = primitiveTypeListResult;
+// // resultList = primitiveTypeListResult.getResultList();
+// // } else {
+// // DerivedTypedElementEObjectListResult<?> eObjectTypeListResult =
+// // EFacetFactory.eINSTANCE
+// // .createDerivedTypedElementEObjectListResult();
+// // listResult = eObjectTypeListResult;
+// // resultList = eObjectTypeListResult.getResultList();
+// // }
+// //
+// // Throwable error = null;
+// // try {
+// // listResult.setSource(eObject);
+// // listResult.setDerivedTypedElement(derivedTypedElement);
+// // setParameterValues(listResult.getParameterValues(), parameterValues);
+// // checkSourceType(sourceType, query, eObject);
+// // } catch (Throwable e) {
+// // error = e;
+// // }
+// // if (error != null) {
+// // listResult.setException(error);
+// // } else {
+// // try {
+// // Object evaluationResult = evaluator.getValue(derivedTypedElement, eObject,
+// // parameterValues);
+// // checkResult(query, evaluationResult, evaluator.getCheckResultType());
+// // // checked by checkResult
+// // Collection<?> evaluationResultCollection = (Collection<?>) evaluationResult;
+// // for (Object object : evaluationResultCollection) {
+// // resultList.add(object);
+// // }
+// // } catch (Throwable e) {
+// // listResult.setException(e);
+// // }
+// // }
+// // listResultList.add(listResult);
+// //
+// // }
+// // result = listResultList;
+//
+// }
+// } else {
+// // if the evaluator implements multiple evaluation itself, then use it
+// if (evaluator instanceof IDerivedTypedElementCollectionImplementation) {
+// IDerivedTypedElementCollectionImplementation collectionEvaluator =
+// (IDerivedTypedElementCollectionImplementation) evaluator;
+// List<? extends AbstractDerivedTypedElementResult> singleResultList = collectionEvaluator
+// .getValues(derivedTypedElement, eObjects, parameterValues);
+// int index = 0;
+// for (AbstractDerivedTypedElementResult singleResult : singleResultList) {
+// Object resultElement;
+// if (primitiveType && singleResult instanceof DerivedTypedElementPrimitiveTypeResult<?>) {
+// DerivedTypedElementPrimitiveTypeResult<?> primitiveResult =
+// (DerivedTypedElementPrimitiveTypeResult<?>) singleResult;
+// resultElement = primitiveResult.getResult();
+// } else if (!primitiveType && singleResult instanceof DerivedTypedElementEObjectResult<?>) {
+// DerivedTypedElementEObjectResult<?> eObjectResult = (DerivedTypedElementEObjectResult<?>)
+// singleResult;
+// resultElement = eObjectResult.getResult();
+// } else {
+// throw new DerivedTypedElementEvaluationException(
+// "Wrong element type at index " + index + " in the result from the evaluator " + collectionEvaluator.getClass().getName()); //$NON-NLS-1$//$NON-NLS-2$
+// }
+// checkResult(query, result, evaluator.getCheckResultType());
+// index++;
+// }
+// } else {
+// // otherwise, do multiple evaluation by calling the evaluator's
+// // single evaluation multiple times
+// List<DerivedTypedElementResult<?>> resultList = new
+// ArrayList<DerivedTypedElementResult<?>>();
+// for (EObject eObject : eObjects) {
+// DerivedTypedElementResult<Object> singleResult =
+// EFacetFactory.eINSTANCE.createDerivedTypedElementResult();
+// Throwable error = null;
+// try {
+// singleResult.setSource(eObject);
+// singleResult.setDerivedTypedElement(derivedTypedElement);
+// setParameterValues(singleResult.getParameterValues(), parameterValues);
+// checkSourceType(sourceType, query, eObject);
+// } catch (Throwable e) {
+// error = e;
+// }
+// if (error != null) {
+// singleResult.setException(error);
+// } else {
+// try {
+// Object evaluationResult = evaluator.getValue(derivedTypedElement, eObject, parameterValues);
+// checkResult(query, evaluationResult, evaluator.getCheckResultType());
+// singleResult.setResult(evaluationResult);
+// } catch (Throwable e) {
+// singleResult.setException(e);
+// }
+// }
+// resultList.add(singleResult);
+// }
+// result = resultList;
+// }
+// }
+//
+// return result;
+// }
+
+// private static void checkSourceType(final EClassifier sourceType, final Query query, final EObject eObject)
+// throws DerivedTypedElementException {
+// if (sourceType != null) {
+// // a null value for eObject matches any type
+// if (eObject != null && !sourceType.isInstance(eObject)) {
+// StringBuffer message = new StringBuffer();
+// message.append("Wrong source type (for " + QueryUtils.getQueryDescription(query) + "): '"); //$NON-NLS-1$ //$NON-NLS-2$
+// message.append(eObject.eClass().getName());
+// message.append("' found; expected '"); //$NON-NLS-1$
+// message.append(sourceType.getName());
+// message.append("'."); //$NON-NLS-1$
+// throw new DerivedTypedElementTypeCheckingException(message.toString());
+// }
+// } else {
+// if (eObject != null) {
+// throw new DerivedTypedElementException("the query's sourceType is null and the source is not null"); //$NON-NLS-1$
+// }
+// }
+// }
+//
+// private static void setParameterValues(final EList<ParameterValue> target, final List<ParameterValue> parameterValues) {
+// if (parameterValues != null) {
+// for (ParameterValue parameterValue : parameterValues) {
+// if (parameterValue == null) {
+// throw new IllegalArgumentException("null parameter value"); //$NON-NLS-1$
+// }
+// // containment link -> we need to copy since we can have the same
+// // parameter for several results
+// target.add(EcoreUtil.copy(parameterValue));
+// }
+// }
+// }
+
+ private static final void checkResult(final Query query, final Object result,
+ final boolean checkResultType, final boolean primitive) throws DerivedTypedElementTypeCheckingException {
+ if (QueryUtils.isMany(query)) {
+ if (!(result instanceof Collection<?>)) {
+ String strResult;
+ if (result == null) {
+ strResult = "null"; //$NON-NLS-1$
+ } else {
+ strResult = "an instance of " + result.getClass().getName(); //$NON-NLS-1$
+ }
+ throw new DerivedTypedElementTypeCheckingException(
+ "A collection is expected as result. The result is " //$NON-NLS-1$
+ + strResult + " (on " + QueryUtils.getQueryDescription(query) + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if (checkResultType) {
+ for (Object collectionElement : (Collection<?>) result) {
+ if (collectionElement != null
+ && !(QueryUtils.getReturnType(query)
+ .isInstance(collectionElement))) {
+ throw new DerivedTypedElementTypeCheckingException(
+ "Wrong result collection element type: " + collectionElement.getClass().getName() //$NON-NLS-1$
+ + "(" + QueryUtils.getReturnType(query).getName() + " is expected) " //$NON-NLS-1$ //$NON-NLS-2$
+ + " on " + QueryUtils.getQueryDescription(query)); //$NON-NLS-1$
+ }
+ }
+ } else if (!primitive) {
+ // at least check that EObjects are returned
+ for (Object collectionElement : (Collection<?>) result) {
+ if (collectionElement != null && !(collectionElement instanceof EObject)) {
+ throw new DerivedTypedElementTypeCheckingException(
+ "Wrong result collection element type: " + collectionElement.getClass().getName() //$NON-NLS-1$
+ + "(an instance of " + EObject.class.getName() + " is expected) " //$NON-NLS-1$ //$NON-NLS-2$
+ + " on " + QueryUtils.getQueryDescription(query)); //$NON-NLS-1$
+ }
+ }
+ }
+ } else {
+ if (result instanceof Collection<?>) {
+ throw new DerivedTypedElementTypeCheckingException("A " //$NON-NLS-1$
+ + QueryUtils.getSourceType(query).getName()
+ + " instance is expected as result. The result is: " //$NON-NLS-1$
+ + result + " (on " + QueryUtils.getQueryDescription(query) + ")"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ if (checkResultType) {
+ if (result != null && !(QueryUtils.getReturnType(query).isInstance(result))) {
+ throw new DerivedTypedElementTypeCheckingException("Wrong result type: " //$NON-NLS-1$
+ + result.getClass().getName()
+ + " is returned while " //$NON-NLS-1$
+ + QueryUtils.getReturnType(query).getInstanceClassName()
+ + " is expected." + " (on " + QueryUtils.getQueryDescription(query) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ } else if (!primitive) {
+ // at least check that an EObject is returned
+ if (result != null && !(result instanceof EObject)) {
+ throw new DerivedTypedElementTypeCheckingException(
+ "Wrong result collection element type: " + result.getClass().getName() //$NON-NLS-1$
+ + "(an instance of " + EObject.class.getName() + " is expected) " //$NON-NLS-1$ //$NON-NLS-2$
+ + " on " + QueryUtils.getQueryDescription(query)); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private static boolean isPrimitive(final EClassifier eType) {
+ final boolean primitiveType;
+ if (eType instanceof EDataType) {
+ primitiveType = true;
+ } else if (eType instanceof EClass) {
+ primitiveType = false;
+ } else {
+ throw new IllegalArgumentException("unhandled derived typed element type: " + eType.getName()); //$NON-NLS-1$
+ }
+ return primitiveType;
+ }
+
+ /**
+ * Transform the element in parameter in list (if necessary).
+ *
+ * @param element
+ * the element to transform
+ * @return a list.
+ */
+ protected static List<Object> setAsList(final Object element) {
+ List<Object> newList = new LinkedList<Object>();
+ if (element instanceof List) {
+ @SuppressWarnings("unchecked")
+ //@SuppressWarnings("unchecked") the cast is safe because were
+ //casting a List to a List<Object>
+ final List<Object> tmpList = (List<Object>) element;
+ newList = tmpList;
+ } else {
+ newList.add(element);
+ }
+ return newList;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementUtils.java
new file mode 100644
index 00000000000..883b1910d01
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/DerivedTypedElementUtils.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Grégoire Dupé (Mia-Software) - Bug 361612 - [Restructuring] New core for new version of the Facet metamodel
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.facet.efacet.core.IDerivedTypedElementManager;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.efacet.core.internal.exception.UnmatchingExpectedTypeException;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+
+public final class DerivedTypedElementUtils {
+
+ private DerivedTypedElementUtils() {
+ // Must not be used
+ }
+
+ private static <T> List<ParameterValue> createAndCheckOperationParameterValues(final EOperation operation,
+ final Object... arguments) throws UnmatchingExpectedTypeException {
+ final EList<EParameter> operationParameters = operation.getEParameters();
+ //Begin precondition checking
+ if (arguments.length > 0
+ && operationParameters.size() != arguments.length) {
+ throw new IllegalArgumentException("Facet operation '" + operation.getName() + //$NON-NLS-1$
+ "' expects " + operationParameters.size() + " parameters. Got " + arguments.length); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ //End precondition checking
+ final List<ParameterValue> parameterValues = new ArrayList<ParameterValue>();
+ for (int i = 0; i < arguments.length; i++) {
+ final Object argument = arguments[i];
+ final EParameter eParameter = operationParameters.get(i);
+ //Begin precondition checking
+ EmfUtils.checkAssignment(argument, eParameter);
+ //End precondition checking
+ final ParameterValue parameterValue = EFacetFactory.eINSTANCE.createParameterValue();
+ parameterValue.setParameter(eParameter);
+ parameterValue.setValue(argument);
+ parameterValues.add(parameterValue);
+ }
+ return parameterValues;
+ }
+
+ public static Object evaluate(final EObject eObject, final EOperation operation, final IFacetManager facetManager, final Object... arguments) throws UnmatchingExpectedTypeException,
+ DerivedTypedElementException {
+ Object result;
+ final List<ParameterValue> parameterValues = DerivedTypedElementUtils.createAndCheckOperationParameterValues(operation, arguments);
+ result = IDerivedTypedElementManager.INSTANCE.evaluate((FacetOperation) operation, eObject, parameterValues, facetManager);
+ return result;
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EFacetManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EFacetManager.java
new file mode 100644
index 00000000000..2c443525cc8
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EFacetManager.java
@@ -0,0 +1,197 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 333553 - The user has not to deal with two files to create a facet
+ * Nicolas Bros (Mia-Software) - Bug 361617 - Deprecation of APIs for the old Facet metamodels
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.facet.efacet.EFacetFactory;
+import org.eclipse.emf.facet.efacet.ParameterValue;
+import org.eclipse.emf.facet.efacet.Query;
+import org.eclipse.emf.facet.efacet.QueryContext;
+import org.eclipse.emf.facet.efacet.QueryResult;
+import org.eclipse.emf.facet.efacet.core.IEFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.QueryException;
+import org.eclipse.emf.facet.efacet.core.exception.QueryTypeCheckingException;
+import org.eclipse.emf.facet.efacet.core.internal.query.QueryEvaluatorFactoryRegistry;
+import org.eclipse.emf.facet.efacet.core.query.IQueryEvaluator;
+
+/** @deprecated replaced by {@link DerivedTypedElementManager} */
+@Deprecated
+public final class EFacetManager implements IEFacetManager {
+
+ /**
+ * This method looks for a valid evaluator for the query and calls it to perform its
+ * basicEvaluate
+ */
+ public Object basicEvaluate(final Query query, final EObject eObject,
+ final List<ParameterValue> parameterValues) throws QueryException {
+ IQueryEvaluator evaluator = QueryEvaluatorFactoryRegistry.INSTANCE.getEvaluatorFor(query);
+ evaluator.startEvaluate();
+ Object result = evaluateAndCheck(query, eObject, parameterValues, evaluator);
+ evaluator.endEvaluate();
+ return result;
+ }
+
+ private Object evaluateAndCheck(final Query query, final EObject eObject,
+ final List<ParameterValue> parameterValues, final IQueryEvaluator evaluator)
+ throws QueryException {
+
+ if (!query.getScope().isInstance(eObject)) {
+ StringBuffer message = new StringBuffer();
+ message.append("Wrong context type (for query " + toString() + "): "); //$NON-NLS-1$ //$NON-NLS-2$
+ message.append(eObject.eClass().getName());
+ message.append(" found; expected scopes are {"); //$NON-NLS-1$
+ message.append(query.getScope().getName());
+ message.append("}"); //$NON-NLS-1$
+ QueryTypeCheckingException e = new QueryTypeCheckingException(message.toString());
+ throw e;
+ }
+ Object result = evaluator.basicEvaluate(query, eObject, parameterValues);
+ checkResult(query, result, evaluator.getCheckResultType());
+ return result;
+ }
+
+ /**
+ * This method is equivalent to {@link EFacetManager#basicEvaluate(Query, EObject, List)} with
+ * no query parameters.
+ */
+ public final Object basicEvaluate(final Query query, final EObject eObject)
+ throws QueryException {
+ return basicEvaluate(query, eObject, null);
+ }
+
+ /**
+ * This method is used to evaluate the given {@link Query} on the given {@link EObject} taking
+ * into consideration some {@link ParameterValue}s
+ */
+ public final QueryResult evaluate(final Query query, final EObject context,
+ final List<ParameterValue> parameterValues) {
+ QueryResult queryResult = EFacetFactory.eINSTANCE.createQueryResult();
+ try {
+ queryResult.setSource(context);
+ queryResult.setResult(basicEvaluate(query, context, parameterValues));
+ } catch (Exception e) {
+ queryResult.setException(e);
+ }
+ return queryResult;
+ }
+
+ /**
+ * Evaluate the query on a set of models and model elements described by the context parameter.
+ *
+ * The query is evaluated on each contextually referred model element and on each element of a
+ * contextually referred model.
+ *
+ * @param queryContext
+ * The query evaluation context described by a QueryContext instance.
+ * @param parameterValues
+ * The query parameter values.
+ * @return A list of QueryResult (one per evaluation)
+ * @throws QueryException
+ */
+ public final synchronized List<QueryResult> evaluate(final Query query,
+ final QueryContext queryContext, final List<ParameterValue> parameterValues)
+ throws QueryException {
+ List<QueryResult> resultList = new ArrayList<QueryResult>();
+ IQueryEvaluator evaluator = QueryEvaluatorFactoryRegistry.INSTANCE.getEvaluatorFor(query);
+ try {
+ evaluator.startEvaluate();
+ for (EObject eObject : queryContext.getSelectedModelElements()) {
+ QueryResult queryResult = executeQuery(query, parameterValues, eObject, evaluator);
+ resultList.add(queryResult);
+ }
+ for (Resource resource : queryContext.getSelectedModels()) {
+ TreeIterator<EObject> treeIterator = resource.getAllContents();
+ while (treeIterator.hasNext()) {
+ EObject eObject = treeIterator.next();
+ QueryResult queryResult = executeQuery(query, parameterValues, eObject,
+ evaluator);
+ resultList.add(queryResult);
+ }
+ }
+ } finally {
+ evaluator.endEvaluate();
+ }
+ return resultList;
+ }
+
+ /**
+ * This method is used to evaluate the given {@link Query} on the given {@link EObject}
+ */
+ public final QueryResult evaluate(final Query query, final EObject eObject) {
+ QueryResult queryResult = evaluate(query, eObject, null);
+ return queryResult;
+ }
+
+ private final QueryResult executeQuery(final Query query,
+ final List<ParameterValue> parameterValues, final EObject eObject,
+ final IQueryEvaluator evaluator) {
+ QueryResult queryResult = EFacetFactory.eINSTANCE.createQueryResult();
+ queryResult.setSource(eObject);
+ try {
+ Object result = evaluateAndCheck(query, eObject, parameterValues, evaluator);
+ queryResult.setResult(result);
+ } catch (QueryException e) {
+ queryResult.setException(e);
+ }
+ return queryResult;
+ }
+
+ private final void checkResult(final Query query, final Object object,
+ final boolean checkResultType) throws QueryTypeCheckingException {
+ if (query.getUpperBound() > 1 || query.getUpperBound() == -1) {
+ if (!(object instanceof Collection<?>)) {
+ throw new QueryTypeCheckingException(
+ "A collection is expected as result. The result is: " //$NON-NLS-1$
+ + object + " (on " + toString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ for (Object collectionElement : (Collection<?>) object) {
+ if (checkResultType) {
+ if (!(query.getEType().isInstance(collectionElement))) {
+ QueryTypeCheckingException e = new QueryTypeCheckingException(
+ "Wrong result collection element type (" //$NON-NLS-1$
+ + query.getEType().getName() + " is expected): " //$NON-NLS-1$
+ + collectionElement + " (on " //$NON-NLS-1$
+ + toString() + ")"); //$NON-NLS-1$
+ throw e;
+ }
+ }
+ }
+ } else {
+ if (object instanceof Collection<?>) {
+ throw new QueryTypeCheckingException("A " //$NON-NLS-1$
+ + query.getEType().getName()
+ + " instance is expected as result. The result is: " //$NON-NLS-1$
+ + object + " (on " + toString() + ")"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ if (checkResultType) {
+ if (!(query.getEType().isInstance(object))) {
+ if (object != null) {
+ throw new QueryTypeCheckingException("Wrong result type: " //$NON-NLS-1$
+ + object.getClass().getName()
+ + " is returned while " //$NON-NLS-1$
+ + query.getEType().getInstanceClassName()
+ + " is expected." + " (on " + toString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ }
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EmfUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EmfUtils.java
new file mode 100644
index 00000000000..c43eb9f95b6
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/EmfUtils.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Mia-Software
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values.
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Grégoire Dupé (Mia-Software) - Bug 361612 - [Restructuring] New core for new version of the Facet metamodel
+ * Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
+ * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates
+ *******************************************************************************/
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.facet.efacet.core.internal.exception.UnmatchingExpectedTypeException;
+
+public final class EmfUtils {
+
+ private EmfUtils() {
+ //Must not be used
+ }
+
+ public static void checkAssignment(final Object value, final ETypedElement eTypedElement)
+ throws UnmatchingExpectedTypeException {
+ final String typedElementName = getTypeElementDescription(eTypedElement);
+ //Begin checking precondition
+ if (eTypedElement.getEType() == null) {
+ throw new IllegalArgumentException(typedElementName + " has a null type"); //$NON-NLS-1$
+ }
+ //End checking precondition
+ if (value == null && (eTypedElement.getLowerBound() > 0)) {
+ throw new IllegalArgumentException(
+ "The assigned value cannot be null for " + typedElementName + " because multiplicity is " + eTypedElement.getLowerBound() + ".." + eTypedElement.getUpperBound()); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ }
+ if (value != null) {
+ if (eTypedElement.getUpperBound() == 1) {
+ if (!eTypedElement.getEType().isInstance(value)) {
+ throw new IllegalArgumentException(
+ "Type mismatch for " + EcoreUtil.getURI(eTypedElement) + ": expected '" + eTypedElement.getEType().getName() + "' but got '" + value.getClass().getName() + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ } else { // expect a list for multiplicity-many
+ if (!(value instanceof List<?>)) {
+ throw new IllegalArgumentException("Type mismatch for " + typedElementName + "': expected a List because the parameter is multiplicity-many. But got a " + //$NON-NLS-1$ //$NON-NLS-2$
+ value.getClass().getName() + "'."); //$NON-NLS-1$
+ }
+ final List<?> argumentList = (List<?>) value;
+ try {
+ CastUtils.checkTypeOfAllListElements(argumentList, eTypedElement.getEType().getInstanceClass());
+ //FIXME What happens if we use a not generated meta-model ?
+ } catch (UnmatchingExpectedTypeException e) {
+ throw new UnmatchingExpectedTypeException(
+ "Type mismatch for an element of the list value " + typedElementName , e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private static String getTypeElementDescription(final ETypedElement eTypedElement) {
+ String containerName = ""; //$NON-NLS-1$
+ if (eTypedElement.eContainer() instanceof ENamedElement) {
+ final ENamedElement namedContainer = (ENamedElement) eTypedElement.eContainer();
+ containerName = "the " + namedContainer.eClass().getName() + " named '" + namedContainer.getName() + "'"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return "the " + eTypedElement.eClass().getName() + " named '" + eTypedElement.getName() + "' in " + containerName; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ public static Object ecoreInvoke(final EObject eObject, final EOperation operation, final Object... arguments) throws InvocationTargetException {
+ // delegate to Ecore
+ final BasicEList<Object> operationParams = new BasicEList<Object>();
+ for (Object param : arguments) {
+ operationParams.add(param);
+ }
+ return eObject.eInvoke(operation, operationParams);
+ }
+
+ public static <T> T checkAssignment(final EStructuralFeature eStructuralFeature, final Class<T> expectedType, final Object value)
+ throws UnmatchingExpectedTypeException {
+ if (eStructuralFeature.isMany() && expectedType != null) {
+ if (expectedType != Object.class
+ && !Collection.class.isAssignableFrom(expectedType)) {
+ throw new UnmatchingExpectedTypeException("The required eStructuralFeature is multi-valued, so expectedType must be a subtype of Collection."); //$NON-NLS-1$
+ }
+ if (!expectedType.isInstance(value)) {
+ throw new UnmatchingExpectedTypeException("The derived typed element did not evaluate to the expected type", Collection.class, value); //$NON-NLS-1$
+ }
+ }
+ return CastUtils.castToExpectedType(value, expectedType);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionImpl.java
new file mode 100644
index 00000000000..4d208326f51
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionImpl.java
@@ -0,0 +1,205 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 338813 - [EMF Facet Framework] basic Facet actions
+ * Nicolas Bros (Mia-Software) - Bug 361617 - Deprecation of APIs for the old Facet metamodels
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EParameter;
+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.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.Facet;
+import org.eclipse.emf.facet.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.core.IFacetAction;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.emf.facet.util.emf.core.ICatalogSetManager;
+import org.eclipse.emf.facet.util.emf.core.exception.InvalidFacetSetException;
+import org.eclipse.emf.facet.util.pde.core.internal.exported.BuildPropertiesUtils;
+
+/** @deprecated */
+@Deprecated
+public class FacetActionImpl implements IFacetAction {
+
+ public Facet createFacetInFacetSet(final FacetSet facetSet, final Facet facet,
+ final EditingDomain editingDomain) {
+
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+ if (facet.eResource() != null || facet.eContainer() != null) {
+ throw new IllegalArgumentException("The given Facet cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ // If the current editingDomain's resourceSet does not contain the facetSet resource, then
+ // we need to add it so that we can edit the facetSet
+ if (!editingDomain.getResourceSet().getResources().contains(facetSet.eResource())) {
+ editingDomain.getResourceSet().getResources().add(facetSet.eResource());
+ }
+
+ Command command = new AddCommand(editingDomain, facetSet,
+ EFacetPackage.eINSTANCE.getFacetSet_Facets(), facet);
+ editingDomain.getCommandStack().execute(command);
+ return facet;
+ }
+
+ public void addAttributeInFacet(final Facet facet, final FacetAttribute facetAttribute,
+ final EditingDomain editingDomain) {
+
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+ if (facetAttribute == null) {
+ throw new IllegalArgumentException("The given FacetAttribute cannot be null"); //$NON-NLS-1$
+ }
+ if (facetAttribute.eResource() != null || facetAttribute.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetAttribute cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ Command command = new AddCommand(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), facetAttribute);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public void addReferenceInFacet(final Facet facet, final FacetReference facetReference,
+ final EditingDomain editingDomain) {
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null."); //$NON-NLS-1$
+ }
+ if (facetReference == null) {
+ throw new IllegalArgumentException("The given FacetReference cannot be null"); //$NON-NLS-1$
+ }
+ if (facetReference.eResource() != null || facetReference.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetReference cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null."); //$NON-NLS-1$
+ }
+
+ Command command = new AddCommand(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), facetReference);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public void addOperationInFacet(final Facet facet, final FacetOperation facetOperation,
+ final EditingDomain editingDomain) {
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+ if (facetOperation == null) {
+ throw new IllegalArgumentException("The given FacetOperation cannot be null"); //$NON-NLS-1$
+ }
+ if (facetOperation.eResource() != null || facetOperation.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetOperation cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+
+ Command command = new AddCommand(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), facetOperation);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public void setFacetSetNsUri(final FacetSet facetSet, final String nsUri,
+ final EditingDomain editingDomain) {
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ Command command = new SetCommand(editingDomain, facetSet,
+ EcorePackage.eINSTANCE.getEPackage_NsURI(), nsUri);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public void addParameterInOperation(final FacetOperation operation, final EParameter parameter,
+ final EditingDomain editingDomain) {
+ if (operation == null) {
+ throw new IllegalArgumentException("The given FacetOperation cannot be null"); //$NON-NLS-1$
+ }
+ if (parameter == null) {
+ throw new IllegalArgumentException("The given EParameter cannot be null"); //$NON-NLS-1$
+ }
+ if (parameter.eResource() != null || parameter.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given EParameter cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ Command command = new AddCommand(editingDomain, operation,
+ EcorePackage.eINSTANCE.getEOperation_EParameters(), parameter);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public void createFacetSet(final FacetSet facetSet, final IFile file) throws IOException,
+ InvalidFacetSetException {
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ if (file == null) {
+ throw new IllegalArgumentException("The given IFile cannot be null"); //$NON-NLS-1$
+ }
+ if (file.exists()) {
+ throw new IllegalArgumentException("The given IFile already exists"); //$NON-NLS-1$
+ }
+
+ // Create a resource set
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the facetSet the resource contents.
+ resource.getContents().add(facetSet);
+
+ // Save the contents of the resource to the file system.
+ resource.save(null);
+
+ try {
+ BuildPropertiesUtils.addToBuild(file);
+ } catch (Exception e) {
+ Logger.logError(e, "Error adding file " + file.getFullPath() //$NON-NLS-1$
+ + " to the build.properties", Activator.getDefault()); //$NON-NLS-1$
+ }
+ ICatalogSetManager.INSTANCE.registerModelDeclaration(file);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActions2Impl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActions2Impl.java
new file mode 100644
index 00000000000..a45bc2e9ab8
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActions2Impl.java
@@ -0,0 +1,231 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Guyomar (Mia-Software) - Bug 338813 - [EMF Facet Framework] basic Facet actions
+ * Nicolas Bros (Mia-Software) - Bug 361612 - New core for new version of the Facet metamodel
+ * Gregoire Dupe (Mia-Software) - Bug 362087 - [Deprecated] org.eclipse.emf.facet.util.emf.core.ICatalogSetManager
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EParameter;
+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.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.internal.incubatingapi.IFacetActions2;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.emf.facet.util.emf.core.ICatalogSetManager2;
+import org.eclipse.emf.facet.util.emf.core.exception.InvalidFacetSetException;
+import org.eclipse.emf.facet.util.pde.core.internal.exported.BuildPropertiesUtils;
+
+public class FacetActions2Impl implements IFacetActions2 {
+
+ public void saveFacetSet(final FacetSet facetSet, final IFile file) throws IOException,
+ InvalidFacetSetException {
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ if (file == null) {
+ throw new IllegalArgumentException("The given IFile cannot be null"); //$NON-NLS-1$
+ }
+ if (file.exists()) {
+ throw new IllegalArgumentException("The given IFile already exists"); //$NON-NLS-1$
+ }
+
+ // Create a resource set
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the facetSet the resource contents.
+ resource.getContents().add(facetSet);
+
+ // Save the contents of the resource to the file system.
+ resource.save(null);
+
+ try {
+ BuildPropertiesUtils.addToBuild(file);
+ } catch (Exception e) {
+ Logger.logError(e, "Error adding file " + file.getFullPath() //$NON-NLS-1$
+ + " to the build.properties", Activator.getDefault()); //$NON-NLS-1$
+ }
+ ICatalogSetManager2.INSTANCE.registerModelDeclaration(file);
+ }
+
+ public Facet createFacetInFacetSet(final FacetSet facetSet, final Facet facet,
+ final EditingDomain editingDomain) {
+ Command command = createCreateFacetInFacetSetCommand(facetSet, facet, editingDomain);
+ // If the current editingDomain's resourceSet does not contain the facetSet resource, then
+ // we need to add it so that we can edit the facetSet
+ if (!editingDomain.getResourceSet().getResources().contains(facetSet.eResource())) {
+ editingDomain.getResourceSet().getResources().add(facetSet.eResource());
+ }
+ editingDomain.getCommandStack().execute(command);
+ return facet;
+ }
+
+ public Command createCreateFacetInFacetSetCommand(final FacetSet facetSet, final Facet facet,
+ final EditingDomain editingDomain) {
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+ if (facet.eResource() != null || facet.eContainer() != null) {
+ throw new IllegalArgumentException("The given Facet cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(editingDomain, facetSet,
+ EcorePackage.eINSTANCE.getEPackage_EClassifiers(), facet);
+ }
+
+ public void addAttributeInFacet(final Facet facet, final FacetAttribute facetAttribute,
+ final EditingDomain editingDomain) {
+ Command command = createAddAttributeInFacetCommand(facet, facetAttribute, editingDomain);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public Command createAddAttributeInFacetCommand(final Facet facet,
+ final FacetAttribute facetAttribute, final EditingDomain editingDomain) {
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+ if (facetAttribute == null) {
+ throw new IllegalArgumentException("The given FacetAttribute cannot be null"); //$NON-NLS-1$
+ }
+ if (facetAttribute.eResource() != null || facetAttribute.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetAttribute cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), facetAttribute);
+ }
+
+ public void addReferenceInFacet(final Facet facet, final FacetReference facetReference,
+ final EditingDomain editingDomain) {
+ Command command = createAddReferenceInFacetCommand(facet, facetReference, editingDomain);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public Command createAddReferenceInFacetCommand(final Facet facet,
+ final FacetReference facetReference, final EditingDomain editingDomain) {
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null."); //$NON-NLS-1$
+ }
+ if (facetReference == null) {
+ throw new IllegalArgumentException("The given FacetReference cannot be null"); //$NON-NLS-1$
+ }
+ if (facetReference.eResource() != null || facetReference.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetReference cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null."); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), facetReference);
+ }
+
+ public void addOperationInFacet(final Facet facet, final FacetOperation facetOperation,
+ final EditingDomain editingDomain) {
+ Command command = createAddOperationInFacetCommand(facet, facetOperation, editingDomain);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public Command createAddOperationInFacetCommand(final Facet facet,
+ final FacetOperation facetOperation, final EditingDomain editingDomain) {
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+ if (facetOperation == null) {
+ throw new IllegalArgumentException("The given FacetOperation cannot be null"); //$NON-NLS-1$
+ }
+ if (facetOperation.eResource() != null || facetOperation.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given FacetOperation cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (facet == null) {
+ throw new IllegalArgumentException("The given Facet cannot be null"); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_FacetOperations(), facetOperation);
+ }
+
+ public void addParameterInOperation(final FacetOperation operation, final EParameter parameter,
+ final EditingDomain editingDomain) {
+ Command command = createAddParameterInOperationCommand(operation, parameter, editingDomain);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public Command createAddParameterInOperationCommand(final FacetOperation operation,
+ final EParameter parameter, final EditingDomain editingDomain) {
+ if (operation == null) {
+ throw new IllegalArgumentException("The given FacetOperation cannot be null"); //$NON-NLS-1$
+ }
+ if (parameter == null) {
+ throw new IllegalArgumentException("The given EParameter cannot be null"); //$NON-NLS-1$
+ }
+ if (parameter.eResource() != null || parameter.eContainer() != null) {
+ throw new IllegalArgumentException(
+ "The given EParameter cannot be contained by a resource"); //$NON-NLS-1$
+ }
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(editingDomain, operation,
+ EcorePackage.eINSTANCE.getEOperation_EParameters(), parameter);
+ }
+
+ public void setFacetSetNsUri(final FacetSet facetSet, final String nsUri,
+ final EditingDomain editingDomain) {
+ Command command = createSetFacetSetNsUriCommand(facetSet, nsUri, editingDomain);
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ public Command createSetFacetSetNsUriCommand(final FacetSet facetSet, final String nsUri,
+ final EditingDomain editingDomain) {
+ if (editingDomain == null) {
+ throw new IllegalArgumentException("The given EditingDomain cannot be null"); //$NON-NLS-1$
+ }
+ if (facetSet == null) {
+ throw new IllegalArgumentException("The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ return SetCommand.create(editingDomain, facetSet,
+ EcorePackage.eINSTANCE.getEPackage_NsURI(), nsUri);
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionsImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionsImpl.java
new file mode 100644
index 00000000000..cf6a4bbf250
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetActionsImpl.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.facet.efacet.core.IFacetActions;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.emf.facet.util.core.internal.Activator;
+import org.eclipse.emf.facet.util.emf.core.ICatalogSetManager2;
+import org.eclipse.emf.facet.util.emf.core.ICatalogSetManagerFactory;
+import org.eclipse.emf.facet.util.emf.core.exception.InvalidFacetSetException;
+import org.eclipse.emf.facet.util.pde.core.internal.exported.BuildPropertiesUtils;
+
+/**
+ * Concrete implementation of {@link IFacetActions}.
+ */
+public class FacetActionsImpl implements IFacetActions {
+
+ public void saveFacetSet(final FacetSet facetSet, final IFile file)
+ throws IOException, InvalidFacetSetException {
+ if (facetSet == null) {
+ throw new IllegalArgumentException(
+ "The given FacetSet cannot be null"); //$NON-NLS-1$
+ }
+ if (file == null) {
+ throw new IllegalArgumentException("The given IFile cannot be null"); //$NON-NLS-1$
+ }
+ if (file.exists()) {
+ throw new IllegalArgumentException("The given IFile already exists"); //$NON-NLS-1$
+ }
+
+ // Create a resource set
+ final ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ final URI fileURI = URI.createPlatformResourceURI(file.getFullPath()
+ .toString(), true);
+
+ // Create a resource for this file.
+ final Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the facetSet the resource contents.
+ resource.getContents().add(facetSet);
+
+ // Save the contents of the resource to the file system.
+ resource.save(null);
+
+ try {
+ BuildPropertiesUtils.addToBuild(file);
+ } catch (final Exception e) {
+ Logger.logError(e, "Error adding file " + file.getFullPath() //$NON-NLS-1$
+ + " to the build.properties", Activator.getDefault()); //$NON-NLS-1$
+ }
+
+ final ICatalogSetManager2 catalogSetManager = ICatalogSetManagerFactory.DEFAULT
+ .createICatalogSetManager(resourceSet);
+ catalogSetManager.registerModelDeclaration(file);
+
+ // ICatalogSetManager.INSTANCE.registerModelDeclaration(file);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCatalogManagerFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCatalogManagerFactory.java
new file mode 100644
index 00000000000..e83233c3a4c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCatalogManagerFactory.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.efacet.core.IFacetSetCatalogManager;
+import org.eclipse.emf.facet.efacet.core.IFacetSetCatalogManagerFactory;
+import org.eclipse.emf.facet.util.emf.core.ICatalogSetManagerFactory;
+
+public class FacetCatalogManagerFactory implements IFacetSetCatalogManagerFactory {
+
+ public IFacetSetCatalogManager getOrCreateFacetSetCatalogManager(
+ final ResourceSet resourceSet) {
+ return ICatalogSetManagerFactory.DEFAULT
+ .createICatalogSetManager(resourceSet)
+ .getCatalogManagerByType(IFacetSetCatalogManager.class)
+ .get(0);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryFactory.java
new file mode 100644
index 00000000000..1e598391c9c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryFactory.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactoryFactory;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactory;
+
+public class FacetCommandFactoryFactory implements IFacetCommandFactoryFactory {
+
+ public IFacetCommandFactory createCommandFactory(
+ final EditingDomain editingDomain) {
+ return new FacetCommandFactoryImpl(editingDomain);
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryImpl.java
new file mode 100644
index 00000000000..9a428f7f589
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/src/org/eclipse/emf/facet/efacet/core/internal/FacetCommandFactoryImpl.java
@@ -0,0 +1,511 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alban MĂ©nager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ * Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.core.internal;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.efacet.core.IFacetCommandFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.util.emf.core.command.EmfCommandUtils;
+
+/**
+ * Concrete implementation of {@link IFacetCommandFactory}.
+ */
+public class FacetCommandFactoryImpl implements IFacetCommandFactory {
+
+ private static final String VALUE_NOT_NULL = "The given value cannot be null"; //$NON-NLS-1$
+ private static final String PARENT_NOT_NULL = "The given parent cannot be null"; //$NON-NLS-1$
+ private static final Object NAME = "name"; //$NON-NLS-1$
+ private static final Object LOWER_BOUND = "lowerBound"; //$NON-NLS-1$
+ private static final Object UPPER_BOUND = "upperBound"; //$NON-NLS-1$
+ private static final Object VOLATILE = "volatile"; //$NON-NLS-1$
+ private static final Object CHANGEABLE = "changeable"; //$NON-NLS-1$
+ private static final Object DERIVED = "derived"; //$NON-NLS-1$
+ private static final Object TRANSIENT = "transient"; //$NON-NLS-1$
+ private static final Object ORDERED = "ordered"; //$NON-NLS-1$
+ private static final Object UNIQUE = "unique"; //$NON-NLS-1$
+ private final EditingDomain editingDomain;
+
+ public FacetCommandFactoryImpl(final EditingDomain editingDomain) {
+ this.editingDomain = editingDomain;
+ }
+
+ /**
+ * Create an {@link AddCommand} to add the element to the owner.
+ *
+ * @param owner
+ * the owner.
+ * @param element
+ * the element to add.
+ * @return the command.
+ */
+ private Command createAddCommand(final Object owner, final Object element) {
+
+ if (owner == null) {
+ throw new IllegalArgumentException("The given owner cannot be null"); //$NON-NLS-1$
+ }
+
+ if (element == null) {
+ throw new IllegalArgumentException(
+ "The given element cannot be null"); //$NON-NLS-1$
+ }
+
+ return AddCommand.create(this.editingDomain, owner,
+ getEStructuralFeature(element), element);
+ }
+
+ /**
+ * Create an {@link SetCommand} to add the element to the owner.
+ *
+ * @param initialObject
+ * the owner.
+ * @param newObject
+ * the element to add.
+ * @return the command.
+ */
+ public Command createSetCommand(final Object initialObject,
+ final Object feature, final Object newValue) {
+
+ if (initialObject == null) {
+ throw new IllegalArgumentException("The given owner cannot be null"); //$NON-NLS-1$
+ }
+
+ if (feature == null) {
+ throw new IllegalArgumentException(
+ "The given feature cannot be null"); //$NON-NLS-1$
+ }
+
+ if (newValue == null) {
+ throw new IllegalArgumentException(
+ "The given newValue cannot be null"); //$NON-NLS-1$
+ }
+
+ return SetCommand.create(this.editingDomain, initialObject, feature,
+ newValue);
+ }
+
+ /**
+ * Return the {@link EStructuralFeature} for a given element.
+ *
+ * @param element
+ * the element.
+ * @return the eStructuralFeature for the element.
+ */
+ private static EStructuralFeature getEStructuralFeature(final Object element) {
+ EStructuralFeature result = null;
+ if (element instanceof FacetSet) {
+ result = EcorePackage.eINSTANCE.getEPackage_ESubpackages();
+ } else if (element instanceof Facet) {
+ result = EcorePackage.eINSTANCE.getEPackage_EClassifiers();
+ } else if ((element instanceof FacetAttribute)
+ || (element instanceof FacetReference)) {
+ result = EFacetPackage.eINSTANCE.getFacet_FacetElements();
+ } else if (element instanceof FacetOperation) {
+ result = EFacetPackage.eINSTANCE.getFacet_FacetOperations();
+ }
+ return result;
+
+ }
+
+ public Command createFacetSetInFacetSetCommand(final FacetSet owner,
+ final FacetSet facetSet) {
+ return createAddCommand(owner, facetSet);
+ }
+
+ public Command createFacetInFacetSetCommand(final FacetSet parent,
+ final Facet facet) {
+ return createAddCommand(parent, facet);
+ }
+
+ public Command createEditFacetStructuralFeatureCommand(
+ final DerivedTypedElement feature, final Facet container,
+ final String name, final int lowerBound, final int upperBound,
+ final EClassifier type, final boolean ordered,
+ final boolean unique, final Query query, final boolean volatilee,
+ final boolean change, final boolean derived,
+ final boolean transientt) {
+ if (feature == null) {
+ throw new IllegalArgumentException(
+ "The parameter facetOperation must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ if (feature.eContainer() != container) {
+ final Command command = new AddCommand(this.editingDomain,
+ container,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(), feature);
+ commands.add(command);
+ }
+ if (feature instanceof EStructuralFeature) {
+ final EStructuralFeature structuralFeature = (EStructuralFeature) feature;
+ if (structuralFeature.isVolatile() != volatilee) {
+ final Command command = new SetCommand(this.editingDomain,
+ structuralFeature,
+ EcorePackage.eINSTANCE.getEStructuralFeature_Volatile(),
+ Boolean.valueOf(volatilee));
+ commands.add(command);
+ }
+ if (structuralFeature.isChangeable() != change) {
+ final Command command = new SetCommand(this.editingDomain,
+ structuralFeature,
+ EcorePackage.eINSTANCE
+ .getEStructuralFeature_Changeable(),
+ Boolean.valueOf(change));
+ commands.add(command);
+ }
+ if (structuralFeature.isDerived() != derived) {
+ final Command command = new SetCommand(this.editingDomain,
+ structuralFeature,
+ EcorePackage.eINSTANCE.getEStructuralFeature_Derived(),
+ Boolean.valueOf(ordered));
+ commands.add(command);
+ }
+ if (structuralFeature.isTransient() != transientt) {
+ final Command command = new SetCommand(this.editingDomain,
+ structuralFeature,
+ EcorePackage.eINSTANCE
+ .getEStructuralFeature_Transient(),
+ Boolean.valueOf(unique));
+ commands.add(command);
+ }
+ }
+ commands.add(createEditDerivedTypeElementCommand(feature,
+ name, lowerBound, upperBound, type, ordered, unique, query));
+ return EmfCommandUtils.createResult(commands,
+ "edit facet structural feature"); //$NON-NLS-1$
+ }
+
+ public Command createAddOperationInFacetCommand(final Facet parent,
+ final FacetOperation facetOperation) {
+ return createAddCommand(parent, facetOperation);
+ }
+
+ public Command createAddReferenceInFacetCommand(final Facet parent,
+ final FacetReference facetReference) {
+ return createAddCommand(parent, facetReference);
+ }
+
+ public Command createAddParameterInOperationCommand(
+ final FacetOperation parent, final EParameter opParameter) {
+ return createAddCommand(parent, opParameter);
+ }
+
+ public Command createChangeOwnerCommand(final Object element,
+ final Object newOwner) {
+ if (element == null) {
+ throw new IllegalArgumentException(
+ "The given element cannot be null"); //$NON-NLS-1$
+ }
+ if (newOwner == null) {
+ throw new IllegalArgumentException(
+ "The given element cannot be null"); //$NON-NLS-1$
+ }
+ return createAddCommand(newOwner, element);
+ }
+
+ public Command createEditFacetSetCommand(final FacetSet editedFacetSet,
+ final FacetSet container, final String name) {
+ if (editedFacetSet == null) {
+ throw new IllegalArgumentException(
+ "The parameter 'editedFacetSet' must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ commands.add(createEditENamedElementcommand(editedFacetSet, name));
+ if (editedFacetSet.eContainer() != container) {
+ final Command command = new AddCommand(this.editingDomain,
+ container,
+ EcorePackage.eINSTANCE.getEPackage_ESubpackages(),
+ editedFacetSet);
+ commands.add(command);
+ }
+ return EmfCommandUtils.createResult(commands, "Edit FacetSet"); //$NON-NLS-1$
+ }
+
+ public Command createEditFacetCommand(final Facet facet,
+ final FacetSet container, final String name,
+ final ETypedElement conformance, final EClass extendMetaclass,
+ final FacetSet extendedFacetSet) {
+ final List<Command> commands = new ArrayList<Command>();
+ commands.add(createEditENamedElementcommand(facet, name));
+ if (facet.eContainer() != container) {
+ final Command command = new AddCommand(this.editingDomain,
+ container,
+ EcorePackage.eINSTANCE.getEPackage_EClassifiers(), facet);
+ commands.add(command);
+ }
+ if (facet.getConformanceTypedElement() != conformance) {
+ final Command command = new SetCommand(this.editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_ConformanceTypedElement(),
+ conformance);
+ commands.add(command);
+ }
+ if (extendedFacetSet != null
+ && (facet.getExtendedFacets().isEmpty() || facet
+ .getExtendedFacets().get(0) != extendedFacetSet)) {
+ final Command command = new SetCommand(this.editingDomain,
+ facet,
+ EFacetPackage.eINSTANCE.getFacet_ExtendedFacets(),
+ Collections.singletonList(extendedFacetSet));
+ commands.add(command);
+ }
+ if (facet.getExtendedMetaclass() != extendMetaclass) {
+ final Command command = new SetCommand(this.editingDomain, facet,
+ EFacetPackage.eINSTANCE.getFacet_ExtendedMetaclass(),
+ extendMetaclass);
+ commands.add(command);
+ }
+ return EmfCommandUtils.createResult(commands, "Edit Facet"); //$NON-NLS-1$
+ }
+
+ private Command createEditENamedElementcommand(
+ final ENamedElement namedElement, final String name) {
+ if (namedElement == null) {
+ throw new IllegalArgumentException(
+ "The parameter 'editedFacetSet' must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ if (namedElement.getName() != name) {
+ final Command command = new SetCommand(this.editingDomain,
+ namedElement,
+ EcorePackage.eINSTANCE.getENamedElement_Name(), name);
+ commands.add(command);
+ }
+ return EmfCommandUtils.createResult(commands, "Edit NamedElement"); //$NON-NLS-1$
+ }
+
+ public Command createSetFacetAttributeCommand(final Facet initialContainer,
+ final FacetAttribute initialElement, final FacetAttribute newElement) {
+ if (initialElement == null) {
+ throw new IllegalArgumentException(PARENT_NOT_NULL);
+ }
+ if (newElement == null) {
+ throw new IllegalArgumentException(VALUE_NOT_NULL);
+ }
+ final CompoundCommand commands = new CompoundCommand();
+ final List<EAttribute> facetAttributes = EFacetPackage.eINSTANCE
+ .getFacetAttribute().getEAllAttributes();
+ setEStructuralFeatureAttributes(initialElement, newElement, commands,
+ facetAttributes);
+ setETypedElementAttributes(initialElement, newElement, commands,
+ facetAttributes);
+ final Command changeOwner = createChangeOwnerCommand(newElement,
+ initialContainer);
+ commands.append(changeOwner);
+ return commands;
+ }
+
+ public Command createSetFacetReferenceCommand(final Facet initialContainer,
+ final FacetReference initialElement, final FacetReference newElement) {
+ if (initialElement == null) {
+ throw new IllegalArgumentException(PARENT_NOT_NULL);
+ }
+ if (newElement == null) {
+ throw new IllegalArgumentException(VALUE_NOT_NULL);
+ }
+ final CompoundCommand commands = new CompoundCommand();
+ final List<EAttribute> facetReferences = EFacetPackage.eINSTANCE
+ .getFacetReference().getEAllAttributes();
+ setEStructuralFeatureAttributes(initialElement, newElement, commands,
+ facetReferences);
+ setETypedElementAttributes(initialElement, newElement, commands,
+ facetReferences);
+ final Command changeOwner = createChangeOwnerCommand(newElement, initialContainer);
+ commands.append(changeOwner);
+ return commands;
+ }
+
+ public Command createEditFacetOperationCommand(
+ final FacetOperation facetOperation, final Facet container,
+ final String name, final int lowerBound, final int upperBound,
+ final EClassifier type, final boolean ordered,
+ final boolean unique, final Query query) {
+ if (facetOperation == null) {
+ throw new IllegalArgumentException(
+ "The parameter facetOperation must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ if (facetOperation.eContainer() != container) {
+ final Command command = new AddCommand(this.editingDomain,
+ container,
+ EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
+ facetOperation);
+ commands.add(command);
+ }
+ commands.add(createEditDerivedTypeElementCommand(facetOperation, name,
+ lowerBound, upperBound, type, ordered, unique, query));
+ return EmfCommandUtils.createResult(commands, "Edit facet operation"); //$NON-NLS-1$
+ }
+
+ private Command createEditDerivedTypeElementCommand(
+ final DerivedTypedElement dte, final String name,
+ final int lowerBound, final int upperBound, final EClassifier type,
+ final boolean ordered, final boolean unique, final Query query) {
+ if (dte == null) {
+ throw new IllegalArgumentException(
+ "The parameter facetOperation must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ commands.add(createEditETypedElementCommand(dte, name, lowerBound,
+ upperBound, type, ordered, unique));
+ if (dte.getQuery() != query) {
+ final Command command = new SetCommand(this.editingDomain, dte,
+ EFacetPackage.eINSTANCE.getDerivedTypedElement_Query(),
+ query);
+ commands.add(command);
+ }
+ return EmfCommandUtils.createResult(commands,
+ "Edit derived typed element"); //$NON-NLS-1$
+ }
+
+ private Command createEditETypedElementCommand(
+ final ETypedElement typedElement, final String name,
+ final int lowerBound, final int upperBound, final EClassifier type,
+ final boolean ordered, final boolean unique) {
+ final List<Command> commands = new ArrayList<Command>();
+ commands.add(createEditENamedElementcommand(typedElement, name));
+ if (typedElement.getLowerBound() != lowerBound) {
+ final Command command = new SetCommand(this.editingDomain,
+ typedElement,
+ EcorePackage.eINSTANCE.getETypedElement_LowerBound(),
+ Integer.valueOf(lowerBound));
+ commands.add(command);
+ }
+ if (typedElement.getUpperBound() != upperBound) {
+ final Command command = new SetCommand(this.editingDomain,
+ typedElement,
+ EcorePackage.eINSTANCE.getETypedElement_LowerBound(),
+ Integer.valueOf(upperBound));
+ commands.add(command);
+ }
+ if (typedElement.isOrdered() != ordered) {
+ final Command command = new SetCommand(this.editingDomain,
+ typedElement,
+ EcorePackage.eINSTANCE.getETypedElement_Ordered(),
+ Boolean.valueOf(ordered));
+ commands.add(command);
+ }
+ if (typedElement.isUnique() != unique) {
+ final Command command = new SetCommand(this.editingDomain,
+ typedElement,
+ EcorePackage.eINSTANCE.getETypedElement_Ordered(),
+ Boolean.valueOf(unique));
+ commands.add(command);
+ }
+ if (typedElement.getEType() != type) {
+ final Command command = new SetCommand(this.editingDomain,
+ typedElement,
+ EcorePackage.eINSTANCE.getETypedElement_EType(), type);
+ commands.add(command);
+ }
+ return EmfCommandUtils.createResult(commands, "Edit ETypedElement"); //$NON-NLS-1$
+ }
+
+ public Command createEditOperationParameterCommand(
+ final EParameter parameter, final FacetOperation facetOperation,
+ final String name, final int lowerBound, final int upperBound,
+ final EClassifier type, final boolean ordered, final boolean unique) {
+ if (parameter == null) {
+ throw new IllegalArgumentException(
+ "The parameter parameter must not be null"); //$NON-NLS-1$
+ }
+ final List<Command> commands = new ArrayList<Command>();
+ commands.add(createEditETypedElementCommand(parameter, name,
+ lowerBound, upperBound, type, ordered, unique));
+ return EmfCommandUtils.createResult(commands,
+ "Edit operation parameter"); //$NON-NLS-1$
+ }
+
+ private void setEStructuralFeatureAttributes(
+ final EStructuralFeature initialElement,
+ final EStructuralFeature newElement,
+ final CompoundCommand commands,
+ final List<EAttribute> facetOperations) {
+ for (final EAttribute attribute : facetOperations) {
+ if (attribute.getName().equals(TRANSIENT)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isTransient())));
+ }
+ if (attribute.getName().equals(VOLATILE)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isVolatile())));
+ }
+ if (attribute.getName().equals(CHANGEABLE)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isChangeable())));
+ }
+ if (attribute.getName().equals(DERIVED)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isDerived())));
+ }
+ }
+ }
+
+ private void setETypedElementAttributes(final ETypedElement initialElement,
+ final ETypedElement newElement, final CompoundCommand commands,
+ final List<EAttribute> facetOperations) {
+ for (final EAttribute attribute : facetOperations) {
+ if (attribute.getName().equals(NAME)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ newElement.getName()));
+ }
+ if (attribute.getName().equals(LOWER_BOUND)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Integer.valueOf(newElement.getLowerBound())));
+ }
+ if (attribute.getName().equals(UPPER_BOUND)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Integer.valueOf(newElement.getUpperBound())));
+ }
+ if (attribute.getName().equals(ORDERED)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isOrdered())));
+ }
+ if (attribute.getName().equals(UNIQUE)) {
+ commands.append(createSetCommand(initialElement, attribute,
+ Boolean.valueOf(newElement.isUnique())));
+ }
+ }
+ }
+
+
+ public Command createEditFacetOperationCommand(
+ final DerivedTypedElement dte, final Facet facetContainer,
+ final String name, final int lowerBound, final int upperBound,
+ final EClassifier type, final boolean ordered,
+ final boolean unique, final