Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-11-03 17:21:40 -0500
committerChristian W. Damus2014-11-06 10:23:38 -0500
commitd3603f98fc66b59b7991839b4a472097e3030aca (patch)
treea9211fcc09f463081c3940a230ee8b7dc58918e6
parent6a3bb4e7260aa46db59f6d4c048f63b82fd84b9d (diff)
downloadorg.eclipse.papyrus-d3603f98fc66b59b7991839b4a472097e3030aca.tar.gz
org.eclipse.papyrus-d3603f98fc66b59b7991839b4a472097e3030aca.tar.xz
org.eclipse.papyrus-d3603f98fc66b59b7991839b4a472097e3030aca.zip
399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399859 Externalize the UI strings in the control-mode plug-in. (+57 squashed commits) Squashed commits: [31a95fd] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Support basic stereotype repair use cases in decorator model resources. ---- [3eaa4ad] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Improve re-application of externalized profiles for migration scenarios, doing away with hacky internalize and re-externalize steps that make a mess of the ordering of stereotype applications in the resource contents. ---- [fa20519] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Complete the copyright updates. ---- [5af536d] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Pluggable profile-application delegate API makes the private AppliedProfilesProvider redundant. ---- [b1e7f68] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Further copyright updates. ---- [ed0788d] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Now that the required UML2 API is available we can remove work-arounds for access to custom profile- and stereotype-application helpers. ---- [b262c2c] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Fix copyright headers. ---- [c4f04a5] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Support for migration of externally applied profiles to a new version. ---- [1892e18] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Additional slightly less trivial test cases for control-mode refactoring. ---- [7e530bd] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Don't create eCrossReferences() lists that compute and cache derived references that don't need refactoring. ---- [a35a57e] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files The undo of control refactoring for unloaded resources needs the same split treatment as for uncontrol. ---- [83249b2] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Automated tests for control-mode participant for refactoring of decorator models. ---- [d4a5149] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Fixes undo/redo of the uncontrolled refactoring for unloaded decorator models, which when undoing would find that the base uncontrol's undo hadn't yet restored the sub-unit resource in which we need to resolve referenced objects. ---- [46f4998] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Fixes to the automatic saving of decorator-model refactoring in (un)control command: - improve the determination of the editor to save (if any) - ensure that we only try to run the save runnable in the workbench window if on the UI thread ---- [1e65796] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Only prompt the user about save requirement if the control action was UI-initiated. Duh. ---- [75ea465] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Initial support for refactoring of currently loaded and unloaded decorator models that apply profiles directly or indirectly to the packages being controlled. ---- [71dfab4] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Fix errors in Javadocs and allow the control command to re-create a resource that the resource set had attempted to load for proxy resolution but failed because it doesn't exist. ---- [45fe94e] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Packages must also inherit externally applied profiles from their nesting package chain. ---- [24428c1] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Refresh the property sheet for the selected package after externalizing profiles to ensure that the "Applications" tab is showing. ---- [4763809">4763809] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Replace "Decorator Model" terminology in the UI with simply "Profile Application". ---- [77c00fb] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Remember the user's last auto-prompt load selections for initial selection on next open of the same resource. ---- [651fe70] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Improve JUnit test coverage of core plug-in. ---- [f2d5e7a] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Add an action in the Decorators property tab for packages to duplicate a loaded or unloaded decorator model with support for filtering out certain profile applications. ---- [37eb425] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Fix failure to refresh diagram for CSS styles affected by loading a decorator model the first time (and ensure all subsequent, also). ---- [1d62d00] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Fix problem in refreshing decorator model names in the Decorators property tab. Fix broken "Don't show this again" options in the load-decorator-models wizard. ---- [8ad5bd0] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Option to suppress prompt to unload conflicting decorator models in the Decorator property tab for packages and instead just automatically unload them (supporting quick switch use case). ---- [dde50a3] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Do not confuse users by showing the "decorator models available" icon decoration in Model Explorer on models that are decorated by the decorator model that the user opened in the editor. Only show the icon for referenced ("library") models that are reachable from such models. ---- [a82eb1b] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Improve liveness of action enablement and other tasks (esp. on the UI thread) that depend on the decorator model index. Implement a general-purpose Jobs-based ListenableFuture to support reporting blocked UI tasks in the blocked-jobs dialog. A few more rename refactorings in the API. Improve JUnit test coverage (and fix problems found by new tests). ---- [1cdaa01] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Implement Decorators property tab for packages that have decorator models, to provide easy access to loading and unloading them. ---- [de1cc1c] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Rationalize the handling of empty decorator models by prompting to delete and deleting all Papyrus model member resources in case of deletion. ---- [9bb18ac] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Never prompt to load additional decorator models when opening a decorator model, even if the user model that it decorates has more decorators available and the preference to auto-prompt is enabled. ---- [b1e3315] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Promote the Workspace Model Index and any-root-namespace content type describer APIs to the infra layer. ---- [f708155] 399859: [Decorator Models] Papyrus shall enable to manage profile applications in separate files Ensure responsiveness of label decorators. Apply label decorations to workspace resources in Project Explorer that are decorator models. ---- [4379197">4379197] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files WORKAROUNDS for absence of the required new UML API until it becomes available. ---- [68db5f0] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files WORKAROUNDS for absence of the required new UML API until it becomes available. ---- [0bf4163] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Add missing dependency information to top POMs. ---- [04d0935] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Add new plug-ins to top POMs. ---- [d4346cf] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Releng integration. ---- [40cfc0d] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Fix further refresh issues in diagrams when loading decorator models. When existing stereotype applications are loaded, they won't emit SET notifications for the base_Xyz references. Instead, they eventually emit RESOLVE notifications when their base reference proxies are resolved. ---- [f393d19] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Further API refactorings for 'decorator model' terminology. ---- [a3e9dd4] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Only prompt to load decorator models if opening in an editor. ---- [38885bc] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Refactor for 'decorator model' terminology and move the plug-ins into the main source tree. ---- [63c305e] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Various usability enhancements: - label decorators in Model Explorer and applied profiles in package properties indicating source profile externalization model names - prevent conflicts in externalization of profile applications into existing resources - never present profile application resources as available that conflict with native profile applications - revert ModelSet save change that breaks initialization of model from existing UML resource ---- [c1bb42b] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Profile application externalization wizard enhancements: - remember last file extension entered by the user (in case more than just .uml) - let user specify the model name, when creating a new file - verify that when adding to an existing file, it's a profile application model - include the profile application model name in the index ---- [4d1169b] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Enforce uniqueness of profile applications: prevent loading of multiple external profile applications that apply the same profile to the same package. ---- [ac15898] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Require saving dirty profile-application resources before unloading them. ---- [9ad9b0f] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Ensure that PapyrusListeners see changes in profile-application resources as well as the user-model resources. Fix the PapyrusStereotypeListener to handle unloading of a resource containing stereotype applications to interpret the stereotypes as being unapplied. ---- [4c52edd] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Handle problems in (re)building the workspace model index, add a listener protocol, and make it independent of the UML layer. ---- [402c77c] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Add a label decorator (just a placeholder icon for now) for models that have available unloaded profile applications. Add a preference (enabled by default) to prompt to load available profile applications on opening a model, if it has unloaded profile applications available. ---- [8566806">8566806] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Add some JUnit tests for the workspace model index framework. ---- [6f500b8] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Ensure that the user models to which a profile-application model contributes profile applications are loaded when the latter is loaded in the Papyrus Editor. ---- [16a0884] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Enable storage of profile applications in UML resources anywhere in the workspace, even in different projects than the models to which they are applied. Uses a new workspace-wide index of cross references between profile-application resources and user model resources, built at start-up and maintained in the background as the workspace changes. ---- [6fe515d] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Hide profile application models in the Model Explorer by default. ---- [69ef817] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Added context-menu actions in the Model Explorer for loading available profile applications that are not yet loaded and for unloading and loaded externalized profile applications (for any currently open controlled units). ---- [d9bb954] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Initial implementation of separate storage of profile applications and their defined stereotype applications in a separate resource. Includes - externalize profile applications refactoring wizard - internalize profile applications refactoring wizard - load profile applications context-menu action in Project Explorer - unload profile applications context-menu action in Model Explorer - enhanced Profile applications table in Properties view for packages ---- [b8578c3] 399859: [Profiles] Papyrus shall enable to manage profile applications in separate files Propagate standard JDT preferences to the sandbox projects. Signed-off-by: Christian W. Damus <give.a.damus@gmail.com> ---- [ec61dd2] 399859: [Profile Applications] Papyrus shall enable to manage profile applications in separate files Update build dependencies to pick up latest UML2 integration build with new APIs required for profile applications feature. Change-Id: Ifa20519ec3209393c88e0a1ac322eac715e541f4
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.sdk.feature/feature.xml7
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/.project17
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/build.properties7
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/epl-v10.html304
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.properties132
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.xml49
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/license.html107
-rw-r--r--features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/pom.xml14
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml236
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/.project17
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/build.properties5
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/epl-v10.html304
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/feature.xml72
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/license.html107
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/pom.xml15
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/schema/model.exsd38
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java8
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java16
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java118
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/JobBasedFuture.java335
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomain.java7
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/.classpath14
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/AnyRootNamespaceContentHandler.java104
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/IWorkspaceModelIndexListener.java61
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java864
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexAdapter.java58
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexEvent.java76
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFunctions.java98
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFPredicates.java63
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ICallableWithProgress.java45
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReferenceCounted.java175
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/UIUtil.java152
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java25
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IControlCommandParticipant.java12
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IUncontrolCommandParticipant.java17
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java12
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingLabelProvider.java25
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingStyledLabelProvider.java61
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.classpath (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.classpath)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.project (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.project)2
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/META-INF/MANIFEST.MF32
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/about.html (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/about.html)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/build.properties (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/build.properties)4
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/documentation.pdoc4
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.properties12
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.xml11
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/pom.xml14
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/Activator.java118
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/DecoratorModelControlModeParticipant.java142
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/PackageRefactoringContext.java265
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/AbstractDecoratorModelRefactoringCommand.java143
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/ConfirmSaveCommand.java58
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DecoratorModelRefactoringCommandFactory.java236
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DirectionConstraint.java32
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/LoadedDecoratorModelRefactoringCommand.java56
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/SaveModelCommand.java148
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/UnloadedDecoratorModelRefactoringCommand.java68
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/Messages.java46
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/messages.properties25
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdater.java61
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdaterDelegate.java94
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/CrossReferenceUpdater.java123
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IDecoratorModelUpdaterDelegate.java35
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IRefactoringStep.java31
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/LoadedDecoratorModelUpdaterDelegate.java49
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostControlDecoratorModelUpdater.java104
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostUncontrolDecoratorModelUpdater.java115
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/UnloadedDecoratorModelUpdaterDelegate.java52
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.classpath (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.classpath)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.project (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.project)2
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF35
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/OSGI-INF/l10n/bundle.properties3
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/about.html28
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/build.properties11
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/documentation.pdoc4
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/dup_resource.pngbin0 -> 595 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/externalize.gifbin0 -> 329 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/internalize.gifbin0 -> 327 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/unload_resource.pngbin0 -> 4355 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/dtool16/load_resource.pngbin0 -> 4218 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/etool16/load_resource.pngbin0 -> 4323 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/plugin.xml (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/plugin.xml)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/pom.xml14
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResource.ctx33
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi27
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageDecoratorModels.xwt12
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageProfile.xwt12
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/constraints/HasExternalizedProfileApplicationsConstraint.java83
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/Messages.java43
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/messages.properties12
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/Activator.java111
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/AppliedProfilesObservableList.java65
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/DecoratorModelsObservableList.java243
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElement.java46
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElementFactory.java48
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/DecoratorModelPropertyEditor.java340
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/ProfileApplicationPropertyEditor.java208
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.classpath (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.classpath)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.project (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.project)2
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/META-INF/MANIFEST.MF42
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/about.html28
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/build.properties10
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/documentation.pdoc4
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/icons/full/ovr16/profileApps.pngbin0 -> 2993 bytes
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.properties38
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.xml273
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/pom.xml14
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Activator.java111
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Startup.java32
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/ExternalizeProfilesHandler.java51
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/InternalizeProfilesHandler.java51
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/LoadAvailableDecoratorModelsHandler.java61
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/UnloadDecoratorModelHandler.java273
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/UnloadLoadedDecoratorModelsHandler.java74
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/expressions/PackagePropertyTester.java134
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/messages/Messages.java98
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/messages/messages.properties67
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/preferences/DecoratorModelPreferencePage.java47
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/preferences/ProfileExternalizationUIPreferences.java69
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/preferences/WhenKind.java32
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/providers/AvailableDecoratorModelsSnippet.java169
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/providers/DecoratorModelLabelDecorator.java192
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/providers/DecoratorModelLabelProvider.java185
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/providers/EncapsulatedAdapterFactoryLabelProvider.java65
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/providers/ProfileResourceLabelProvider.java149
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/AbstractManageProfileApplicationsWizard.java168
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/AbstractNewDecoratorModelPage.java205
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/AbstractProfileApplicationSelectionPage.java227
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/AbstractProfileApplicationsPage.java36
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/ConflictingDecoratorModelsPage.java216
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/DecoratorModelSelectionPage.java319
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/DuplicateDecoratorModelPage.java176
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/DuplicateDecoratorModelWizard.java156
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/ExternalizeProfileApplicationsPage.java143
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/ExternalizeProfileApplicationsWizard.java138
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/InternalizeProfileApplicationsPage.java76
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/InternalizeProfileApplicationsWizard.java83
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/LoadDecoratorModelsPage.java120
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/LoadProfileApplicationsWizard.java230
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/wizards/UnloadProfileApplicationsWizard.java93
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/ui/providers/DeleteEmptyDecoratorModelsPolicy.java119
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/.classpath7
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/.project28
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/META-INF/MANIFEST.MF39
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/about.html28
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/build.properties12
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/conception.textile (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/conception.textile)20
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/documentation.pdoc4
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/model/ProfileExternalization.profile.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Class3.notation)0
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/model/ProfileExternalization.profile.genmodel46
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/model/ProfileExternalization.profile.notation86
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/model/ProfileExternalization.profile.uml55
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/model/profileExternalization.ecore32
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/plugin.properties14
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/plugin.xml83
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/pom.xml14
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/Activator.java (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/Activator.java)26
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/helper/DecoratorModelUtils.java1201
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/helper/IDeleteEmptyDecoratorModelsPolicy.java33
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/helper/PapyrusProfileApplicationHelper.java61
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/helper/PapyrusStereotypeApplicationHelper.java46
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/commands/CreateDecoratorModelCommand.java130
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/commands/DeleteDecoratorModelCommand.java105
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/commands/ReclaimProfileApplicationsCommand.java44
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/commands/SaveDecoratorModelCommand.java74
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/commands/SeparateProfileApplicationsCommand.java53
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/expressions/FilePropertyTester.java54
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/messages/Messages.java37
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/messages/messages.properties6
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/providers/ExternalizedProfileApplicationDelegate.java222
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/DecoratorModelCopier.java207
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/DecoratorModelIndex.java589
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/DecoratorModelIndexEvent.java42
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/DecoratorModelReadOnlyHandler.java79
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/DecoratorModelResourceSet.java116
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/IDecoratorModelIndexListener.java27
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/index/ProfileIndexHandler.java367
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/model/DecoratorModel.java260
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/model/UMLSnippet.java118
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/ApplyProfiles.java92
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/ProfileExternalizationFactory.java56
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/ProfileExternalizationPackage.java249
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/impl/ApplyProfilesImpl.java274
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/impl/ProfileExternalizationFactoryImpl.java121
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/impl/ProfileExternalizationPackageImpl.java345
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/internal/operations/ApplyProfilesOperations.java88
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/util/ProfileExternalizationAdapterFactory.java148
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/util/ProfileExternalizationSwitch.java136
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel/src/org/eclipse/papyrus/uml/decoratormodel/profileExternalization/util/ProfileExternalizationValidator.java231
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.controlmode.profile/src/org/eclipse/papyrus/uml/controlmode/profile/commands/MoveProfileApplicationCommand.java7
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.controlmode.profile/src/org/eclipse/papyrus/uml/controlmode/profile/commands/MoveStereotypeApplicationToControlResource.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.controlmode.profile/src/org/eclipse/papyrus/uml/controlmode/profile/helpers/ProfileApplicationHelper.java36
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/participants/StereotypeApplicationRepairParticipant.java167
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/ApplyProfileAction.java27
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/ZombieStereotypesDescriptor.java52
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.profile/META-INF/MANIFEST.MF1
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.profile/src/org/eclipse/papyrus/uml/profile/providers/ProfileApplicationContentProvider.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.profile/src/org/eclipse/papyrus/uml/profile/service/ReapplyProfilesService.java71
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.profile/src/org/eclipse/papyrus/uml/profile/service/ui/RefreshProfileDialog.java22
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/ProfileApplicationEditor.java51
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/ProfileApplicationPropertyEditor.java10
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomUMLUtil.java16
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ProfileUtil.java63
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml1
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/schema/profileApplicationDelegates.exsd125
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java56
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java31
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/IProfileApplicationDelegate.java135
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/ProfileApplicationDelegateRegistry.java245
-rw-r--r--releng/org.eclipse.papyrus.oomph/setups/papyrus.setup2
-rw-r--r--releng/top-pom-extra-tests.xml594
-rwxr-xr-xreleng/top-pom-extras.xml1128
-rw-r--r--releng/top-pom-main-tests.xml649
-rwxr-xr-xreleng/top-pom-main.xml1391
-rwxr-xr-xreleng/top-pom-rcp.xml384
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/META-INF/MANIFEST.MF18
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/OSGI-INF/l10n/bundle.properties3
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/resources/UMLStereotypeApplicationExternalResource.ctx1078
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi15
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/resources/ui/SinglePackageProfile.xwt13
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/src/org/eclipse/papyrus/uml/profile/externalresource/properties/Activator.java61
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/src/org/eclipse/papyrus/uml/profile/externalresource/properties/widgets/OneResourceOnlyStrategyLocationPropertyEditor.java53
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/src/org/eclipse/papyrus/uml/profile/externalresource/properties/widgets/ResourcePerProfileStrategyLocationPropertyEditor.java46
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/META-INF/MANIFEST.MF27
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/plugin.xml19
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/ExternalResourcesTestProfile.profile.di23
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/ExternalResourcesTestProfile.profile.notation202
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/ExternalResourcesTestProfile.profile.uml158
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Class3.ExternalResourcesTestProfileProfile4
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Class3.di9
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Class3.uml4
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Package1.ExternalResourcesTestProfileProfile4
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Package1.di9
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Package1.uml21
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/oneProfileApplied.ExternalResourcesTestProfileProfile9
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/oneProfileApplied.notation208
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/oneProfileApplied.uml25
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourceforAllProfiles/oneProfileApplied.notation97
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourceforAllProfiles/oneProfileApplied.profiles9
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourceforAllProfiles/oneProfileApplied.uml23
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/SimpleTestModel.ExternalResourcesTestProfileProfile2
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/SimpleTestModel.SysMLProfile4
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/SimpleTestModel.notation143
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/SimpleTestModel.uml32
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Class3.di9
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Class3.notation2
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Class3.uml5
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Package1.notation2
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Package1.uml21
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/oneProfileApplied.notation208
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/oneProfileApplied.uml26
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/icons/testProfile.gifbin553 -> 0 bytes
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/AbstractChangeStrategyTests.java251
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/AbstractExternalResourcesTest.java472
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/oneresourceforallprofiles/OneResourceForAllProfilesTests.java60
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/resourceloading/ResourceLoading.java29
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/resourceperprofile/ResourcePerProfileTests.java60
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/standardstrategy/StandardStrategyTests.java68
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/META-INF/MANIFEST.MF22
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/documentation.pdoc4
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/plugin.xml16
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/Activator.java55
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/AbstractStereotypeApplicationLocationStrategy.java35
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/ExtendedProfileApplicationHelper.java34
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/ExternalResourceProfileUtils.java173
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/IStereotypeApplicationLocationStrategy.java51
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/OneResourceOnlyStrategy.java112
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/PapyrusStereotypeApplicationHelper.java111
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/ResourcePerProfileStrategy.java261
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/StandardApplicationLocationStrategy.java72
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/StrategyRegistry.java62
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/helper/UpdateStereotypeApplicationsLocationCommand.java56
-rw-r--r--sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/src/org/eclipse/papyrus/uml/profile/externalresource/model/StereotypeApplicationExternalResourceModel.java252
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java23
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java330
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF182
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java5
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/.classpath14
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/index/referenced.uml4
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/index/referencing.uml8
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexTest.java443
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/tests/AllTests.java15
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java55
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java188
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java214
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java22
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java41
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/.classpath7
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/.project28
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/META-INF/MANIFEST.MF31
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/about.html28
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/build.properties (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/build.properties)5
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests.launch (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/org.eclipse.papyrus.uml.profile.externalresource.tests.launch)12
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/plugin.properties12
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/pom.xml14
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/Package1_1.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/Package1.di)3
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/Package1_1.notation (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/Package1.notation)0
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/Package1_1.uml18
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/package2.decorator.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourceforAllProfiles/oneProfileApplied.di)13
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/package2.decorator.manifest6
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/package2.decorator.notation227
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/package2.decorator.uml42
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/package2.ecore.uml57
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/profile/profile1.profile.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/SimpleTestModel.di)7
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/profile/profile1.profile.notation218
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/profile/profile1.profile.uml117
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/testmodel.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/OneResourcePerProfile/oneProfileApplied.di)13
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/testmodel.manifest7
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/testmodel.notation227
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/resources/testmodel.uml51
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/src/org/eclipse/papyrus/uml/decoratormodel/controlmode/tests/AbstractDecoratorModelControlModeTest.java633
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/src/org/eclipse/papyrus/uml/decoratormodel/controlmode/tests/AdditionalModelStructuresTest.java121
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/src/org/eclipse/papyrus/uml/decoratormodel/controlmode/tests/AllTests.java (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/src/org/eclipse/papyrus/uml/profile/externalresource/tests/AllTests.java)10
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/src/org/eclipse/papyrus/uml/decoratormodel/controlmode/tests/ControlModeWithDecoratorModelsTest.java407
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/.classpath7
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/.project28
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/META-INF/MANIFEST.MF33
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/about.html28
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/build.properties (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/build.properties)4
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/org.eclipse.papyrus.uml.decoratormodel.tests.launch45
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/plugin.properties12
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/pom.xml14
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/package1.decorator.uml29
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/profile/profile1.profile.uml184
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/testmodel.di21
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/testmodel.manifest4
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/testmodel.notation271
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingProfileApplication/testmodel.uml63
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/package1.decorator.uml42
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/profile/profile1.profile.uml184
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/testmodel.di21
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/testmodel.manifest4
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/testmodel.notation271
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/missingSchema/testmodel.uml63
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/package2.decorator.di18
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/package2.decorator.manifest6
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/package2.decorator.notation227
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/package2.decorator.uml39
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/package2.ecore.uml51
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/profile/profile1.profile.di (renamed from sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/resources/StandardResource/oneProfileApplied.di)7
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/profile/profile1.profile.notation181
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/profile/profile1.profile.uml100
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/testmodel.di18
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/testmodel.manifest6
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/testmodel.notation227
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/testmodel.uml47
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/package1.decorator.uml42
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/profile/profile1.profile.uml184
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/testmodel.di21
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/testmodel.manifest4
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/testmodel.notation271
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/resources/wrongProfileVersion/testmodel.uml63
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/helper/tests/DecoratorModelUtilsTest.java348
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/helper/tests/PapyrusStereotypeApplicationHelperTest.java153
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/internal/expressions/tests/FilePropertyTesterTest.java80
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/tests/DecoratorModelCopierTest.java141
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/internal/resource/tests/DecoratorModelIndexTest.java295
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/AbstractProfileExternalizationTest.java477
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/AllTests.java39
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/ExternalizeProfileApplicationTest.java155
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/InternalizeProfileApplicationTest.java112
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/ProfileMigrationTest.java89
-rw-r--r--tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/src/org/eclipse/papyrus/uml/decoratormodel/tests/StereotypeApplicationRepairTest.java195
382 files changed, 31750 insertions, 7487 deletions
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.sdk.feature/feature.xml b/features/papyrus-main-features/org.eclipse.papyrus.sdk.feature/feature.xml
index 5a01cd1d889..1d28dcbff77 100644
--- a/features/papyrus-main-features/org.eclipse.papyrus.sdk.feature/feature.xml
+++ b/features/papyrus-main-features/org.eclipse.papyrus.sdk.feature/feature.xml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><feature id="org.eclipse.papyrus.sdk.feature" label="Papyrus UML" plugin="org.eclipse.papyrus.infra.core" provider-name="Eclipse Modeling Project" version="1.1.0.qualifier">
<copyright url="http://www.eclipse.org/legal/epl-v10.html">
- Copyright (c) 2012, 2013 CEA LIST
+ Copyright (c) 2012, 2014 CEA LIST and others
All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License
-v1.0
+are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
</copyright>
@@ -83,6 +82,8 @@ http://www.eclipse.org/legal/epl-v10.html
<includes id="org.eclipse.papyrus.infra.viewpoints.feature" version="0.0.0"/>
+ <includes id="org.eclipse.papyrus.uml.decoratormodel.feature" version="0.0.0"/>
+
<plugin download-size="0" id="com.google.guava" install-size="0" unpack="false" version="15.0.0.v201403281430"/>
</feature> \ No newline at end of file
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/.project b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/.project
new file mode 100644
index 00000000000..ba67a87a6d9
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.decoratormodel.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/build.properties b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/build.properties
new file mode 100644
index 00000000000..b9ce3341aac
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/build.properties
@@ -0,0 +1,7 @@
+bin.includes = feature.xml,\
+ build.properties,\
+ epl-v10.html,\
+ license.html,\
+ feature.properties
+src.includes = epl-v10.html,\
+ license.html
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/epl-v10.html b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/epl-v10.html
new file mode 100644
index 00000000000..cb1073a4bad
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/epl-v10.html
@@ -0,0 +1,304 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ }
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ }
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+
+ }
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang="EN-US" style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.properties b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.properties
new file mode 100644
index 00000000000..11ac9ede269
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.properties
@@ -0,0 +1,132 @@
+# NLS_MESSAGEFORMAT_VAR
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 9, 2014\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+\t- Content may be structured and packaged into modules to facilitate delivering,\n\
+\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+\t plug-in fragments ("Fragments"), and features ("Features").\n\
+\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+\t in a directory named "plugins".\n\
+\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\
+\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+\t- The top-level (root) directory\n\
+\t- Plug-in and Fragment directories\n\
+\t- Inside Plug-ins and Fragments packaged as JARs\n\
+\t- Sub-directories of the directory named "src" of certain Plug-ins\n\
+\t- Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+\t extending or updating the functionality of an Eclipse-based product.\n\
+\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+\t with the Specification. Such Installable Software Agreement must inform the user of the\n\
+\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+\t indication of agreement by the user, the provisioning Technology will complete installation\n\
+\t of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.xml b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.xml
new file mode 100644
index 00000000000..b7fe5e2e827
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/feature.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.papyrus.uml.decoratormodel.feature"
+ label="Papyrus Decorator Models"
+ version="1.1.0.qualifier"
+ provider-name="Eclipse Modeling Project">
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ Copyright (c) 2014 CEA LIST and others
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License
+v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel.controlmode"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel.properties"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/license.html b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/license.html
new file mode 100644
index 00000000000..c3d34c3c21e
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/license.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!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>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 9, 2014</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation 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 provided with this Content and is also 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>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/pom.xml b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/pom.xml
new file mode 100644
index 00000000000..84a3a8e7fad
--- /dev/null
+++ b/features/papyrus-main-features/org.eclipse.papyrus.uml.decoratormodel.feature/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.decoratormodel.feature</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project> \ No newline at end of file
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
index a9f64e1ff45..a89f52cb9d4 100644
--- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.papyrus.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName">
-
- <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.papyrus.tests.feature"
+ label="%featureName"
+ version="1.1.0.qualifier"
+ provider-name="%providerName">
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
Copyright (c) 2008-2014 CEA LIST, Atos Origin, Conselleria de
Infraestructuras y Transporte, Generalitat de la Comunitat Valenciana
and others
@@ -13,111 +13,115 @@ All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License
v1.0
which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <includes
- id="org.eclipse.papyrus.tests.uml.diagram.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.infra.services.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.sysml.diagram.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.sysml.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.uml.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.views.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.infra.nattable.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.sysml.nattable.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.uml.nattable.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.infra.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.infra.core.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.tests.uml.tools.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.papyrus.uml.textedit.tests.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.papyrus.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.papyrus.bundles.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.papyrus.customization.properties.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.papyrus.editor.integration.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.papyrus.infra.gmfdiag.css.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.papyrus.junit.utils"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.papyrus.junit.framework"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+http://www.eclipse.org/legal/epl-v10.html
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <includes
+ id="org.eclipse.papyrus.tests.uml.diagram.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.infra.services.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.sysml.diagram.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.sysml.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.uml.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.views.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.infra.nattable.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.sysml.nattable.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.uml.nattable.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.infra.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.infra.core.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.uml.tools.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.tests.uml.decoratormodel.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.papyrus.uml.textedit.tests.feature"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.papyrus.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.bundles.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.customization.properties.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.editor.integration.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.infra.gmfdiag.css.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.papyrus.junit.utils"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.junit.framework"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/.project b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/.project
new file mode 100644
index 00000000000..1df6a2ecc9f
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.tests.uml.decoratormodel.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/build.properties b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/build.properties
new file mode 100644
index 00000000000..67be479779f
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/build.properties
@@ -0,0 +1,5 @@
+bin.includes = feature.xml,\
+ epl-v10.html,\
+ license.html
+src.includes = epl-v10.html,\
+ license.html
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/epl-v10.html b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/epl-v10.html
new file mode 100644
index 00000000000..cb1073a4bad
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/epl-v10.html
@@ -0,0 +1,304 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ }
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ }
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+
+ }
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang="EN-US" style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/feature.xml
new file mode 100644
index 00000000000..e66a7621aa9
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/feature.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.papyrus.tests.uml.decoratormodel.feature"
+ label="Papyrus UML Decor Model Tests Feature"
+ version="1.1.0.qualifier"
+ provider-name="Eclipse Modeling Project">
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ Copyright (c) 2014 CEA LIST and others
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License
+v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+ </copyright>
+
+ <license url="license.html">
+ Eclipse Foundation Software User Agreement
+March 17, 2005
+
+Usage Of Content
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
+
+Applicable Licenses
+Unless otherwise indicated, all Content made available by the Eclipse Foundation 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 provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, &quot;Program&quot; will mean the Content.
+
+Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).
+
+Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).
+Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&quot; ARchive) in a directory named &quot;plugins&quot;.
+A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with that Feature.
+Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.
+The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module including, but not limited to the following locations:
+
+The top-level (root) directory
+Plug-in and Fragment directories
+Inside Plug-ins and Fragments packaged as JARs
+Sub-directories of the directory named &quot;src&quot; of certain Plug-ins
+Feature directories
+Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature. Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in that directory.
+
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
+
+Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)
+Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)
+IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)
+Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)
+Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
+
+Cryptography
+Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check the country&apos;s laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted.
+
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
+ </license>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.uml.decoratormodel.controlmode.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/license.html b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/license.html
new file mode 100644
index 00000000000..c3d34c3c21e
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/license.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!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>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 9, 2014</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation 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 provided with this Content and is also 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>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/pom.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/pom.xml
new file mode 100644
index 00000000000..b56be93764b
--- /dev/null
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.uml.decoratormodel.feature/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../releng/top-pom-main-tests.xml</relativePath>
+ </parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.tests.uml.decoratormodel.feature</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/model.exsd b/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/model.exsd
index 3e924caa53e..d9644724ac7 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/model.exsd
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/model.exsd
@@ -58,9 +58,10 @@ Registered model can be retrieved from the ModelSet.
</documentation>
</annotation>
<complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
+ <choice minOccurs="0" maxOccurs="unbounded">
<element ref="modelSnippet"/>
- </sequence>
+ <element ref="dependency"/>
+ </choice>
<attribute name="description" type="string">
<annotation>
<documentation>
@@ -150,6 +151,39 @@ The code is executed right after the modelSet is loaded.
</complexType>
</element>
+ <element name="dependency">
+ <complexType>
+ <choice minOccurs="1" maxOccurs="unbounded">
+ <element ref="loadAfter"/>
+ <element ref="unloadBefore"/>
+ </choice>
+ </complexType>
+ </element>
+
+ <element name="loadAfter">
+ <complexType>
+ <attribute name="identifier" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="unloadBefore">
+ <complexType>
+ <attribute name="identifier" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
<annotation>
<appInfo>
<meta.section type="since"/>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
index b97d551c383..c9b798632be 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
+ * Copyright (c) 2010, 2014 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -11,6 +11,7 @@
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - manage models by URI, not IFile (CDO)
* Christian W. Damus (CEA) - bug 437052
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
@@ -269,6 +270,10 @@ public abstract class AbstractBaseModel extends AbstractModel implements IVersio
protected Map<Object, Object> getSaveOptions() {
+ return getDefaultSaveOptions();
+ }
+
+ public static Map<Object, Object> getDefaultSaveOptions() {
Map<Object, Object> saveOptions = new HashMap<Object, Object>();
// default save options.
@@ -288,7 +293,6 @@ public abstract class AbstractBaseModel extends AbstractModel implements IVersio
return saveOptions;
}
-
@Override
public void saveCopy(IPath targetPathWithoutExtension, Map<Object, Object> targetMap) {
// OutputStream targetStream = getOutputStream(targetPath);
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
index 653351be6a5..9ee222ffaca 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2014 CEA LIST and others.
+ * Copyright (c) 2013, 2014 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,17 +9,20 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 437052
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
import java.io.IOException;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.papyrus.infra.core.Activator;
/**
@@ -33,9 +36,20 @@ public abstract class EMFLogicalModel extends AbstractBaseModel implements IEMFM
protected final Set<Resource> resources = new HashSet<Resource>();
public Set<Resource> getResources() {
+ pruneDeletedResources();
return resources;
}
+ protected void pruneDeletedResources() {
+ ResourceSet rset = getModelManager();
+ for (Iterator<Resource> iter = resources.iterator(); iter.hasNext();) {
+ if (iter.next().getResourceSet() != rset) {
+ // This resource was deleted
+ iter.remove();
+ }
+ }
+ }
+
@Override
protected void configureResource(Resource resourceToConfigure) {
super.configureResource(resourceToConfigure);
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
index 727a02170d1..862d550115d 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 CEA and others.
+ * Copyright (c) 2014 CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,10 +8,12 @@
*
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
+ * Christian W. Damus - bug 399859
*
*/
package org.eclipse.papyrus.infra.core.resource;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
@@ -21,6 +23,13 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.ResourceSetChangeEvent;
+import org.eclipse.emf.transaction.ResourceSetListener;
+import org.eclipse.emf.transaction.RollbackException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+import com.google.common.collect.ImmutableList;
/**
@@ -38,6 +47,15 @@ public abstract class ResourceAdapter extends AdapterImpl {
// Don't need to track resources as targets (there are multiple)
if (newTarget instanceof ResourceSet) {
super.setTarget(newTarget);
+
+ // Discover existing resources. Iterate the current set; any new additions
+ // will be discovered automatically
+ for (Resource next : ImmutableList.copyOf(((ResourceSet) newTarget).getResources())) {
+ handleResourceAdded(next);
+ if (next.isLoaded()) {
+ handleResourceLoaded(next);
+ }
+ }
}
}
@@ -203,4 +221,102 @@ public abstract class ResourceAdapter extends AdapterImpl {
protected void handleRootRemoved(Resource resource, EObject root) {
// Pass
}
+
+ //
+ // Nested types
+ //
+
+ /**
+ * A variant of the {@link ResourceAdapter} that is attached to a {@link TransactionalEditingDomain} to process batched notifications.
+ */
+ public static class Transactional extends ResourceAdapter implements ResourceSetListener {
+ private final boolean isPrecommit;
+
+ private final NotificationFilter filter = NotificationFilter.NOT_TOUCH.and(createFilter());
+
+ /**
+ * Initializes me as a post-commit resource notification handler.
+ */
+ public Transactional() {
+ this(false);
+ }
+
+ /**
+ * Initializes me as a pre- or post-commit resource notification handler.
+ *
+ * @param isPrecommit
+ * {@code true} to react to pre-commit notifications; {@code false} to react to post-commit notifications
+ */
+ public Transactional(boolean isPrecommit) {
+ this.isPrecommit = isPrecommit;
+ }
+
+ @Override
+ public boolean isAggregatePrecommitListener() {
+ return false;
+ }
+
+ @Override
+ public boolean isPrecommitOnly() {
+ return isPrecommit;
+ }
+
+ @Override
+ public boolean isPostcommitOnly() {
+ return !isPrecommit;
+ }
+
+ /**
+ * Subclasses may override/extend this method to create custom filters, perhaps based on the default filter create by the superclass.
+ * <b>Note</b> that this method is invoked by the superclass constructor, so subclasses must not attempt to access their own state.
+ *
+ * @return my notification filter
+ */
+ protected NotificationFilter createFilter() {
+ return NotificationFilter.createNotifierTypeFilter(ResourceSet.class).or(
+ NotificationFilter.createNotifierTypeFilter(Resource.class));
+ }
+
+ @Override
+ public NotificationFilter getFilter() {
+ return filter;
+ }
+
+ @Override
+ public void resourceSetChanged(ResourceSetChangeEvent event) {
+ handleResourceSetChangeEvent(event);
+ }
+
+ @Override
+ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
+ handleResourceSetChangeEvent(event);
+ return null;
+ }
+
+ protected void handleResourceSetChangeEvent(ResourceSetChangeEvent event) {
+ for (Notification next : event.getNotifications()) {
+ notifyChanged(next);
+ }
+ }
+
+ @Override
+ public final void setTarget(Notifier newTarget) {
+ // Don't attach me to anything. I am fed directly by the editing domain
+ }
+
+ @Override
+ public final void unsetTarget(Notifier oldTarget) {
+ // Pass
+ }
+
+ @Override
+ protected final void addAdapter(Notifier notifier) {
+ // Don't attach me to anything. I am fed directly by the editing domain
+ }
+
+ @Override
+ protected final void removeAdapter(Notifier notifier) {
+ // Pass
+ }
+ }
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/JobBasedFuture.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/JobBasedFuture.java
new file mode 100644
index 00000000000..f5fb41b133b
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/JobBasedFuture.java
@@ -0,0 +1,335 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.utils;
+
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.ProgressMonitorWrapper;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.ILock;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.papyrus.infra.core.Activator;
+
+import com.google.common.util.concurrent.ExecutionList;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * A Guava {@link ListenableFuture} implemented as an Eclipse {@link Job} to ensure that, in case the UI thread ever has to wait
+ * for the future result, the blockage is reported to the user with opportunity to cancel.
+ * <p>
+ * <b>Note</b> that no scheduling rule must be {@linkplain Job#setRule(ISchedulingRule) set} on instances of this class. Nor must the implementation of the {@link #compute(IProgressMonitor)} method attempt to
+ * {@linkplain IJobManager#beginRule(ISchedulingRule, IProgressMonitor) begin} an ad hoc rule. Doing either will almost certainly cause deadlock or worse.
+ */
+public abstract class JobBasedFuture<V> extends Job implements ListenableFuture<V> {
+ private static final ScheduledThreadPoolExecutor TIMEOUT_EXECUTOR = new ScheduledThreadPoolExecutor(1);
+
+ private final CountDownLatch started = new CountDownLatch(1);
+ private final ILock runningLock = Job.getJobManager().newLock();
+ private final ISchedulingRule rule = new ISchedulingRule() {
+
+ @Override
+ public boolean isConflicting(ISchedulingRule rule) {
+ return rule == this;
+ }
+
+ @Override
+ public boolean contains(ISchedulingRule rule) {
+ return rule == this;
+ }
+ };
+
+ private final AtomicReference<State> state = new AtomicReference<State>(State.RUNNING);
+
+ private volatile Throwable exception;
+ private final ExecutionList executions = new ExecutionList();
+
+ private volatile V value;
+
+ static {
+ TIMEOUT_EXECUTOR.setKeepAliveTime(10, TimeUnit.SECONDS);
+ TIMEOUT_EXECUTOR.allowCoreThreadTimeOut(true);
+ }
+
+ public JobBasedFuture(String name) {
+ super(name);
+
+ setSystem(true);
+ setRule(rule);
+ }
+
+ final boolean transition(State from, State to) {
+ return state.compareAndSet(from, to);
+ }
+
+ final State state() {
+ return state.get();
+ }
+
+ final boolean isInState(State state) {
+ return this.state.get() == state;
+ }
+
+ @Override
+ protected final IStatus run(IProgressMonitor monitor) {
+ IStatus result = Status.OK_STATUS;
+
+ runningLock.acquire();
+ started.countDown();
+
+ try {
+ setValue(compute(monitor));
+ } catch (CoreException e) {
+ result = e.getStatus();
+ fail(e);
+ } catch (ThreadDeath d) {
+ throw d;
+ } catch (Throwable t) {
+ result = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Uncaught exception in future job", t); //$NON-NLS-1$
+ fail(t);
+ } finally {
+ runningLock.release();
+ }
+
+ return result;
+ }
+
+ protected abstract V compute(IProgressMonitor monitor) throws Exception;
+
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ boolean result = transition(State.RUNNING, State.CANCELLED);
+
+ if (result) {
+ try {
+ cancel();
+ } finally {
+ executions.execute();
+ }
+ }
+
+ return result;
+ }
+
+ boolean fail(Throwable t) {
+ boolean result = transition(State.RUNNING, State.FAILED);
+
+ if (result) {
+ exception = t;
+ executions.execute();
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return isInState(State.CANCELLED);
+ }
+
+ @Override
+ public boolean isDone() {
+ return !isInState(State.RUNNING);
+ }
+
+ @Override
+ public V get() throws InterruptedException, ExecutionException {
+ awaitDone(0L);
+
+ return getValue();
+ }
+
+ @Override
+ public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
+ if (!awaitDone(unit.toMillis(timeout))) {
+ throw new TimeoutException();
+ }
+
+ return getValue();
+ }
+
+ final boolean awaitDone(long timeoutMillis) throws InterruptedException {
+ // Check for short-circuit in case of running a listener on completion that
+ // then (obviously) tries to get our value
+ boolean result = isDone();
+
+ if (!result) {
+ Job current = Job.getJobManager().currentJob();
+ if ((current == null) || (current.getRule() == null)) {
+ result = uiSafeAwaitDone(timeoutMillis);
+ } else {
+ result = lockBasedAwaitDone(timeoutMillis);
+ }
+ }
+
+ return result;
+ }
+
+ private boolean lockBasedAwaitDone(long timeoutMillis) throws InterruptedException {
+ boolean result = false;
+
+ // Synchronize first on the start of execution of the job. This should never block for very long because the job
+ // will not have a scheduling rule that anyone else can begin
+
+ if (timeoutMillis <= 0L) {
+ started.await();
+ runningLock.acquire();
+
+ try {
+ result = isDone();
+ } finally {
+ runningLock.release();
+ }
+ } else {
+ final long startedWaiting = System.currentTimeMillis();
+ if (started.await(timeoutMillis, TimeUnit.MILLISECONDS)) {
+ long remaining = timeoutMillis - (System.currentTimeMillis() - startedWaiting);
+ if (remaining > 0L) {
+ if (runningLock.acquire(remaining)) {
+ try {
+ result = isDone();
+ } finally {
+ runningLock.release();
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private boolean uiSafeAwaitDone(long timeoutMillis) throws InterruptedException {
+ boolean result = false;
+
+ // Synchronize first on the start of execution of the job. This should never block for very long because the job
+ // will not have a scheduling rule that anyone else can begin
+
+ if (timeoutMillis <= 0L) {
+ started.await();
+
+ try {
+ Job.getJobManager().beginRule(rule, null);
+ result = isDone();
+ } finally {
+ Job.getJobManager().endRule(rule);
+ }
+ } else {
+ final long startedWaiting = System.currentTimeMillis();
+ if (started.await(timeoutMillis, TimeUnit.MILLISECONDS)) {
+ long remaining = timeoutMillis - (System.currentTimeMillis() - startedWaiting);
+ final IProgressMonitor monitor = new TimeoutMonitor();
+
+ ScheduledFuture<?> timeout = TIMEOUT_EXECUTOR.schedule(new Runnable() {
+
+ @Override
+ public void run() {
+ monitor.setCanceled(true);
+ }
+ }, remaining, TimeUnit.MILLISECONDS);
+
+ try {
+ try {
+ Job.getJobManager().beginRule(rule, monitor);
+ timeout.cancel(false);
+ result = isDone();
+ } finally {
+ Job.getJobManager().endRule(rule);
+ Thread.interrupted(); // clear interrupt state, just in case
+ }
+ } catch (OperationCanceledException e) {
+ // timed out
+ }
+ }
+ }
+
+ return result;
+ }
+
+ final boolean setValue(V value) {
+ boolean result = transition(State.RUNNING, State.DONE);
+
+ if (result) {
+ this.value = value;
+ executions.execute();
+ }
+
+ return result;
+ }
+
+ final V getValue() throws ExecutionException {
+ V result = null;
+
+ final State state = state();
+ switch (state) {
+ case CANCELLED:
+ throw new CancellationException(String.format("Job \"%s\" was cancelled", getName()));
+ case FAILED:
+ throw new ExecutionException(exception);
+ case DONE:
+ result = this.value;
+ break;
+ default:
+ throw new IllegalStateException(state.name());
+ }
+
+ return result;
+ }
+
+ @Override
+ public void addListener(Runnable listener, Executor executor) {
+ executions.add(listener, executor);
+ }
+
+ //
+ // Nested types
+ //
+
+ private enum State {
+ RUNNING, CANCELLED, FAILED, DONE;
+ }
+
+ private static class TimeoutMonitor extends ProgressMonitorWrapper {
+ private Thread thread;
+
+ TimeoutMonitor() {
+ super(new NullProgressMonitor());
+
+ thread = Thread.currentThread();
+ }
+
+ @Override
+ public void setCanceled(boolean b) {
+ boolean wasCanceled = isCanceled();
+ super.setCanceled(b);
+ if (!wasCanceled && b) {
+ thread.interrupt();
+ }
+ }
+ }
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomain.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomain.java
index 652d2d3371f..159ee2c3364 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomain.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomain.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2014 Atos Origin, CEA, and others.
+ * Copyright (c) 2011, 2014 Atos Origin, CEA, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -14,6 +14,7 @@
* Christian W. Damus (CEA) - bug 429826
* Christian W. Damus (CEA) - bug 422257
* Christian W. Damus (CEA) - bug 415639
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.emf.readonly;
@@ -109,7 +110,9 @@ public class PapyrusROTransactionalEditingDomain extends TransactionalEditingDom
}
protected void handleCrossResourceContainmentProxy(Notification notification) {
- if (notification.getEventType() == Notification.RESOLVE) {
+ // If it's not an EReference, then it's a feature-map EAttribute from an unknown-schema AnyType
+ // and it won't contain cross-resource containment references (at least, not that we could tell)
+ if ((notification.getEventType() == Notification.RESOLVE) && (notification.getFeature() instanceof EReference)) {
EReference reference = (EReference) notification.getFeature();
if (reference.isContainment()) {
InternalEObject newValue = (InternalEObject) notification.getNewValue();
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.classpath b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.classpath
index 2d1a4302f04..ad32c83a788 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.classpath
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.classpath
@@ -1,7 +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>
+<?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/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..410244d65a6 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
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.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
index 8c7bca4dadc..d259619ae52 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Export-Package: org.eclipse.papyrus.infra.emf,
org.eclipse.papyrus.infra.emf.providers.strategy,
org.eclipse.papyrus.infra.emf.requests,
org.eclipse.papyrus.infra.emf.resource,
+ org.eclipse.papyrus.infra.emf.resource.index,
org.eclipse.papyrus.infra.emf.utils
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -41,5 +42,5 @@ Bundle-Name: EMF Tools
Bundle-Activator: org.eclipse.papyrus.infra.emf.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.emf;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/AnyRootNamespaceContentHandler.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/AnyRootNamespaceContentHandler.java
new file mode 100644
index 00000000000..5d4d7c3ea04
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/AnyRootNamespaceContentHandler.java
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ContentHandler;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl;
+import org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot;
+
+import com.google.common.base.Strings;
+
+/**
+ * A XML content type handler that matches a namespace pattern against any of the namespaces declared in the document's root element.
+ * It therefore does not support the {@link RootXMLContentHandlerImpl#ELEMENT_NAMES} and {@link RootXMLContentHandlerImpl#KIND} configuration attributes.
+ */
+public class AnyRootNamespaceContentHandler extends RootXMLContentHandlerImpl {
+
+ public AnyRootNamespaceContentHandler(Map<String, String> parameters) {
+ super(parameters);
+ }
+
+ public AnyRootNamespaceContentHandler(String contentTypeID, String[] extensions, String namespace) {
+ super(contentTypeID, extensions, null, namespace, null);
+ }
+
+ public AnyRootNamespaceContentHandler(String contentTypeID, String[] extensions, Pattern namespacePattern) {
+ super(contentTypeID, extensions, null, namespacePattern, null);
+ }
+
+ @Override
+ public Map<String, Object> contentDescription(URI uri, InputStream inputStream, Map<?, ?> options, Map<Object, Object> context) throws IOException {
+ Map<String, Object> result;
+ String contentType = contentTypeID;
+
+ try {
+ result = super.contentDescription(uri, inputStream, options, context);
+
+ XMLResource xmlResource = load(uri, inputStream, options, context);
+ EList<EObject> contents = xmlResource.getContents();
+ if (!contents.isEmpty()) {
+ EObject eObject = contents.get(0);
+ if (eObject instanceof XMLTypeDocumentRoot) {
+ String matchedNamespace = null;
+ XMLTypeDocumentRoot documentRoot = (XMLTypeDocumentRoot) eObject;
+ for (String next : documentRoot.getXMLNSPrefixMap().values()) {
+ if (isMatchingNamespace(next)) {
+ matchedNamespace = next;
+ break;
+ }
+ }
+
+ if (matchedNamespace != null) {
+ result.put(VALIDITY_PROPERTY, ContentHandler.Validity.VALID);
+ } else {
+ // If none of the root namespaces matched, then we can be assured
+ // that the resource is not of this content type
+ result.put(VALIDITY_PROPERTY, ContentHandler.Validity.INVALID);
+ }
+
+ if (contentType == null) {
+ contentType = matchedNamespace;
+ }
+ }
+ }
+ } catch (IOException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IOException("Uncaught exception in describing resource content.", e); //$NON-NLS-1$
+ }
+
+ result.put(CONTENT_TYPE_PROPERTY, Strings.nullToEmpty(contentType));
+ return result;
+ }
+
+ //
+ // Nested types
+ //
+
+ public static class Describer extends RootXMLContentHandlerImpl.Describer {
+ @Override
+ protected ContentHandler createContentHandler(Map<String, String> parameters) {
+ return new AnyRootNamespaceContentHandler(parameters);
+ }
+ }
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/IWorkspaceModelIndexListener.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/IWorkspaceModelIndexListener.java
new file mode 100644
index 00000000000..7f76ceb8afb
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/IWorkspaceModelIndexListener.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.resource.index;
+
+import java.util.EventListener;
+
+/**
+ * Listener protocol for notifications of {@link WorkspaceModelIndex} events.
+ */
+public interface IWorkspaceModelIndexListener extends EventListener {
+ /**
+ * Notifies me that the index is about to {@linkplain WorkspaceModelIndexEvent#ABOUT_TO_RECALCULATE re-calculate} changes in some project.
+ *
+ * @param event
+ * the event object
+ */
+ void indexAboutToRecalculate(WorkspaceModelIndexEvent event);
+
+ /**
+ * Notifies me that the index has finished {@linkplain WorkspaceModelIndexEvent#RECALCULATED re-calculation} of changes in some project.
+ *
+ * @param event
+ * the event object
+ */
+ void indexRecalculated(WorkspaceModelIndexEvent event);
+
+ /**
+ * Notifies me that the index is about to {@linkplain WorkspaceModelIndexEvent#ABOUT_TO_CALCULATE fully calculate} the index for some project.
+ *
+ * @param event
+ * the event object
+ */
+ void indexAboutToCalculate(WorkspaceModelIndexEvent event);
+
+ /**
+ * Notifies me that the index has finished {@linkplain WorkspaceModelIndexEvent#CALCULATED full calculation} for some project.
+ *
+ * @param event
+ * the event object
+ */
+ void indexCalculated(WorkspaceModelIndexEvent event);
+
+ /**
+ * Notifies me that the index {@linkplain WorkspaceModelIndexEvent#FAILED failed} to (re-)calculate some project.
+ *
+ * @param event
+ * the event object
+ */
+ void indexFailed(WorkspaceModelIndexEvent event);
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
new file mode 100644
index 00000000000..d0960e3595a
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
@@ -0,0 +1,864 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.resource.index;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.infra.core.utils.JobBasedFuture;
+import org.eclipse.papyrus.infra.emf.Activator;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Queues;
+import com.google.common.collect.SetMultimap;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * A general-purpose index of model resources in the Eclipse workspace.
+ */
+public class WorkspaceModelIndex<T> {
+ private static final int MAX_INDEX_RETRIES = 3;
+
+ private final IndexHandler<? extends T> indexer;
+
+ private final QualifiedName indexKey;
+ private final IContentTypeManager mgr;
+ private final IContentType contentType;
+
+ private final SetMultimap<IProject, IFile> index = HashMultimap.create();
+ private final IResourceChangeListener workspaceListener = new WorkspaceListener();
+
+ private final Map<IProject, AbstractIndexJob> activeJobs = Maps.newHashMap();
+ private final JobWrangler jobWrangler;
+
+ private final CopyOnWriteArrayList<IWorkspaceModelIndexListener> listeners = Lists.newCopyOnWriteArrayList();
+
+ public WorkspaceModelIndex(String name, String contentType, IndexHandler<? extends T> indexer) {
+ this(name, contentType, indexer, 0);
+ }
+
+ public WorkspaceModelIndex(String name, String contentType, IndexHandler<? extends T> indexer, int maxConcurrentJobs) {
+ super();
+
+ this.indexKey = new QualifiedName("org.eclipse.papyrus.modelindex", name); //$NON-NLS-1$
+ this.mgr = Platform.getContentTypeManager();
+ this.contentType = this.mgr.getContentType(contentType);
+ this.indexer = indexer;
+
+ jobWrangler = new JobWrangler(maxConcurrentJobs);
+
+ startIndex();
+ }
+
+ public void dispose() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(workspaceListener);
+ Job.getJobManager().cancel(this);
+
+ synchronized (index) {
+ for (IFile next : index.values()) {
+ try {
+ next.setSessionProperty(indexKey, null);
+ } catch (CoreException e) {
+ // Just continue, best-effort. There's nothing else to do
+ }
+ }
+
+ index.clear();
+ }
+ }
+
+ private void startIndex() {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(workspaceListener, IResourceChangeEvent.POST_CHANGE);
+
+ index(Arrays.asList(workspace.getRoot().getProjects()));
+ }
+
+ void index(Collection<? extends IProject> projects) {
+ List<Job> jobs = Lists.newArrayListWithCapacity(projects.size());
+ for (IProject next : projects) {
+ jobs.add(new IndexProjectJob(next));
+ }
+ schedule(jobs);
+ }
+
+ /**
+ * Obtains an asynchronous future result that is scheduled to run after any pending indexing work has completed.
+ * The {@code function} is <em>not</em> invoked under synchronization on the index; it is passed a copy of the
+ * last consistent state of the index after any pending calculations have completed.
+ *
+ * @param function
+ * the function to schedule. Its input is the complete index map
+ *
+ * @return the future result of the function applied to the index
+ */
+ public <V> ListenableFuture<V> afterIndex(final Function<? super Map<IFile, T>, V> function) {
+ return Futures.transform(getIndex(), function);
+ }
+
+ /**
+ * Obtains an asynchronous future result that is scheduled to run after any pending indexing work has completed.
+ * The {@code callable} is invoked under synchronization on the index, so it must be careful about how it
+ * synchronizes on other objects to avoid deadlocks.
+ *
+ * @param callable
+ * the operation to schedule
+ *
+ * @return the future result of the operation
+ */
+ public <V> ListenableFuture<V> afterIndex(final Callable<V> callable) {
+ ListenableFuture<V> result;
+
+ if (Job.getJobManager().find(this).length == 0) {
+ // Result is available now
+ try {
+ result = Futures.immediateFuture(callable.call());
+ } catch (Exception e) {
+ result = Futures.immediateFailedFuture(e);
+ }
+ } else {
+ JobBasedFuture<V> job = new JobBasedFuture<V>(NLS.bind("Wait for model index \"{0}\"", indexKey.getLocalName())) {
+ {
+ // setSystem(true);
+ }
+
+ @Override
+ protected V compute(IProgressMonitor monitor) throws Exception {
+ V result;
+
+ Job.getJobManager().join(WorkspaceModelIndex.this, monitor);
+ synchronized (index) {
+ result = callable.call();
+ }
+
+ return result;
+ }
+ };
+ job.schedule();
+ result = job;
+ }
+
+ return result;
+ }
+
+ /**
+ * Schedules an operation to run after any pending indexing work has completed.
+ * The {@code runnable} is invoked under synchronization on the index, so it must be careful about how it
+ * synchronizes on other objects to avoid deadlocks.
+ *
+ * @param runnable
+ * the operation to schedule
+ */
+ public void afterIndex(final Runnable runnable) {
+ afterIndex(new Callable<Void>() {
+ @Override
+ public Void call() throws Exception {
+ runnable.run();
+ return null;
+ }
+ });
+ }
+
+ /**
+ * Obtains the index when it is ready.
+ *
+ * @return the future value of the index, when it is ready
+ */
+ public ListenableFuture<Map<IFile, T>> getIndex() {
+ return afterIndex(new Callable<Map<IFile, T>>() {
+ @Override
+ public Map<IFile, T> call() {
+ return map();
+ }
+ });
+ }
+
+ /**
+ * @precondition The {@link #index} monitor is held.
+ */
+ private Map<IFile, T> map() {
+ ImmutableMap.Builder<IFile, T> result = ImmutableMap.builder();
+
+ for (IFile next : index.values()) {
+ try {
+ @SuppressWarnings("unchecked")
+ T value = (T) next.getSessionProperty(indexKey);
+ if (value != null) {
+ result.put(next, value);
+ }
+ } catch (CoreException e) {
+ Activator.log.error("Failed to access index data for file " + next.getFullPath(), e); //$NON-NLS-1$
+ }
+ }
+
+ return result.build();
+ }
+
+ void process(IFile file) throws CoreException {
+ IProject project = file.getProject();
+
+ if (match(file)) {
+ add(project, file);
+ } else {
+ remove(project, file);
+ }
+ }
+
+ boolean match(IFile file) {
+ boolean result = false;
+
+ if (file.isAccessible()) {
+ InputStream input = null;
+
+ try {
+ input = file.getContents(true);
+ IContentType[] contentTypes = mgr.findContentTypesFor(input, file.getName());
+ for (int i = 0; (i < contentTypes.length) && !result; i++) {
+ result = contentTypes[i].isKindOf(contentType);
+ }
+ } catch (Exception e) {
+ Activator.log.error("Failed to index file " + file.getFullPath(), e); //$NON-NLS-1$
+ } finally {
+ if (input != null) {
+ try {
+ input.close();
+ } catch (IOException e) {
+ Activator.log.error("Failed to close indexed file " + file.getFullPath(), e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ void add(IProject project, IFile file) throws CoreException {
+ synchronized (index) {
+ index.put(project, file);
+ file.setSessionProperty(indexKey, indexer.index(file));
+ }
+ }
+
+ void remove(IProject project, IFile file) throws CoreException {
+ synchronized (index) {
+ index.remove(project, file);
+ indexer.unindex(file);
+
+ if (file.exists()) {
+ file.setSessionProperty(indexKey, null);
+ }
+ }
+ }
+
+ void remove(IProject project) throws CoreException {
+ synchronized (index) {
+ if (index.containsKey(project)) {
+ for (IFile next : index.get(project)) {
+ indexer.unindex(next);
+ }
+ index.removeAll(project);
+ }
+ }
+ }
+
+ ReindexProjectJob reindex(IProject project, Iterable<? extends IndexDelta> deltas) {
+ ReindexProjectJob result = null;
+
+ synchronized (activeJobs) {
+ AbstractIndexJob active = activeJobs.get(project);
+
+ if (active != null) {
+ switch (active.kind()) {
+ case REINDEX:
+ @SuppressWarnings("unchecked")
+ ReindexProjectJob reindex = (ReindexProjectJob) active;
+ reindex.addDeltas(deltas);
+ break;
+ case INDEX:
+ @SuppressWarnings("unchecked")
+ IndexProjectJob index = (IndexProjectJob) active;
+ ReindexProjectJob followup = index.getFollowup();
+ if (followup != null) {
+ followup.addDeltas(deltas);
+ } else {
+ followup = new ReindexProjectJob(project, deltas);
+ index.setFollowup(followup);
+ }
+ break;
+ case MASTER:
+ throw new IllegalStateException("Master job is in the active table."); //$NON-NLS-1$
+ }
+ } else {
+ // No active job. We'll need a new one
+ result = new ReindexProjectJob(project, deltas);
+ }
+ }
+
+ return result;
+ }
+
+ IResourceVisitor getWorkspaceVisitor(final IProgressMonitor monitor) {
+ return new IResourceVisitor() {
+
+ @Override
+ public boolean visit(IResource resource) throws CoreException {
+ if (resource.getType() == IResource.FILE) {
+ process((IFile) resource);
+ }
+
+ return !monitor.isCanceled();
+ }
+ };
+ }
+
+ private void schedule(Collection<? extends Job> jobs) {
+ // Synchronize on the active jobs because this potentially alters the wrangler's follow-up job
+ synchronized (activeJobs) {
+ jobWrangler.add(jobs);
+ }
+ }
+
+ public void addListener(IWorkspaceModelIndexListener listener) {
+ listeners.addIfAbsent(listener);
+ }
+
+ public void removeListener(IWorkspaceModelIndexListener listener) {
+ listeners.remove(listener);
+ }
+
+ private void notifyStarting(AbstractIndexJob indexJob) {
+ if (!listeners.isEmpty()) {
+ WorkspaceModelIndexEvent event;
+
+ switch (indexJob.kind()) {
+ case INDEX:
+ event = new WorkspaceModelIndexEvent(this, WorkspaceModelIndexEvent.ABOUT_TO_CALCULATE, indexJob.getProject());
+ for (IWorkspaceModelIndexListener next : listeners) {
+ try {
+ next.indexAboutToCalculate(event);
+ } catch (Exception e) {
+ Activator.log.error("Uncaught exception in index listsner.", e); //$NON-NLS-1$
+ }
+ }
+ break;
+ case REINDEX:
+ event = new WorkspaceModelIndexEvent(this, WorkspaceModelIndexEvent.ABOUT_TO_RECALCULATE, indexJob.getProject());
+ for (IWorkspaceModelIndexListener next : listeners) {
+ try {
+ next.indexAboutToRecalculate(event);
+ } catch (Exception e) {
+ Activator.log.error("Uncaught exception in index listsner.", e); //$NON-NLS-1$
+ }
+ }
+ break;
+ case MASTER:
+ // Pass
+ break;
+ }
+ }
+ }
+
+ private void notifyFinished(AbstractIndexJob indexJob, IStatus status) {
+ if (!listeners.isEmpty()) {
+ WorkspaceModelIndexEvent event;
+
+ if ((status != null) && (status.getSeverity() >= IStatus.ERROR)) {
+ event = new WorkspaceModelIndexEvent(this, WorkspaceModelIndexEvent.FAILED, indexJob.getProject());
+ for (IWorkspaceModelIndexListener next : listeners) {
+ try {
+ next.indexFailed(event);
+ } catch (Exception e) {
+ Activator.log.error("Uncaught exception in index listsner.", e); //$NON-NLS-1$
+ }
+ }
+ } else {
+ switch (indexJob.kind()) {
+ case INDEX:
+ event = new WorkspaceModelIndexEvent(this, WorkspaceModelIndexEvent.CALCULATED, indexJob.getProject());
+ for (IWorkspaceModelIndexListener next : listeners) {
+ try {
+ next.indexCalculated(event);
+ } catch (Exception e) {
+ Activator.log.error("Uncaught exception in index listsner.", e); //$NON-NLS-1$
+ }
+ }
+ break;
+ case REINDEX:
+ event = new WorkspaceModelIndexEvent(this, WorkspaceModelIndexEvent.RECALCULATED, indexJob.getProject());
+ for (IWorkspaceModelIndexListener next : listeners) {
+ try {
+ next.indexRecalculated(event);
+ } catch (Exception e) {
+ Activator.log.error("Uncaught exception in index listsner.", e); //$NON-NLS-1$
+ }
+ }
+ break;
+ case MASTER:
+ // Pass
+ break;
+ }
+ }
+ }
+ }
+
+ //
+ // Nested types
+ //
+
+ /**
+ * Callback interface for the index client to update the index.
+ */
+ public static interface IndexHandler<T> {
+ /**
+ * Updates the index for a file that matches our selection criteria.
+ *
+ * @param file
+ * a file that exists and matches the index selection criteria
+ *
+ * @return the object to store in the index for this {@code file}
+ */
+ T index(IFile file);
+
+ /**
+ * Updates the index for a file that no longer exists or no longer matches our selection criteria.
+ *
+ * @param file
+ * a file that no longer exists or otherwise no longer matches our selection criteria. It is removed from the index
+ */
+ void unindex(IFile file);
+ }
+
+ private enum JobKind {
+ MASTER, INDEX, REINDEX;
+
+ boolean isSystem() {
+ return this != MASTER;
+ }
+ }
+
+ private abstract class AbstractIndexJob extends Job {
+ private final IProject project;
+
+ AbstractIndexJob(String name, IProject project) {
+ super(name);
+
+ this.project = project;
+
+ if (project != null) {
+ setRule(project);
+ synchronized (activeJobs) {
+ if (!activeJobs.containsKey(project)) {
+ activeJobs.put(project, this);
+ }
+ }
+ }
+
+ setSystem(kind().isSystem());
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == WorkspaceModelIndex.this;
+ }
+
+ final IProject getProject() {
+ return project;
+ }
+
+ abstract JobKind kind();
+
+ @Override
+ protected final IStatus run(IProgressMonitor monitor) {
+ IStatus result;
+
+ try {
+ result = doRun(monitor);
+ } finally {
+ synchronized (activeJobs) {
+ AbstractIndexJob followup = getFollowup();
+
+ if (project != null) {
+ if (followup == null) {
+ activeJobs.remove(project);
+ } else {
+ activeJobs.put(project, followup);
+ }
+ }
+
+ if (followup != null) {
+ // Kick off the follow-up job
+ followup.schedule();
+ }
+ }
+ }
+
+ return result;
+ }
+
+ protected abstract IStatus doRun(IProgressMonitor monitor);
+
+ protected AbstractIndexJob getFollowup() {
+ return null;
+ }
+ }
+
+ private class JobWrangler extends AbstractIndexJob {
+ private final Queue<Job> queue = Queues.newArrayDeque();
+ private final Set<Job> pending = Sets.newHashSet();
+ private final Set<IProject> failedProjects = Sets.newHashSet();
+
+ private final Lock pendingLock = new ReentrantLock();
+ private final Condition pendingCheck = pendingLock.newCondition();
+
+ private final int maxPending;
+
+ JobWrangler(int maxConcurrentJobs) {
+ super("Workspace model indexer", null);
+
+ this.maxPending = (maxConcurrentJobs <= 0) ? Integer.MAX_VALUE : maxConcurrentJobs;
+ }
+
+ @Override
+ JobKind kind() {
+ return JobKind.MASTER;
+ }
+
+ void add(Iterable<? extends Job> jobs) {
+ pendingLock.lock();
+
+ try {
+ if (queue.isEmpty() && pending.isEmpty()) {
+ // I am a new job
+ schedule();
+ }
+
+ Iterables.addAll(queue, jobs);
+ pendingCheck.signalAll();
+ } finally {
+ pendingLock.unlock();
+ }
+ }
+
+ @Override
+ protected IStatus doRun(IProgressMonitor monitor) {
+ IJobChangeListener listener = new JobChangeAdapter() {
+ private final Map<IProject, Integer> retries = Maps.newHashMap();
+
+ @Override
+ public void aboutToRun(IJobChangeEvent event) {
+ Job starting = event.getJob();
+
+ if (pending.contains(starting)) {
+ // one of mine is starting
+ @SuppressWarnings("unchecked")
+ AbstractIndexJob indexJob = (AbstractIndexJob) starting;
+ notifyStarting(indexJob);
+ }
+ }
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ pendingLock.lock();
+ try {
+ final Job finished = event.getJob();
+ if (pending.remove(finished)) {
+ // one of mine finished
+ pendingCheck.signalAll();
+
+ @SuppressWarnings("unchecked")
+ AbstractIndexJob indexJob = (AbstractIndexJob) finished;
+ IProject project = indexJob.getProject();
+
+ notifyFinished(indexJob, event.getResult());
+
+ if ((event.getResult() != null) && (event.getResult().getSeverity() >= IStatus.ERROR)) {
+ // Indexing failed to complete. Need to re-build the index
+ if (project != null) {
+ int count = retries.containsKey(project) ? retries.get(project) : 0;
+ if (count++ < MAX_INDEX_RETRIES) {
+ // Only retry up to three times
+ failedProjects.add(project);
+ }
+ retries.put(project, ++count);
+ }
+ }
+ }
+ } finally {
+ pendingLock.unlock();
+ }
+ }
+ };
+
+ getJobManager().addJobChangeListener(listener);
+
+ try {
+ pendingLock.lock();
+
+ try {
+ for (;;) {
+ for (Job next = queue.poll(); next != null; next = queue.poll()) {
+ while (pending.size() >= maxPending) {
+ pendingCheck.awaitUninterruptibly();
+ }
+ pending.add(next);
+ next.schedule();
+ }
+
+ if (pending.isEmpty() && queue.isEmpty()) {
+ if (failedProjects.isEmpty()) {
+ // Done with wrangling jobs, for now
+ break;
+ } else {
+ // Rebuild the index for these projects, from scratch
+ index(failedProjects); // This adds to my queue
+ failedProjects.clear();
+ }
+ } else {
+ // Wait for something new to come into the queue or for the pending set to drain
+ pendingCheck.awaitUninterruptibly();
+ }
+ }
+ } finally {
+ pendingLock.unlock();
+ }
+ } finally {
+ getJobManager().removeJobChangeListener(listener);
+ }
+
+ return Status.OK_STATUS;
+ }
+ }
+
+ private class IndexProjectJob extends AbstractIndexJob {
+ private ReindexProjectJob followup;
+
+ IndexProjectJob(IProject project) {
+ super("Indexing project " + project.getName(), project);
+ }
+
+ @Override
+ JobKind kind() {
+ return JobKind.INDEX;
+ }
+
+ @Override
+ protected IStatus doRun(IProgressMonitor monitor) {
+ IStatus result = Status.OK_STATUS;
+ final IProject project = getProject();
+
+ monitor.beginTask("Indexing models in project " + project.getName(), IProgressMonitor.UNKNOWN);
+
+ try {
+ if (project.isAccessible()) {
+ project.accept(getWorkspaceVisitor(monitor));
+ } else {
+ remove(project);
+ }
+
+ if (monitor.isCanceled()) {
+ result = Status.CANCEL_STATUS;
+ }
+ } catch (CoreException e) {
+ result = e.getStatus();
+ } finally {
+ monitor.done();
+ }
+
+ return result;
+ }
+
+ void setFollowup(ReindexProjectJob followup) {
+ this.followup = followup;
+ }
+
+ @Override
+ protected ReindexProjectJob getFollowup() {
+ return followup;
+ }
+ }
+
+ private class WorkspaceListener implements IResourceChangeListener {
+ @Override
+ public void resourceChanged(IResourceChangeEvent event) {
+ final Multimap<IProject, IndexDelta> deltas = ArrayListMultimap.create();
+
+ try {
+ event.getDelta().accept(new IResourceDeltaVisitor() {
+
+ @Override
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ if (delta.getResource().getType() == IResource.FILE) {
+ IFile file = (IFile) delta.getResource();
+
+ switch (delta.getKind()) {
+ case IResourceDelta.CHANGED:
+ if ((delta.getFlags() & (IResourceDelta.SYNC | IResourceDelta.CONTENT | IResourceDelta.REPLACED)) != 0) {
+ // Re-index in place
+ deltas.put(file.getProject(), new IndexDelta(file, IndexDelta.DeltaKind.REINDEX));
+ }
+ break;
+ case IResourceDelta.REMOVED:
+ deltas.put(file.getProject(), new IndexDelta(file, IndexDelta.DeltaKind.UNINDEX));
+ break;
+ case IResourceDelta.ADDED:
+ deltas.put(file.getProject(), new IndexDelta(file, IndexDelta.DeltaKind.INDEX));
+ break;
+ }
+ }
+ return true;
+ }
+ });
+ } catch (CoreException e) {
+ Activator.log.error("Failed to analyze resource changes for re-indexing.", e); //$NON-NLS-1$
+ }
+
+ if (!deltas.isEmpty()) {
+ List<Job> jobs = Lists.newArrayListWithCapacity(deltas.keySet().size());
+ for (IProject next : deltas.keySet()) {
+ ReindexProjectJob reindex = reindex(next, deltas.get(next));
+ if (reindex != null) {
+ jobs.add(reindex);
+ }
+ }
+ schedule(jobs);
+ }
+ }
+ }
+
+ private static class IndexDelta {
+ private final IFile file;
+
+ private final DeltaKind kind;
+
+ IndexDelta(IFile file, DeltaKind kind) {
+ this.file = file;
+ this.kind = kind;
+ }
+
+ //
+ // Nested types
+ //
+
+ enum DeltaKind {
+ INDEX, REINDEX, UNINDEX
+ }
+ }
+
+ private class ReindexProjectJob extends AbstractIndexJob {
+ private final IProject project;
+ private final ConcurrentLinkedQueue<IndexDelta> deltas;
+
+ ReindexProjectJob(IProject project, Iterable<? extends IndexDelta> deltas) {
+ super("Re-indexing project " + project.getName(), project);
+ this.project = project;
+ this.deltas = Queues.newConcurrentLinkedQueue(deltas);
+ }
+
+ @Override
+ JobKind kind() {
+ return JobKind.REINDEX;
+ }
+
+ void addDeltas(Iterable<? extends IndexDelta> deltas) {
+ Iterables.addAll(this.deltas, deltas);
+ }
+
+ @Override
+ protected IStatus doRun(IProgressMonitor monitor) {
+ IStatus result = Status.OK_STATUS;
+
+ monitor.beginTask("Re-indexing models in project " + project.getName(), IProgressMonitor.UNKNOWN);
+
+ try {
+ for (IndexDelta next = deltas.poll(); next != null; next = deltas.poll()) {
+ if (monitor.isCanceled()) {
+ result = Status.CANCEL_STATUS;
+ break;
+ }
+
+ try {
+ switch (next.kind) {
+ case INDEX:
+ case REINDEX:
+ process(next.file);
+ break;
+ case UNINDEX:
+ remove(project, next.file);
+ break;
+ }
+ } catch (CoreException e) {
+ result = e.getStatus();
+ break;
+ } finally {
+ monitor.worked(1);
+ }
+ }
+ } finally {
+ monitor.done();
+ }
+
+ return result;
+ }
+
+ @Override
+ protected AbstractIndexJob getFollowup() {
+ // If I still have work to do, then I am my own follow-up
+ return deltas.isEmpty() ? null : this;
+ }
+ }
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexAdapter.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexAdapter.java
new file mode 100644
index 00000000000..5f122ae72ff
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexAdapter.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.resource.index;
+
+/**
+ * A convenience superclass for selective call-back implementation in {@link WorkspaceModelIndex} listeners.
+ */
+public class WorkspaceModelIndexAdapter implements IWorkspaceModelIndexListener {
+
+ public WorkspaceModelIndexAdapter() {
+ super();
+ }
+
+ @Override
+ public void indexAboutToRecalculate(WorkspaceModelIndexEvent event) {
+ indexAboutToCalculateOrRecalculate(event);
+ }
+
+ @Override
+ public void indexRecalculated(WorkspaceModelIndexEvent event) {
+ indexCalculatedOrRecalculated(event);
+ }
+
+ @Override
+ public void indexAboutToCalculate(WorkspaceModelIndexEvent event) {
+ indexAboutToCalculateOrRecalculate(event);
+ }
+
+ @Override
+ public void indexCalculated(WorkspaceModelIndexEvent event) {
+ indexCalculatedOrRecalculated(event);
+ }
+
+ @Override
+ public void indexFailed(WorkspaceModelIndexEvent event) {
+ // Pass
+ }
+
+ protected void indexAboutToCalculateOrRecalculate(WorkspaceModelIndexEvent event) {
+ // Pass
+ }
+
+ protected void indexCalculatedOrRecalculated(WorkspaceModelIndexEvent event) {
+ // Pass
+ }
+
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexEvent.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexEvent.java
new file mode 100644
index 00000000000..2bec19dc288
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndexEvent.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.resource.index;
+
+import java.util.EventObject;
+
+import org.eclipse.core.resources.IProject;
+
+/**
+ * Event object notifying {@link IWorkspaceModelIndexListener}s of changes in the index.
+ */
+public class WorkspaceModelIndexEvent extends EventObject {
+
+ /** Event type indicating that the index is about to be re-calculated for some project based on changes in that project. */
+ public static final int ABOUT_TO_RECALCULATE = 0;
+
+ /** Event type indicating that the index has finished re-calculating for some project based on changes in that project. */
+ public static final int RECALCULATED = 1;
+
+ /** Event type indicating that the index is about to be fully calculated for some project. */
+ public static final int ABOUT_TO_CALCULATE = 2;
+
+ /** Event type indicating that the index has finished a full calculation for some project. */
+ public static final int CALCULATED = 3;
+
+ /** Event type indicating that the index (re-)calculation was interrupted or otherwise failed and the index is now out of sync for some project. */
+ public static final int FAILED = 4;
+
+
+ private static final long serialVersionUID = 1L;
+
+ private final int eventType;
+
+ private final IProject project;
+
+ /**
+ * Initializes me.
+ *
+ * @param source
+ * the index that has changed
+ * @param eventType
+ * the kind of change
+ * @param project
+ * the project for which the index changed
+ */
+ public WorkspaceModelIndexEvent(WorkspaceModelIndex<?> source, int eventType, IProject project) {
+ super(source);
+
+ this.eventType = eventType;
+ this.project = project;
+ }
+
+ @Override
+ public WorkspaceModelIndex<?> getSource() {
+ return (WorkspaceModelIndex<?>) super.getSource();
+ }
+
+ public int getEventType() {
+ return eventType;
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFunctions.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFunctions.java
new file mode 100644
index 00000000000..20996f1277f
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFunctions.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.utils;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import com.google.common.base.Function;
+
+/**
+ * Useful Guava {@link Function}s for working with EMF models.
+ */
+public class EMFFunctions {
+
+ private EMFFunctions() {
+ super();
+ }
+
+ /**
+ * Obtains a function that obtains the URI of an EMF object.
+ *
+ * @return an EMF object URI function
+ *
+ * @see EcoreUtil#getURI(EObject)
+ */
+ public static Function<EObject, URI> objectURI() {
+ return new Function<EObject, URI>() {
+ @Override
+ public URI apply(EObject input) {
+ return (input == null) ? null : EcoreUtil.getURI(input);
+ }
+ };
+ }
+
+ /**
+ * Obtains a function that obtains the URI of a resource.
+ *
+ * @return a resource URI function
+ *
+ * @see Resource#getURI()
+ */
+ public static Function<Resource, URI> resourceURI() {
+ return new Function<Resource, URI>() {
+ @Override
+ public URI apply(Resource input) {
+ return (input == null) ? null : input.getURI();
+ }
+ };
+ }
+
+ /**
+ * Obtains a function that trims the fragments of URIs.
+ *
+ * @return a URI fragment trimming function
+ *
+ * @see URI#trimFragment()
+ */
+ public static Function<URI, URI> trimURIFragment() {
+ return new Function<URI, URI>() {
+ @Override
+ public URI apply(URI input) {
+ return (input == null) ? null : input.trimFragment();
+ }
+ };
+ }
+
+ public static Function<EObject, Object> getFeature(final EStructuralFeature feature) {
+ return new Function<EObject, Object>() {
+ @Override
+ public Object apply(EObject input) {
+ return (input == null) ? null : input.eGet(feature);
+ }
+ };
+ }
+
+ public static <T> Function<EObject, T> getFeature(final EStructuralFeature feature, final Class<T> ofType) {
+ return new Function<EObject, T>() {
+ @Override
+ public T apply(EObject input) {
+ return (input == null) ? null : ofType.cast(input.eGet(feature));
+ }
+ };
+ }
+}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFPredicates.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFPredicates.java
new file mode 100644
index 00000000000..18b7a7937e8
--- /dev/null
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFPredicates.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.emf.utils;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+
+import com.google.common.base.Predicate;
+
+/**
+ * Useful Guava {@link Predicate}s for working with EMF models.
+ */
+public class EMFPredicates {
+
+ private EMFPredicates() {
+ super();
+ }
+
+ /**
+ * Obtains a predicate testing that an EMF object is not a proxy. It is formulated this
+ * way on the expectation that usually one would want to filter for objects that aren't
+ * proxies. Otherwise, just do {@code Predicates.not(EMFPredicates.notProxy())}.
+ *
+ * @return a predicate that matches EMF objects that are not proxies
+ *
+ * @see EObject#eIsProxy()
+ */
+ public static Predicate<EObject> notProxy() {
+ return new Predicate<EObject>() {
+ @Override
+ public boolean apply(EObject input) {
+ return (input != null) && !input.eIsProxy();
+ }
+ };
+ }
+
+ /**
+ * Obtains a predicate testing that a resource is loaded.
+ *
+ * @return an is-loaded predicate
+ *
+ * @see Resource#isLoaded()
+ */
+ public static Predicate<Resource> isLoaded() {
+ return new Predicate<Resource>() {
+ @Override
+ public boolean apply(Resource input) {
+ return (input != null) && input.isLoaded();
+ }
+ };
+ }
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ICallableWithProgress.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ICallableWithProgress.java
new file mode 100644
index 00000000000..2efd39b53ed
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ICallableWithProgress.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.tools.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.Callable;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+
+/**
+ * The {@link Callable} analogue of an {@link IRunnableWithProgress}.
+ */
+public interface ICallableWithProgress<V> {
+ /**
+ * Invokes me in a runnable context with a progress monitor.
+ *
+ * @param monitor
+ * the progress monitor to use to display progress and receive
+ * requests for cancellation
+ * @exception InvocationTargetException
+ * if the run method must propagate a checked exception,
+ * it should wrap it inside an <code>InvocationTargetException</code>; runtime exceptions are automatically
+ * wrapped in an <code>InvocationTargetException</code> by the calling context
+ * @exception InterruptedException
+ * if the operation detects a request to cancel,
+ * using <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing <code>InterruptedException</code>
+ *
+ * @see UIUtil#call(IRunnableContext, ICallableWithProgress)
+ * @see IRunnableContext#run
+ */
+ V call(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReferenceCounted.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReferenceCounted.java
new file mode 100644
index 00000000000..6c0444c3086
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReferenceCounted.java
@@ -0,0 +1,175 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.tools.util;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * A convenient reference-counting utility with automatic disposal and asynchronous auto-disposal (intended
+ * for use with the UI event-loop executor service). Sub-classes leveraging the self-disposing behaviour of
+ * the self-owning instance must override the {@link #dispose()} method.
+ */
+public class ReferenceCounted<T> {
+ private final T owner;
+ private final AtomicInteger refCount = new AtomicInteger();
+ private Runnable disposeAction;
+ private final ExecutorService autoReleaseExecutor;
+
+ /**
+ * Initializes me with my owner for which I count references.
+ * <p>
+ * I do not support {@link #autoRelease()}.
+ *
+ * @param owner
+ * my owner
+ * @param disposeAction
+ * action to run when the reference count reaches zero to dispose my {@code owner}
+ *
+ * @throws IllegalArgumentException
+ * if the {@code disposeAction} is {@code null} because, really,
+ * why would you need reference counting for an object that doesn't need to be disposed?
+ */
+ public ReferenceCounted(T owner, Runnable disposeAction) {
+ this(owner, null, disposeAction);
+ }
+
+ /**
+ * Initializes me with my owner for which I count references.
+ * <p>
+ * I support {@link #autoRelease()} using the given executor.
+ *
+ * @param owner
+ * my owner
+ * @param autoReleaseExecutor
+ * the executor on which to schedule auto-release invocations
+ * @param disposeAction
+ * action to run when the reference count reaches zero to dispose my {@code owner}
+ *
+ * @throws IllegalArgumentException
+ * if the {@code disposeAction} is {@code null} because, really,
+ * why would you need reference counting for an object that doesn't need to be disposed?
+ */
+ public ReferenceCounted(T owner, ExecutorService autoReleaseExecutor, Runnable disposeAction) {
+ super();
+
+ if (disposeAction == null) {
+ throw new IllegalArgumentException("null disposeAction"); //$NON-NLS-1$
+ }
+
+ this.owner = owner;
+ this.autoReleaseExecutor = autoReleaseExecutor;
+ this.disposeAction = disposeAction;
+ }
+
+ /**
+ * Initializes me as a self-disposing reference-counted instance. This constructor is only suitable
+ * for chaining from subclasses.
+ * <p>
+ * I do not support {@link #autoRelease()}.
+ */
+ protected ReferenceCounted() {
+ this((ExecutorService) null);
+ }
+
+ /**
+ * Initializes me as a self-disposing reference-counted instance. This constructor is only suitable
+ * for chaining from subclasses.
+ * <p>
+ * I support {@link #autoRelease()} using the given executor.
+ *
+ * @param autoReleaseExecutor
+ * the executor on which to schedule auto-release invocations
+ */
+ @SuppressWarnings("unchecked")
+ protected ReferenceCounted(ExecutorService autoReleaseExecutor) {
+ super();
+
+ this.owner = (T) this;
+ this.disposeAction = new SelfDisposeAction();
+ this.autoReleaseExecutor = autoReleaseExecutor;
+ }
+
+ /**
+ * Retains me, incrementing my retain count. The caller must eventually {@link #release()} me (even if via the {@link #autoRelease()} method)
+ * if I am to become disposable.
+ *
+ * @return my owner, for convenience of call chaining
+ */
+ public final T retain() {
+ refCount.incrementAndGet();
+ return owner;
+ }
+
+ /**
+ * Releases me, decrementing my retain count. When my retain count reaches zero, I dispose myself using the
+ * configured dispose-action runnable.
+ */
+ public final void release() {
+ if (refCount.decrementAndGet() <= 0) {
+ if (disposeAction != null) {
+ try {
+ disposeAction.run();
+ } finally {
+ disposeAction = null;
+ }
+ }
+ }
+ }
+
+ /**
+ * Automatically releases me some time in the future, as determined by the auto-release executor with which
+ * I was configured. A particularly convenient executor is one that posts an asynchronous execution on the
+ * display thread, to automatically dispose my owner (or me, as the case may be) when the display thread
+ * returns to the event loop.
+ *
+ * @return my owner, for convenience of call chaining
+ *
+ * @throws IllegalStateException
+ * if I have no auto-release executor
+ */
+ public final T autoRelease() {
+ if (autoReleaseExecutor == null) {
+ throw new IllegalStateException("no auto-release executor available"); //$NON-NLS-1$
+ }
+
+ // Don't submit the dispose action because we could still be retained!
+ autoReleaseExecutor.execute(new Runnable() {
+
+ public void run() {
+ release();
+ }
+ });
+ return owner;
+ }
+
+ /**
+ * For classes that extend the {@code ReferenceCount}, this must be overridden to implement disposal.
+ * The default implementation throws {@link UnsupportedOperationException} to ensure that subclasses
+ * override it.
+ */
+ protected void dispose() {
+ throw new UnsupportedOperationException("dispose is unimplemented"); //$NON-NLS-1$
+ }
+
+ //
+ // Nested types
+ //
+
+ private class SelfDisposeAction implements Runnable {
+ public void run() {
+ dispose();
+ }
+ }
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/UIUtil.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/UIUtil.java
index a6ea02ed31e..945be4fc150 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/UIUtil.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/UIUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 CEA and others.
+ * Copyright (c) 2014 CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,10 +8,12 @@
*
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
+ * Christian W. Damus - bug 399859
*
*/
package org.eclipse.papyrus.infra.tools.util;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
@@ -19,15 +21,21 @@ import java.util.List;
import java.util.Queue;
import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.Callable;
+import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IMemento;
@@ -53,7 +61,19 @@ public class UIUtil {
* @return the executor
*/
public static ExecutorService createUIExecutor(Display display) {
- return new UIExecutorService(display);
+ return new DisplayExecutorService(display);
+ }
+
+ /**
+ * Create an executor that runs tasks asynchronously on an observable {@link Realm}. If you need synchronous execution, schedule {@link Future}s and {@linkplain Future#get() wait} for them.
+ *
+ * @param realm
+ * the observable realm on which thread to execute tasks
+ *
+ * @return the executor
+ */
+ public static ExecutorService createObservableExecutor(Realm realm) {
+ return new RealmExecutorService(realm);
}
/**
@@ -132,11 +152,97 @@ public class UIUtil {
return asyncCall(Display.getDefault(), callable);
}
+ /**
+ * Calls a {@code callable} in the given {@code context}.
+ *
+ * @param fork
+ * {@code true} if the runnable should be run in a separate thread,
+ * and {@code false} to run in the same thread
+ * @param cancelable
+ * {@code true} to enable the cancellation, and {@code false} to make the operation uncancellable
+ * @param runnable
+ * the runnable to run
+ *
+ * @exception InvocationTargetException
+ * wraps any exception or error which occurs
+ * while running the runnable
+ * @exception InterruptedException
+ * propagated by the context if the runnable
+ * acknowledges cancellation by throwing this exception. This should not be thrown
+ * if {@code cancelable} is {@code false}.
+ */
+ public static <V> V call(IRunnableContext context, boolean fork, boolean cancelable, ICallableWithProgress<V> callable) throws InvocationTargetException, InterruptedException {
+ class RunnableWrapper implements IRunnableWithProgress {
+ final ICallableWithProgress<V> delegate;
+
+ V result;
+
+ RunnableWrapper(ICallableWithProgress<V> delegate) {
+ this.delegate = delegate;
+ }
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ result = delegate.call(monitor);
+ }
+ }
+
+ RunnableWrapper wrapper = new RunnableWrapper(callable);
+ context.run(fork, cancelable, wrapper);
+ return wrapper.result;
+ }
+
+ /**
+ * Obtains a simple executor that asynchronously executes at most one task on the default
+ * display thread. While any task is still pending execution on this executor,
+ * all others are silently discarded. This is useful for cases where, for example, UI
+ * refreshes are posted repeatedly from independent events that aren't aware of each other
+ * but where each refresh task would repeat the same work.
+ *
+ * @param display
+ * a display on which thread to execute tasks
+ *
+ * @return the executor
+ *
+ * @see #createAsyncOnceExecutor(Display)
+ */
+ public static Executor createAsyncOnceExecutor() {
+ return createAsyncOnceExecutor(Display.getDefault());
+ }
+
+ /**
+ * Obtains a simple executor that asynchronously executes at most one task on the given {@code display}'s thread. While any task is still pending execution on this executor,
+ * all others are silently discarded. This is useful for cases where, for example, UI
+ * refreshes are posted repeatedly from independent events that aren't aware of each other
+ * but where each refresh task would repeat the same work.
+ *
+ * @param display
+ * a display on which thread to execute tasks
+ *
+ * @return the executor
+ */
+ public static Executor createAsyncOnceExecutor(final Display display) {
+ return new Executor() {
+ private final AtomicBoolean pending = new AtomicBoolean();
+
+ public void execute(final Runnable task) {
+ if (pending.compareAndSet(false, true)) {
+ display.asyncExec(new Runnable() {
+
+ public void run() {
+ pending.set(false);
+ task.run();
+ }
+ });
+ }
+ }
+ };
+ }
+
//
// Nested types
//
- private static class UIExecutorService extends AbstractExecutorService {
+ private static abstract class UIExecutorService extends AbstractExecutorService {
private final Lock lock = new ReentrantLock();
@@ -144,12 +250,10 @@ public class UIUtil {
private final Queue<RunnableWrapper> pending = new LinkedList<RunnableWrapper>();
- private final Display display;
-
private volatile boolean shutdown;
- UIExecutorService(Display display) {
- this.display = display;
+ UIExecutorService() {
+ super();
}
public void execute(Runnable command) {
@@ -157,9 +261,11 @@ public class UIUtil {
throw new RejectedExecutionException("Executor service is shut down"); //$NON-NLS-1$
}
- display.asyncExec(enqueue(command));
+ asyncExec(enqueue(command));
}
+ abstract void asyncExec(Runnable runnable);
+
public List<Runnable> shutdownNow() {
List<Runnable> result = new ArrayList<Runnable>();
@@ -286,4 +392,34 @@ public class UIUtil {
}
}
};
+
+ private static class DisplayExecutorService extends UIExecutorService {
+ private final Display display;
+
+ DisplayExecutorService(Display display) {
+ super();
+
+ this.display = display;
+ }
+
+ @Override
+ void asyncExec(Runnable runnable) {
+ display.asyncExec(runnable);
+ }
+ }
+
+ private static class RealmExecutorService extends UIExecutorService {
+ private final Realm realm;
+
+ RealmExecutorService(Realm realm) {
+ super();
+
+ this.realm = realm;
+ }
+
+ @Override
+ void asyncExec(Runnable runnable) {
+ realm.asyncExec(runnable);
+ }
+ }
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java
index e5068461254..e989776a7c0 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 Atos.
- *
+ * Copyright (c) 2013, 2014 Atos, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Arthur Daussy (Atos) arthur.daussy@atos.net - Initial API and implementation
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.services.controlmode.commands;
@@ -55,7 +55,15 @@ public class CreateControlResource extends AbstractControlResourceCommand {
Resource resource = getResourceSet().getResource(getTargetUri(), false);
boolean resourceInSet = resource != null;
if (resourceInSet) {
- return CommandResult.newErrorCommandResult("The resource is already in the resource set");
+ if (failedToLoadBecauseNonexistent(resource)) {
+ // It doesn't exist, so by re-creating it we may actually help to fix unresolved proxies
+ // (such as from an out-of-date sash model)
+ resource.getResourceSet().getResources().remove(resource);
+ resource = null;
+ resourceInSet = false;
+ } else {
+ return CommandResult.newErrorCommandResult("The resource is already in the resource set");
+ }
}
Resource newResource = getResourceSet().createResource(getTargetUri());
if (newResource == null) {
@@ -70,6 +78,17 @@ public class CreateControlResource extends AbstractControlResourceCommand {
return CommandResult.newOKCommandResult(newResource);
}
+ boolean failedToLoadBecauseNonexistent(Resource resource) {
+ boolean result = false;
+
+ if (resource.getContents().isEmpty() && !resource.getErrors().isEmpty()) {
+ // Does it exist to load it?
+ result = !resource.getResourceSet().getURIConverter().exists(resource.getURI(), null);
+ }
+
+ return result;
+ }
+
@Override
protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
IStatus superStatus = super.doUndo(monitor, info);
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IControlCommandParticipant.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IControlCommandParticipant.java
index b121fdd4830..e9f6e8ede2c 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IControlCommandParticipant.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IControlCommandParticipant.java
@@ -1,5 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2013 Atos.
+ * Copyright (c) 2013, 2014 Atos, Christian W. Damus, and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +8,8 @@
*
* Contributors:
* Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
+ * Christian W. Damus - bug 399859
+ *
******************************************************************************/
package org.eclipse.papyrus.infra.services.controlmode.participants;
@@ -35,7 +38,8 @@ public interface IControlCommandParticipant extends IControlModeParticipant {
/**
* Ask the participant for command that will be executed before the control command
- * The returned command should not be null (use {@link UnexecutableCommand}
+ * The returned command should be {@code null} if no pre-control command is
+ * required (an {@link UnexecutableCommand} blocks all pre-control execution).
*
* @param request
* @return
@@ -44,7 +48,9 @@ public interface IControlCommandParticipant extends IControlModeParticipant {
/**
* Ask the participant for command that will be executed after the control command
- *
+ * The returned command should be {@code null} if no post-control command is
+ * required (an {@link UnexecutableCommand} blocks all post-control execution).
+ *
* @param request
* @return
*/
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IUncontrolCommandParticipant.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IUncontrolCommandParticipant.java
index 791f1b014cb..4bfaacadce7 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IUncontrolCommandParticipant.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/participants/IUncontrolCommandParticipant.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 Atos.
- *
+ * Copyright (c) 2013, 2014 Atos, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,11 +8,13 @@
*
* Contributors:
* Arthur Daussy (Atos) arthur.daussy@atos.net - Initial API and implementation
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.services.controlmode.participants;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
/**
@@ -33,16 +34,20 @@ public interface IUncontrolCommandParticipant extends IControlModeParticipant {
public boolean provideUnControlCommand(ControlModeRequest request);
/**
- * Ask the participant for command that will be executed before the control/uncontrol command
- *
+ * Ask the participant for command that will be executed before the uncontrol command
+ * The returned command should be {@code null} if no pre-uncontrol command is
+ * required (an {@link UnexecutableCommand} blocks all pre-uncontrol execution).
+ *
* @param request
* @return
*/
public ICommand getPreUncontrolCommand(ControlModeRequest request);
/**
- * Ask the participant for command that will be executed after the control/uncontrol command
- *
+ * Ask the participant for command that will be executed after the uncontrol command
+ * The returned command should be {@code null} if no post-uncontrol command is
+ * required (an {@link UnexecutableCommand} blocks all post-uncontrol execution).
+ *
* @param request
* @return
*/
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
index 0002e105505..1c9ecd9e80d 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
+ * Copyright (c) 2010, 2014 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 402525
+ * Christian W. Damus - bug 399859
*
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
@@ -21,6 +22,7 @@ import org.eclipse.core.databinding.observable.IChangeListener;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -246,8 +248,10 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
remove.setEnabled(!readOnly);
up.setEnabled(ordered && !readOnly);
down.setEnabled(ordered && !readOnly);
- edit.setEnabled(this.referenceFactory != null && referenceFactory.canEdit() && !readOnly);
+ if (edit != null) {
+ edit.setEnabled(this.referenceFactory != null && referenceFactory.canEdit() && !readOnly);
+ }
if (modelProperty != null && this.upperBound != MANY) {
if (modelProperty.size() >= this.upperBound) {
@@ -312,7 +316,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param labelProvider
* The label provider for this editor
*/
- public void setLabelProvider(ILabelProvider labelProvider) {
+ public void setLabelProvider(IBaseLabelProvider labelProvider) {
treeViewer.setLabelProvider(labelProvider);
}
@@ -578,7 +582,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
*/
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- if (e.widget == tree && edit.isEnabled()) {
+ if ((e.widget == tree) && (edit != null) && edit.isEnabled()) {
editAction();
}
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingLabelProvider.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingLabelProvider.java
index 16d174f58c2..cdfdef64464 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingLabelProvider.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingLabelProvider.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,11 +8,15 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 399859
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.providers;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.swt.graphics.Image;
/**
@@ -20,14 +24,17 @@ import org.eclipse.swt.graphics.Image;
* possibility of overriding certain labels.
*/
public class DelegatingLabelProvider
- implements ILabelProvider {
+ extends LabelProvider {
private final ILabelProvider delegate;
+ private ILabelProviderListener forwardingListener;
public DelegatingLabelProvider(ILabelProvider delegate) {
super();
this.delegate = delegate;
+
+ delegate.addListener(getForwardingListener());
}
@Override
@@ -98,7 +105,21 @@ public class DelegatingLabelProvider
*/
@Override
public void dispose() {
+ delegate.removeListener(getForwardingListener());
delegate.dispose();
}
+ private ILabelProviderListener getForwardingListener() {
+ if (forwardingListener == null) {
+ forwardingListener = new ILabelProviderListener() {
+
+ @Override
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(DelegatingLabelProvider.this, event.getElements()));
+ }
+ };
+ }
+
+ return forwardingListener;
+ }
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingStyledLabelProvider.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingStyledLabelProvider.java
new file mode 100644
index 00000000000..b08a0ac5b89
--- /dev/null
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/providers/DelegatingStyledLabelProvider.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.widgets.providers;
+
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+
+/**
+ * A styled label provider that delegates to another styled label provider with the option to override certain labels.
+ */
+public class DelegatingStyledLabelProvider extends DelegatingLabelProvider implements IStyledLabelProvider {
+
+ private final IStyledLabelProvider delegate;
+
+ public DelegatingStyledLabelProvider(ILabelProvider delegate) {
+ super(delegate);
+
+ if (!(delegate instanceof IStyledLabelProvider)) {
+ throw new IllegalArgumentException("delegate is not a styled label provider"); //$NON-NLS-1$
+ }
+
+ this.delegate = (IStyledLabelProvider) delegate;
+ }
+
+ @Override
+ public StyledString getStyledText(Object element) {
+ StyledString result = customGetStyledText(element);
+ if (result == null) {
+ result = delegatedGetStyledText(element);
+ }
+ return result;
+ }
+
+ /**
+ * Override in subclasses to return custom styled text to override the delegate.
+ * The default implementation simply returns {@code null}.
+ *
+ * @param element
+ * an element for which to provide styled text
+ * @return the custom styled text, or {@code null} to delegate
+ */
+ protected StyledString customGetStyledText(Object element) {
+ return null;
+ }
+
+ protected final StyledString delegatedGetStyledText(Object element) {
+ return delegate.getStyledText(element);
+ }
+}
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.classpath b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.classpath
index ad32c83a788..ad32c83a788 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.classpath
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.classpath
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.project b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.project
index f90bdf8616c..3e210335afd 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.tests/.project
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.papyrus.uml.profile.externalresource.tests</name>
+ <name>org.eclipse.papyrus.uml.decoratormodel.controlmode</name>
<comment></comment>
<projects>
</projects>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..94d61f00da6
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.ui.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/META-INF/MANIFEST.MF b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..bd31b94d679
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.uml.decoratormodel.controlmode;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.Activator
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;bundle-version="2.10.0";visibility:=reexport,
+ org.eclipse.uml2.types;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
+ org.eclipse.uml2.uml;visibility:=reexport,
+ org.eclipse.uml2.common;visibility:=reexport,
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.1.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.uml.decoratormodel;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.1.0",
+ org.eclipse.ui;bundle-version="3.107.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.uml.decoratormodel.internal.controlmode;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;x-internal:=true
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/about.html b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/about.html
index d35d5aed64c..d35d5aed64c 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/about.html
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/about.html
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/build.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/build.properties
index 4b957fe857b..ec9cbd2972b 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/build.properties
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/build.properties
@@ -4,4 +4,6 @@ bin.includes = META-INF/,\
.,\
about.html,\
documentation.pdoc,\
- plugin.xml
+ plugin.xml,\
+ plugin.properties
+src.includes = about.html
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/documentation.pdoc b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/documentation.pdoc
new file mode 100644
index 00000000000..9c2acff120a
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/documentation.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="Control-mode participants for management of externalized profile applications.">
+ <referent firstName="Christian" lastName="Damus" eMail="give.a.damus@gmail.com" currentCompany="independent"/>
+</doc:Documentation>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.properties
new file mode 100644
index 00000000000..a1a12f40362
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.properties
@@ -0,0 +1,12 @@
+# Copyright (c) 2014 Christian W. Damus and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Christian W. Damus - Initial API and implementation
+
+pluginName = Papyrus Decorator Models Control Mode Extensions
+providerName = Eclipse Modeling Project
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.xml
new file mode 100644
index 00000000000..d30b4fae382
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.services.controlmode.participant">
+ <participant
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.DecoratorModelControlModeParticipant">
+ </participant>
+ </extension>
+
+</plugin>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/pom.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/pom.xml
new file mode 100644
index 00000000000..666d54e42e5
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../releng/top-pom-main.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.decoratormodel.controlmode</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/Activator.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/Activator.java
new file mode 100644
index 00000000000..f5898c8bdc0
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/Activator.java
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ * Copyright (c) 2013, 2014 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ * Christian W. Damus - bug 399859
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode;
+
+import java.util.concurrent.ExecutorService;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.infra.tools.util.UIUtil;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.decoratormodel.controlmode"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /** logger helper */
+ public static LogHelper log;
+
+ private ExecutorService executorService;
+
+ public Activator() {
+ super();
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ executorService = UIUtil.createUIExecutor(Display.getDefault());
+
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ executorService.shutdown();
+ executorService = null;
+
+ plugin = null;
+ log = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ IWorkbenchWindow result = null;
+
+ IWorkbench bench = PlatformUI.getWorkbench();
+ if (bench != null) {
+ result = bench.getActiveWorkbenchWindow();
+ if (result == null) {
+ IWorkbenchWindow[] allWindows = bench.getWorkbenchWindows();
+ if (allWindows.length > 0) {
+ result = allWindows[0];
+ }
+ }
+ }
+
+ return result;
+ }
+
+ public ExecutorService getExecutorService() {
+ return executorService;
+ }
+
+ /**
+ * Changes my executor service for asynchronous processing in control-mode refactorings.
+ *
+ * @param executorService
+ * the new executor service. Must not be {@code null}
+ *
+ * @return the formerly installed executor service (please restore it when you have finished with yours)
+ *
+ * @throws IllegalArgumentException
+ * if {@code executorService} is {@code null}
+ */
+ public ExecutorService setExecutorService(ExecutorService executorService) {
+ if (executorService == null) {
+ throw new IllegalArgumentException("null executorService"); //$NON-NLS-1$
+ }
+
+ ExecutorService result = this.executorService;
+ this.executorService = executorService;
+ return result;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/DecoratorModelControlModeParticipant.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/DecoratorModelControlModeParticipant.java
new file mode 100644
index 00000000000..53a0c916d56
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/DecoratorModelControlModeParticipant.java
@@ -0,0 +1,142 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode;
+
+import static org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext.getPackagesBeingControlled;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
+import org.eclipse.papyrus.infra.services.controlmode.participants.IControlCommandParticipant;
+import org.eclipse.papyrus.infra.services.controlmode.participants.IUncontrolCommandParticipant;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands.ConfirmSaveCommand;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands.DecoratorModelRefactoringCommandFactory;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * Control-mode participant for handling dependent decorator models that apply profiles to the
+ * package(s) being controlled in new resource(s).
+ */
+public class DecoratorModelControlModeParticipant implements IControlCommandParticipant, IUncontrolCommandParticipant {
+ static final String PARTICIPANT_ID = Activator.PLUGIN_ID + ".participant"; //$NON-NLS-1$
+
+ public DecoratorModelControlModeParticipant() {
+ super();
+ }
+
+ @Override
+ public String getID() {
+ return PARTICIPANT_ID;
+ }
+
+ @Override
+ public int getPriority() {
+ // We really want this to be the last participant to run, both in control and uncontrol cases
+ return -100;
+ }
+
+ @Override
+ public boolean provideControlCommand(ControlModeRequest request) {
+ return hasExternalProfileApplications(request, true);
+ }
+
+ @Override
+ public ICommand getPreControlCommand(ControlModeRequest request) {
+ // Refactoring is done as a post-process
+ ICommand result = null;
+
+ if (request.isUIAction() && hasExternalProfileApplications(request, false)) {
+ // Refactoring will require save, so prompt the user
+ result = new ConfirmSaveCommand(Activator.getActiveWorkbenchWindow().getShell());
+ }
+
+ try {
+ result = CompositeCommand.compose(result, DecoratorModelRefactoringCommandFactory.createPreCommand(request));
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ result = new UnexecutableCommand(e.getStatus());
+ }
+
+ return result;
+ }
+
+ @Override
+ public ICommand getPostControlCommand(ControlModeRequest request) {
+ try {
+ return DecoratorModelRefactoringCommandFactory.createPostCommand(request);
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ return new UnexecutableCommand(e.getStatus());
+ }
+ }
+
+ @Override
+ public boolean provideUnControlCommand(ControlModeRequest request) {
+ return hasExternalProfileApplications(request, true);
+ }
+
+ @Override
+ public ICommand getPreUncontrolCommand(ControlModeRequest request) {
+ // Refactoring is done as a post-process
+ ICommand result = null;
+
+ if (request.isUIAction() && hasExternalProfileApplications(request, false)) {
+ // Refactoring will require save, so prompt the user
+ result = new ConfirmSaveCommand(Activator.getActiveWorkbenchWindow().getShell());
+ }
+
+ try {
+ result = CompositeCommand.compose(result, DecoratorModelRefactoringCommandFactory.createPreCommand(request));
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ result = new UnexecutableCommand(e.getStatus());
+ }
+
+ return result;
+ }
+
+ @Override
+ public ICommand getPostUncontrolCommand(ControlModeRequest request) {
+ try {
+ return DecoratorModelRefactoringCommandFactory.createPostCommand(request);
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ return new UnexecutableCommand(e.getStatus());
+ }
+ }
+
+ protected boolean hasExternalProfileApplications(ControlModeRequest request, boolean includeLoaded) {
+ boolean result = false;
+
+ for (Package next : getPackagesBeingControlled(request.getTargetObject())) {
+ try {
+ result = !DecoratorModelUtils.getAllDecoratorModelAppliedProfileDefinitions(next, includeLoaded, true).isEmpty();
+ } catch (CoreException e) {
+ // Assume that some refactoring is needed (the commands may later fail or, hopefully,
+ // find nothing to do)
+ result = true;
+ Activator.getDefault().getLog().log(e.getStatus());
+ }
+
+ if (result) {
+ break;
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/PackageRefactoringContext.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/PackageRefactoringContext.java
new file mode 100644
index 00000000000..2bd604621c9
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/PackageRefactoringContext.java
@@ -0,0 +1,265 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.infra.emf.utils.EMFFunctions;
+import org.eclipse.papyrus.infra.emf.utils.EMFPredicates;
+import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
+import org.eclipse.papyrus.infra.tools.util.ReferenceCounted;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelIndex;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+import org.eclipse.uml2.uml.UMLPackage;
+
+import com.google.common.base.Functions;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.MapMaker;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+/**
+ * Contextual information about the control/uncontrol refactoring of a package
+ * that informs the refactoring of dependent decorator models.
+ */
+public class PackageRefactoringContext extends ReferenceCounted<PackageRefactoringContext> {
+ private static Map<Package, PackageRefactoringContext> contexts = new MapMaker().weakKeys().weakValues().makeMap();
+
+ private final Package package_;
+ private final URI oldUserModelURI;
+ private final URI newUserModelURI;
+
+ private final TransactionalEditingDomain domain;
+ private final Set<Package> affectedPackages;
+ private final Set<ProfileApplication> preRefactoringProfileApplications;
+
+ // Map of profile URI to decorator-model URI to applied definition URI
+ private final Map<URI, Map<URI, URI>> allExternalAppliedProfiles;
+ // Just those that are inherited from the parent package
+ private final Map<URI, Map<URI, URI>> inheritedExternalAppliedProfiles;
+
+ private final Set<URI> affectedDecoratorModels;
+ private final Set<URI> affectedLoadedDecoratorModels;
+ private final Set<URI> affectedUnloadedDecoratorModels;
+
+ private Map<Object, Object> data;
+
+ private PackageRefactoringContext(Package package_, URI oldUserModelURI, URI newUserModelURI) {
+ super(Activator.getDefault().getExecutorService());
+
+ this.package_ = package_;
+ this.oldUserModelURI = oldUserModelURI;
+ this.newUserModelURI = newUserModelURI;
+
+ this.domain = TransactionUtil.getEditingDomain(package_);
+ this.affectedPackages = ImmutableSet.copyOf(getPackagesBeingControlled(package_));
+ this.preRefactoringProfileApplications = ImmutableSet.copyOf(package_.getProfileApplications());
+
+ // Find URIs of decorator models attached to these packages and all their ancestors because
+ // all of those profiles are applied to these packages, except for any that are loaded
+ // because their proxies will take care of themselves
+
+ Set<Package> allPackages = Sets.newHashSet(affectedPackages);
+ for (Package next : affectedPackages) {
+ allPackages.addAll(next.allOwningPackages());
+ }
+
+ Set<URI> decorators = Sets.newHashSet();
+ Map<URI, Map<URI, URI>> allExternal = null;
+ Map<URI, Map<URI, URI>> inheritedExternal = null;
+ try {
+ allExternal = DecoratorModelUtils.getAllDecoratorModelAppliedProfileDefinitions(package_);
+ if (package_.getNestingPackage() != null) {
+ inheritedExternal = DecoratorModelUtils.getAllDecoratorModelAppliedProfileDefinitions(package_.getNestingPackage());
+ }
+
+ for (Package next : allPackages) {
+ decorators.addAll(DecoratorModelIndex.getInstance().getDecoratorModelsForPackage(EcoreUtil.getURI(next)));
+ }
+ } catch (CoreException e) {
+ // TODO
+ Activator.getDefault().getLog().log(e.getStatus());
+ allExternal = Collections.emptyMap();
+ }
+
+ this.allExternalAppliedProfiles = (allExternal != null) ? allExternal : Collections.<URI, Map<URI, URI>> emptyMap();
+ this.inheritedExternalAppliedProfiles = (inheritedExternal != null) ? inheritedExternal : Collections.<URI, Map<URI, URI>> emptyMap();
+ this.affectedDecoratorModels = ImmutableSet.copyOf(decorators);
+
+ Set<URI> allLoaded = Sets.newHashSet(Iterables.transform(Iterables.filter(domain.getResourceSet().getResources(), EMFPredicates.isLoaded()), EMFFunctions.resourceURI()));
+ this.affectedLoadedDecoratorModels = ImmutableSet.copyOf(Sets.intersection(decorators, allLoaded));
+ decorators.removeAll(allLoaded);
+ this.affectedUnloadedDecoratorModels = ImmutableSet.copyOf(decorators);
+ }
+
+ static PackageRefactoringContext get(Package package_, ControlModeRequest request) {
+ PackageRefactoringContext result = contexts.get(package_);
+
+ if (result == null) {
+ result = new PackageRefactoringContext(package_, request.getSourceURI(), request.getNewURI());
+ contexts.put(package_, result);
+ }
+
+ return result;
+ }
+
+ static void remove(PackageRefactoringContext context) {
+ if (contexts.get(context.getPackage()) == context) {
+ contexts.remove(context.getPackage());
+ }
+ }
+
+ /**
+ * Obtains the current package refactoring context for the specified {@code request}, if any.
+ * <b>Note</b> that this method {@linkplain ReferenceCounted#retain() retains} the resulting context.
+ *
+ * @param request
+ * a request
+ * @return the retained context, or {@code null} if none
+ */
+ public static PackageRefactoringContext getInstance(ControlModeRequest request) {
+ return (request.getTargetObject() instanceof Package) ? get((Package) request.getTargetObject(), request).retain() : null;
+ }
+
+ @Override
+ protected void dispose() {
+ remove(this);
+ data = null;
+ }
+
+ public TransactionalEditingDomain getEditingDomain() {
+ return domain;
+ }
+
+ public Package getPackage() {
+ return package_;
+ }
+
+ public URI getOldUserModelURI() {
+ return oldUserModelURI;
+ }
+
+ public URI getNewUserModelURI() {
+ return newUserModelURI;
+ }
+
+ public Set<ProfileApplication> getPreRefactoringProfileApplications() {
+ return preRefactoringProfileApplications;
+ }
+
+ public Set<Profile> getPreRefactoringAppliedProfiles() {
+ return ImmutableSet.copyOf(Collections2.transform(getPreRefactoringProfileApplications(), //
+ EMFFunctions.getFeature(UMLPackage.Literals.PROFILE_APPLICATION__APPLIED_PROFILE, Profile.class)));
+ }
+
+ public Set<URI> getPreRefactoringAppliedProfileURIs() {
+ return ImmutableSet.copyOf(Collections2.transform(getPreRefactoringProfileApplications(), //
+ Functions.compose(EMFFunctions.objectURI(), EMFFunctions.getFeature(UMLPackage.Literals.PROFILE_APPLICATION__APPLIED_PROFILE, Profile.class))));
+ }
+
+ public Set<ProfileApplication> getPostRefactoringProfileApplications() {
+ return Sets.difference(Sets.newHashSet(package_.getProfileApplications()), preRefactoringProfileApplications);
+ }
+
+ public Set<Profile> getPostRefactoringAppliedProfiles() {
+ return ImmutableSet.copyOf(Collections2.transform(getPostRefactoringProfileApplications(), //
+ EMFFunctions.getFeature(UMLPackage.Literals.PROFILE_APPLICATION__APPLIED_PROFILE, Profile.class)));
+ }
+
+ public Set<URI> getPostRefactoringAppliedProfileURIs() {
+ return ImmutableSet.copyOf(Collections2.transform(getPostRefactoringProfileApplications(), //
+ Functions.compose(EMFFunctions.objectURI(), EMFFunctions.getFeature(UMLPackage.Literals.PROFILE_APPLICATION__APPLIED_PROFILE, Profile.class))));
+ }
+
+ public Set<Package> getAffectedPackages() {
+ return affectedPackages;
+ }
+
+ public Map<URI, Map<URI, URI>> getAllExternalProfileApplications() {
+ return allExternalAppliedProfiles;
+ }
+
+ public Map<URI, Map<URI, URI>> getInheritedExternalProfileApplications() {
+ return inheritedExternalAppliedProfiles;
+ }
+
+ public Set<URI> getAffectedDecoratorModels() {
+ return affectedDecoratorModels;
+ }
+
+ public Set<URI> getAffectedLoadedDecoratorModels() {
+ return affectedLoadedDecoratorModels;
+ }
+
+ public Set<URI> getAffectedUnloadedDecoratorModels() {
+ return affectedUnloadedDecoratorModels;
+ }
+
+ public Map<URI, URI> getAllExternalProfileApplicationsFor(URI decoratorModelURI) {
+ return getExternalProfileApplicationsFor(decoratorModelURI, getAllExternalProfileApplications());
+ }
+
+ public Map<URI, URI> getInheritedExternalProfileApplicationsFor(URI decoratorModelURI) {
+ return getExternalProfileApplicationsFor(decoratorModelURI, getInheritedExternalProfileApplications());
+ }
+
+ private Map<URI, URI> getExternalProfileApplicationsFor(URI decoratorModelURI, Map<URI, Map<URI, URI>> source) {
+ ImmutableMap.Builder<URI, URI> result = ImmutableMap.builder();
+
+ for (Map.Entry<URI, Map<URI, URI>> next : source.entrySet()) {
+ URI definition = next.getValue().get(decoratorModelURI);
+ if (definition != null) {
+ result.put(next.getKey(), definition);
+ }
+ }
+
+ return result.build();
+ }
+
+ public static Iterable<Package> getPackagesBeingControlled(final EObject object) {
+ return new Iterable<Package>() {
+
+ @Override
+ public Iterator<Package> iterator() {
+ // The "proper contents" includes containment proxies until such time as they are resolved.
+ // So, filter them out
+ Iterator<EObject> properContents = EcoreUtil.getAllProperContents(Collections.singletonList(object), false);
+ return Iterators.filter(Iterators.filter(properContents, Package.class), EMFPredicates.notProxy());
+ }
+ };
+ }
+
+ public Map<Object, Object> getContextData() {
+ if (data == null) {
+ data = Maps.newHashMap();
+ }
+ return data;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/AbstractDecoratorModelRefactoringCommand.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/AbstractDecoratorModelRefactoringCommand.java
new file mode 100644
index 00000000000..d42cae0b990
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/AbstractDecoratorModelRefactoringCommand.java
@@ -0,0 +1,143 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.IRefactoringStep;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Common implementation of the commands that refactor loaded and unloaded dependent decorator models for the changes
+ * in the URIs of the base elements of stereotype applications and adding/removing profile applications for
+ * stand-along usage of the user-model controlled units.
+ */
+abstract class AbstractDecoratorModelRefactoringCommand extends AbstractCommand {
+
+ private final List<IRefactoringStep> steps = Lists.newArrayListWithExpectedSize(2);
+
+ private final DirectionConstraint direction;
+
+ private final URI decoratorModelURI;
+
+ protected AbstractDecoratorModelRefactoringCommand(PackageRefactoringContext context, URI decoratorModelURI) {
+ this(context, decoratorModelURI, DirectionConstraint.ALL);
+ }
+
+ protected AbstractDecoratorModelRefactoringCommand(PackageRefactoringContext context, URI decoratorModelURI, DirectionConstraint direction) {
+ super(NLS.bind(Messages.AbstractDecoratorModelRefactoringCommand_0, decoratorModelURI), getIFiles(decoratorModelURI));
+
+ this.direction = direction;
+ this.decoratorModelURI = decoratorModelURI;
+ }
+
+ public AbstractDecoratorModelRefactoringCommand addStep(IRefactoringStep step) {
+ steps.add(step);
+ return this;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ SubMonitor sub = SubMonitor.convert(monitor, steps.size());
+
+ if (!direction.canRefactor()) {
+ sub.done();
+ } else {
+ ResourceSet rset = getResourceSet();
+ try {
+ Resource resource = getResource(rset, decoratorModelURI);
+ if ((resource != null) && resource.isLoaded()) {
+ boolean changed = false;
+
+ // If the resource is not loaded, something didn't go right in the basic control step
+ for (ListIterator<IRefactoringStep> iter = steps.listIterator(); iter.hasNext();) {
+ changed = iter.next().refactor(resource, sub.newChild(1)) || changed;
+ }
+
+ resourceRefactored(resource, changed);
+ }
+ } finally {
+ disposeResourceSet(rset);
+ sub.done();
+ }
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ protected abstract ResourceSet getResourceSet();
+
+ protected abstract Resource getResource(ResourceSet resourceSet, URI decoratorModelURI);
+
+ protected abstract void resourceRefactored(Resource resource, boolean changed) throws ExecutionException;
+
+ protected abstract void disposeResourceSet(ResourceSet resourceSet);
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ SubMonitor sub = SubMonitor.convert(monitor, steps.size());
+
+ if (!direction.canUnrefactor()) {
+ sub.done();
+ } else {
+ ResourceSet rset = getResourceSet();
+ try {
+ Resource resource = getResource(rset, decoratorModelURI);
+ if ((resource != null) && resource.isLoaded()) {
+ boolean changed = false;
+
+ // If the resource is not loaded, something didn't go right in the basic control step
+ for (ListIterator<IRefactoringStep> iter = steps.listIterator(steps.size()); iter.hasPrevious();) {
+ changed = iter.previous().unrefactor(resource, sub.newChild(1)) || changed;
+ }
+
+ resourceRefactored(resource, changed);
+ }
+ } finally {
+ disposeResourceSet(rset);
+ sub.done();
+ }
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return doExecuteWithResult(monitor, info);
+ }
+
+ private static List<IFile> getIFiles(URI decoratorModel) {
+ return Collections.singletonList(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(decoratorModel.toPlatformString(true))));
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/ConfirmSaveCommand.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/ConfirmSaveCommand.java
new file mode 100644
index 00000000000..196f131e2ca
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/ConfirmSaveCommand.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A command that prompts the user to confirm the need to save and fails with cancel status if the user elects not to proceed.
+ */
+public class ConfirmSaveCommand extends AbstractCommand {
+ private Shell parentShell;
+
+ public ConfirmSaveCommand(Shell parentShell) {
+ super(Messages.ConfirmSaveCommand_0);
+
+ this.parentShell = parentShell;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ if (MessageDialog.openQuestion(parentShell, Messages.ConfirmSaveCommand_1, Messages.ConfirmSaveCommand_2)) {
+ return CommandResult.newOKCommandResult();
+ } else {
+ return CommandResult.newCancelledCommandResult();
+ }
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // User already confirmed execution; that is sufficient
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // User already confirmed execution; that is sufficient
+ return CommandResult.newOKCommandResult();
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DecoratorModelRefactoringCommandFactory.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DecoratorModelRefactoringCommandFactory.java
new file mode 100644
index 00000000000..62ada47e4c0
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DecoratorModelRefactoringCommandFactory.java
@@ -0,0 +1,236 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.AbstractDecoratorModelUpdater;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.CrossReferenceUpdater;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.LoadedDecoratorModelUpdaterDelegate;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.PostControlDecoratorModelUpdater;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.PostUncontrolDecoratorModelUpdater;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters.UnloadedDecoratorModelUpdaterDelegate;
+
+/**
+ * Factory for control-mode participant commands that refactor loaded and unloaded decorator model resources
+ * according to the changing URIs of referenced objects.
+ */
+public class DecoratorModelRefactoringCommandFactory {
+ private DecoratorModelRefactoringCommandFactory() {
+ super();
+ }
+
+ public static ICommand createPreCommand(ControlModeRequest request) throws CoreException {
+ PackageRefactoringContext context = PackageRefactoringContext.getInstance(request);
+ if (context == null) {
+ return null;
+ }
+
+ boolean needsSave = false;
+ CompositeTransactionalCommand result = new CompositeTransactionalCommand(context.getEditingDomain(), Messages.DecoratorModelRefactoringCommandFactory_0);
+
+ // Gather up all the loaded decorator models and create a command for each
+ for (URI decoratorModel : context.getAffectedLoadedDecoratorModels()) {
+ ICommand refactoringCommand = request.isControlRequest() ?
+ createPreControlLoaded(context, decoratorModel) :
+ createPreUncontrolLoaded(context, decoratorModel);
+ if (refactoringCommand != null) {
+ result.add(refactoringCommand);
+ }
+ }
+
+ // Gather up all the unloaded decorator models and create a command for each
+ for (URI decoratorModel : context.getAffectedUnloadedDecoratorModels()) {
+ ICommand refactoringCommand = request.isControlRequest() ?
+ createPreControlUnloaded(context, decoratorModel) :
+ createPreUncontrolUnloaded(context, decoratorModel);
+ if (refactoringCommand != null) {
+ result.add(refactoringCommand);
+ needsSave = true;
+ }
+ }
+
+ if (result.isEmpty()) {
+ // Didn't need any command after all. Fine
+ result = null;
+ } else if (needsSave) {
+ // Must save the model to ensure that the refactoring of unloaded resources is consistent
+ result.add(new SaveModelCommand(context));
+ }
+
+ context.autoRelease();
+
+ return result;
+ }
+
+ private static RefactoringStepStore getStore(PackageRefactoringContext context, URI decoratorModel) {
+ RefactoringStepStore result = (RefactoringStepStore) context.getContextData().get(decoratorModel);
+ if (result == null) {
+ result = new RefactoringStepStore();
+ context.getContextData().put(decoratorModel, result);
+ }
+ return result;
+ }
+
+ static CrossReferenceUpdater getCrossReferenceUpdater(PackageRefactoringContext context, URI decoratorModel) {
+ RefactoringStepStore store = getStore(context, decoratorModel);
+ if (store.crossReferences == null) {
+ store.crossReferences = new CrossReferenceUpdater(context, decoratorModel);
+ }
+ return store.crossReferences;
+ }
+
+ static AbstractDecoratorModelUpdater getProfileApplicationsUpdater(PackageRefactoringContext context, URI decoratorModel) {
+ RefactoringStepStore store = getStore(context, decoratorModel);
+ return store.profileApplications;
+ }
+
+ static void setProfileApplicationsUpdater(PackageRefactoringContext context, URI decoratorModel, AbstractDecoratorModelUpdater updater) {
+ RefactoringStepStore store = getStore(context, decoratorModel);
+ store.profileApplications = updater;
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPreControlLoaded(PackageRefactoringContext context, URI decoratorModel) {
+ return null;
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPreControlUnloaded(PackageRefactoringContext context, URI decoratorModel) {
+ // We need to undo an control refactoring *after* doing the base refactoring, which means that
+ // we must be a pre-refactoring participant for that purpose
+ CrossReferenceUpdater crossReferenceUpdater = getCrossReferenceUpdater(context, decoratorModel);
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostControlDecoratorModelUpdater(new UnloadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ // Steps in reverse order relative to the execute/redo direction!
+ return new UnloadedDecoratorModelRefactoringCommand(context, decoratorModel, DirectionConstraint.UNREFACTOR_ONLY).addStep(profileApplicationUpdater).addStep(crossReferenceUpdater);
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPreUncontrolLoaded(PackageRefactoringContext context, URI decoratorModel) {
+ return null;
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPreUncontrolUnloaded(PackageRefactoringContext context, URI decoratorModel) {
+ // We need to undo an uncontrol refactoring *after* undoing the base refactoring, which means that
+ // we must actually be a pre-refactoring participant for that purpose
+ CrossReferenceUpdater crossReferenceUpdater = getCrossReferenceUpdater(context, decoratorModel);
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostUncontrolDecoratorModelUpdater(new UnloadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ // Steps in reverse order relative to the execute/redo direction!
+ return new UnloadedDecoratorModelRefactoringCommand(context, decoratorModel, DirectionConstraint.UNREFACTOR_ONLY).addStep(profileApplicationUpdater).addStep(crossReferenceUpdater);
+ }
+
+ public static ICommand createPostCommand(ControlModeRequest request) throws CoreException {
+ PackageRefactoringContext context = PackageRefactoringContext.getInstance(request);
+ if (context == null) {
+ return null;
+ }
+
+ boolean needsSave = false;
+ CompositeTransactionalCommand result = new CompositeTransactionalCommand(context.getEditingDomain(), Messages.DecoratorModelRefactoringCommandFactory_0);
+
+ // Gather up all the loaded decorator models and create a command for each
+ for (URI decoratorModel : context.getAffectedLoadedDecoratorModels()) {
+ ICommand refactoringCommand = request.isControlRequest() ?
+ createPostControlLoaded(context, decoratorModel) :
+ createPostUncontrolLoaded(context, decoratorModel);
+ if (refactoringCommand != null) {
+ result.add(refactoringCommand);
+ }
+ }
+
+ // Gather up all the unloaded decorator models and create a command for each
+ for (URI decoratorModel : context.getAffectedUnloadedDecoratorModels()) {
+ ICommand refactoringCommand = request.isControlRequest() ?
+ createPostControlUnloaded(context, decoratorModel) :
+ createPostUncontrolUnloaded(context, decoratorModel);
+ if (refactoringCommand != null) {
+ result.add(refactoringCommand);
+ needsSave = true;
+ }
+ }
+
+ if (result.isEmpty()) {
+ // Didn't need any command after all. Fine
+ result = null;
+ } else if (needsSave) {
+ // Must save the model to ensure that the refactoring of unloaded resources is consistent
+ result.add(new SaveModelCommand(context));
+ }
+
+ context.autoRelease();
+
+ return result;
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPostControlLoaded(PackageRefactoringContext context, URI decoratorModel) {
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostControlDecoratorModelUpdater(new LoadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ return new LoadedDecoratorModelRefactoringCommand(context, decoratorModel).addStep(profileApplicationUpdater);
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPostControlUnloaded(PackageRefactoringContext context, URI decoratorModel) {
+ // We need to execute/redo an control refactoring *after* doing the base refactoring, which means that
+ // we must be a post-refactoring participant for that purpose
+ CrossReferenceUpdater crossReferenceUpdater = getCrossReferenceUpdater(context, decoratorModel);
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostControlDecoratorModelUpdater(new UnloadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ return new UnloadedDecoratorModelRefactoringCommand(context, decoratorModel, DirectionConstraint.REFACTOR_ONLY).addStep(crossReferenceUpdater).addStep(profileApplicationUpdater);
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPostUncontrolLoaded(PackageRefactoringContext context, URI decoratorModel) {
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostUncontrolDecoratorModelUpdater(new LoadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ return new LoadedDecoratorModelRefactoringCommand(context, decoratorModel).addStep(profileApplicationUpdater);
+ }
+
+ static AbstractDecoratorModelRefactoringCommand createPostUncontrolUnloaded(PackageRefactoringContext context, URI decoratorModel) {
+ // We need to execute/redo an uncontrol refactoring *after* doing the base refactoring, which means that
+ // we must be a post-refactoring participant for that purpose
+ CrossReferenceUpdater crossReferenceUpdater = getCrossReferenceUpdater(context, decoratorModel);
+ AbstractDecoratorModelUpdater profileApplicationUpdater = getProfileApplicationsUpdater(context, decoratorModel);
+ if (profileApplicationUpdater == null) {
+ profileApplicationUpdater = new PostUncontrolDecoratorModelUpdater(new UnloadedDecoratorModelUpdaterDelegate(context.getPackage()), context, decoratorModel);
+ setProfileApplicationsUpdater(context, decoratorModel, profileApplicationUpdater);
+ }
+ return new UnloadedDecoratorModelRefactoringCommand(context, decoratorModel, DirectionConstraint.REFACTOR_ONLY).addStep(crossReferenceUpdater).addStep(profileApplicationUpdater);
+ }
+
+ //
+ // Nested types
+ //
+
+ private static class RefactoringStepStore {
+ CrossReferenceUpdater crossReferences;
+ AbstractDecoratorModelUpdater profileApplications;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DirectionConstraint.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DirectionConstraint.java
new file mode 100644
index 00000000000..3591acd9f71
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/DirectionConstraint.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+/**
+ * An enumeration of constraints on the direction in which a command will run.
+ * This allows a pair of commands to run, on in the pre position and one in post,
+ * that share refactoring steps such that one runs the forward refactoring in the
+ * post position and the other the reverse refactoring in the pre position.
+ */
+public enum DirectionConstraint {
+ ALL, REFACTOR_ONLY, UNREFACTOR_ONLY;
+
+ public boolean canRefactor() {
+ return this != UNREFACTOR_ONLY;
+ }
+
+ public boolean canUnrefactor() {
+ return this != REFACTOR_ONLY;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/LoadedDecoratorModelRefactoringCommand.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/LoadedDecoratorModelRefactoringCommand.java
new file mode 100644
index 00000000000..e10319a3144
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/LoadedDecoratorModelRefactoringCommand.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+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.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+
+/**
+ * Implementation of the commands that refactor <em>unloaded</em> dependent decorator models for the changes
+ * in the URIs of the base elements of stereotype applications.
+ */
+class LoadedDecoratorModelRefactoringCommand extends AbstractDecoratorModelRefactoringCommand {
+
+ private final TransactionalEditingDomain domain;
+
+ protected LoadedDecoratorModelRefactoringCommand(PackageRefactoringContext context, URI decoratorModelURI) {
+ super(context, decoratorModelURI);
+
+ this.domain = context.getEditingDomain();
+ }
+
+ @Override
+ protected ResourceSet getResourceSet() {
+ return domain.getResourceSet();
+ }
+
+ @Override
+ protected Resource getResource(ResourceSet resourceSet, URI decoratorModelURI) {
+ // The resource is expected to be loaded
+ return resourceSet.getResource(decoratorModelURI, false);
+ }
+
+ @Override
+ protected void disposeResourceSet(ResourceSet resourceSet) {
+ // The resource set is shared with the editor, so leave it alone
+ }
+
+ @Override
+ protected void resourceRefactored(Resource resource, boolean changed) {
+ // Don't save a loaded resource; the editor will do that if necessary
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/SaveModelCommand.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/SaveModelCommand.java
new file mode 100644
index 00000000000..7d9adcc4b3b
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/SaveModelCommand.java
@@ -0,0 +1,148 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.Activator;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+/**
+ * A command that asynchronously saves the model editor after completion of the (un)control operation,
+ * if it completes normally.
+ */
+class SaveModelCommand extends AbstractCommand {
+ private final ModelSet modelSet;
+
+ private volatile boolean savePending;
+
+ SaveModelCommand(PackageRefactoringContext context) {
+ super(Messages.SaveModelCommand_0);
+
+ this.modelSet = (ModelSet) context.getEditingDomain().getResourceSet();
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ if (savePending) {
+ // We are being invoked to roll back the composite operation that failed in some later command,
+ // so cancel the pending async exec
+ savePending = false;
+ return CommandResult.newOKCommandResult();
+ }
+
+ // We now have a save operation pending (asynchronously)
+ savePending = true;
+
+ // Do this asynchronously because we need the current transaction to have finished first,
+ // otherwise the command-stack (and hence the editor) will be marked dirty when it commits.
+ // Moreover, because undo also needs to save and this is the last command in the composite,
+ // it will actually undo first, which would save then save first if synchronous
+ Activator.getDefault().getExecutorService().execute(new Runnable() {
+
+ @Override
+ public void run() {
+ if (!savePending) {
+ // The execute/undo/redo was rolled back, so don't go through with save.
+ return;
+ }
+ savePending = false;
+
+ try {
+ // Prefer to save the editor so that it doesn't spuriously prompt for reloading
+ // resources saved without its knowledge. Of course, there may not be an editor
+ IRunnableWithProgress save = new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ IEditorPart editor = findEditor(modelSet);
+ if (editor != null) {
+ save(editor);
+ } else {
+ modelSet.save(monitor);
+ }
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ };
+
+ if (Display.getCurrent() != null) {
+ Activator.getActiveWorkbenchWindow().run(false, false, save);
+ } else {
+ save.run(new NullProgressMonitor());
+ }
+ } catch (InvocationTargetException e) {
+ IStatus status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, Messages.SaveModelCommand_1, e.getTargetException());
+ StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.SHOW);
+ } catch (InterruptedException e) {
+ IStatus status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, Messages.SaveModelCommand_2, e);
+ StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.SHOW);
+ }
+ }
+ });
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // On Undo we also need to save changes to ensure consistency
+ return doExecuteWithResult(progressMonitor, info);
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // On Redo we also need to save changes to ensure consistency
+ return doExecuteWithResult(progressMonitor, info);
+ }
+
+ static IEditorPart findEditor(ModelSet modelSet) {
+ IEditorPart result = null;
+
+ try {
+ IMultiDiagramEditor editor = ServiceUtilsForResourceSet.getInstance().getService(IMultiDiagramEditor.class, modelSet);
+ if (editor instanceof IEditorPart) {
+ result = editor;
+ }
+ } catch (ServiceException e) {
+ // Obviously this isn't our editor if the service registry doesn't have an editor
+ }
+
+ return result;
+ }
+
+ static void save(IEditorPart editor) {
+ editor.getSite().getPage().saveEditor(editor, false);
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/UnloadedDecoratorModelRefactoringCommand.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/UnloadedDecoratorModelRefactoringCommand.java
new file mode 100644
index 00000000000..89f9e9851a9
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/commands/UnloadedDecoratorModelRefactoringCommand.java
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.commands;
+
+import java.io.IOException;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelResourceSet;
+import org.eclipse.papyrus.uml.decoratormodel.model.DecoratorModel;
+
+/**
+ * Implementation of the commands that refactor <em>unloaded</em> dependent decorator models for the changes
+ * in the URIs of the base elements of stereotype applications.
+ */
+class UnloadedDecoratorModelRefactoringCommand extends AbstractDecoratorModelRefactoringCommand {
+ protected UnloadedDecoratorModelRefactoringCommand(PackageRefactoringContext context, URI decoratorModelURI) {
+ super(context, decoratorModelURI);
+ }
+
+ protected UnloadedDecoratorModelRefactoringCommand(PackageRefactoringContext context, URI decoratorModelURI, DirectionConstraint direction) {
+ super(context, decoratorModelURI, direction);
+ }
+
+ @Override
+ protected ResourceSet getResourceSet() {
+ return new DecoratorModelResourceSet();
+ }
+
+ @Override
+ protected Resource getResource(ResourceSet resourceSet, URI decoratorModelURI) {
+ // Load the resource in our scratch resource set
+ return resourceSet.getResource(decoratorModelURI, true);
+ }
+
+ @Override
+ protected void disposeResourceSet(ResourceSet resourceSet) {
+ EMFHelper.unload(resourceSet);
+ }
+
+ @Override
+ protected void resourceRefactored(Resource resource, boolean changed) throws ExecutionException {
+ if (changed) {
+ try {
+ resource.save(new DecoratorModel().getSaveOptions());
+ } catch (IOException e) {
+ throw new ExecutionException(Messages.UnloadedDecoratorModelRefactoringCommand_0, e);
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/Messages.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/Messages.java
new file mode 100644
index 00000000000..6d9b148064f
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/Messages.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Translatable strings presented in the plug-in's UI.
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.messages"; //$NON-NLS-1$
+
+ public static String AbstractDecoratorModelRefactoringCommand_0;
+ public static String ConfirmSaveCommand_0;
+ public static String ConfirmSaveCommand_1;
+ public static String ConfirmSaveCommand_2;
+ public static String CrossReferenceUpdater_0;
+ public static String DecoratorModelRefactoringCommandFactory_0;
+ public static String PostControlDecoratorModelUpdater_0;
+ public static String PostControlDecoratorModelUpdater_1;
+ public static String PostUncontrolDecoratorModelUpdater_0;
+ public static String PostUncontrolDecoratorModelUpdater_1;
+ public static String SaveModelCommand_0;
+ public static String SaveModelCommand_1;
+ public static String SaveModelCommand_2;
+ public static String UnloadedDecoratorModelRefactoringCommand_0;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/messages.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/messages.properties
new file mode 100644
index 00000000000..3be38781ee8
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/messages/messages.properties
@@ -0,0 +1,25 @@
+# Copyright (c) 2014 Christian W. Damus and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Christian W. Damus - Initial API and implementation
+#
+
+AbstractDecoratorModelRefactoringCommand_0=Refactor profile application {0}
+ConfirmSaveCommand_0=Confirm Model Save
+ConfirmSaveCommand_1=Save Model
+ConfirmSaveCommand_2=This operation requires refactoring of profile applications that are not loaded. The model must be saved in order to ensure consistency of stereotype applications.\n\nProceed?
+CrossReferenceUpdater_0=Updating cross-references in {0}
+DecoratorModelRefactoringCommandFactory_0=Refactor Profile Application Models
+PostControlDecoratorModelUpdater_0=Updating profile applications in {0}
+PostControlDecoratorModelUpdater_1=Removing profile applications from {0}
+PostUncontrolDecoratorModelUpdater_0=Updating profile applications in {0}
+PostUncontrolDecoratorModelUpdater_1=Restoring profile applications in {0}
+SaveModelCommand_0=Save Model
+SaveModelCommand_1=Failed to save model. Refactorings may be applied inconsistently if the model is not saved.
+SaveModelCommand_2=Model save was cancelled. Refactorings may be applied inconsistently if the model is not saved.
+UnloadedDecoratorModelRefactoringCommand_0=Failed to save refactoring changes
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdater.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdater.java
new file mode 100644
index 00000000000..b2812529aae
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdater.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+/**
+ * Common implementation of profile application updaters for loaded and unloaded models.
+ */
+public abstract class AbstractDecoratorModelUpdater implements IRefactoringStep {
+ private final IDecoratorModelUpdaterDelegate delegate;
+
+ public AbstractDecoratorModelUpdater(IDecoratorModelUpdaterDelegate delegate) {
+ super();
+
+ this.delegate = delegate;
+ }
+
+ @Override
+ public abstract boolean refactor(Resource resource, IProgressMonitor monitor) throws ExecutionException;
+
+ @Override
+ public abstract boolean unrefactor(Resource resource, IProgressMonitor monitor) throws ExecutionException;
+
+ Package getDecoratorPackage(Resource resource) {
+ return delegate.getDecoratorPackage(resource);
+ }
+
+ Package createDecoratorPackage(Resource resource) {
+ return delegate.createDecoratorPackage(resource);
+ }
+
+ ProfileApplication getProfileApplication(Package package_, URI appliedProfileURI) {
+ return delegate.getProfileApplication(package_, appliedProfileURI);
+ }
+
+ boolean hasProfileApplication(Package package_, URI appliedProfileURI) {
+ return getProfileApplication(package_, appliedProfileURI) != null;
+ }
+
+ ProfileApplication addProfileApplication(Package package_, URI profileURI, URI appliedDefinitionURI) {
+ return delegate.addProfileApplication(package_, profileURI, appliedDefinitionURI);
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdaterDelegate.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdaterDelegate.java
new file mode 100644
index 00000000000..25bea67436e
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/AbstractDecoratorModelUpdaterDelegate.java
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.profileExternalization.ApplyProfiles;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+import com.google.common.collect.Iterables;
+
+/**
+ * @author damus
+ *
+ */
+abstract class AbstractDecoratorModelUpdaterDelegate implements IDecoratorModelUpdaterDelegate {
+
+ private final Package package_;
+
+ public AbstractDecoratorModelUpdaterDelegate(Package package_) {
+ super();
+
+ this.package_ = package_;
+ }
+
+ protected final Package getControlledPackage() {
+ return package_;
+ }
+
+ @Override
+ public Package getDecoratorPackage(Resource resource) {
+ Package result = null;
+
+ URI packageURI = EcoreUtil.getURI(package_);
+ for (ApplyProfiles next : Iterables.filter(resource.getContents(), ApplyProfiles.class)) {
+ Dependency dep = next.getBase_Dependency();
+ if ((dep != null) && !dep.getClients().isEmpty()) {
+ if (EcoreUtil.getURI(dep.getClients().get(0)).equals(packageURI)) {
+ // that's the one
+ result = Iterables.getFirst(Iterables.filter(dep.getSuppliers(), Package.class), null);
+ if (result != null) {
+ break;
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Package createDecoratorPackage(Resource resource) {
+ Package result = null;
+
+ Package root = DecoratorModelUtils.getDecoratorModel(resource);
+ if (root != null) {
+ result = DecoratorModelUtils.getDecoratorPackage(root, package_, true);
+ }
+
+ return result;
+ }
+
+ @Override
+ public ProfileApplication getProfileApplication(Package package_, URI appliedProfileURI) {
+ ProfileApplication result = null;
+
+ for (ProfileApplication next : package_.getProfileApplications()) {
+ Profile profile = next.getAppliedProfile();
+ if ((profile != null) && EcoreUtil.getURI(profile).equals(appliedProfileURI)) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/CrossReferenceUpdater.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/CrossReferenceUpdater.java
new file mode 100644
index 00000000000..ba2ab576445
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/CrossReferenceUpdater.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+/**
+ * Implementation of the commands that refactor <em>unloaded</em> dependent decorator models for the changes
+ * in the URIs of the base elements of stereotype applications.
+ */
+public class CrossReferenceUpdater implements IRefactoringStep {
+
+ final TransactionalEditingDomain domain;
+ URI decoratorModelURI;
+ URI oldUserModelURI;
+ URI newUserModelURI;
+
+ public CrossReferenceUpdater(PackageRefactoringContext context, URI decoratorModelURI) {
+ super();
+
+ this.domain = context.getEditingDomain();
+ this.decoratorModelURI = decoratorModelURI;
+ this.oldUserModelURI = context.getOldUserModelURI();
+ this.newUserModelURI = context.getNewUserModelURI();
+ }
+
+ @Override
+ public boolean refactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ return refactor(resource, oldUserModelURI, newUserModelURI, monitor);
+ }
+
+ @Override
+ public boolean unrefactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ return refactor(resource, newUserModelURI, oldUserModelURI, monitor);
+ }
+
+ protected boolean refactor(Resource resource, URI oldURI, URI newURI, IProgressMonitor monitor) throws ExecutionException {
+ boolean result = false;
+ monitor.beginTask(NLS.bind(Messages.CrossReferenceUpdater_0, decoratorModelURI), IProgressMonitor.UNKNOWN);
+
+ // If the resource is not loaded, something didn't go right in the basic control step
+ Resource newUserModelResource = domain.getResourceSet().getResource(newURI, false);
+ if ((newUserModelResource != null) && newUserModelResource.isLoaded()) {
+ final Predicate<EReference> needsRefactoring = needsRefactoring();
+ for (Iterator<EObject> all = resource.getAllContents(); all.hasNext();) {
+ EObject next = all.next();
+ for (EReference ref : Iterables.filter(next.eClass().getEAllReferences(), needsRefactoring)) {
+ if (next.eIsSet(ref)) {
+ if (ref.isMany()) {
+ for (Object xref : (Iterable<?>) next.eGet(ref)) {
+ EObject eXRef = (EObject) xref;
+ if (eXRef.eIsProxy()) {
+ result = refactor(eXRef, oldURI, newURI, newUserModelResource) || result;
+ }
+ }
+ } else {
+ EObject eXRef = (EObject) next.eGet(ref);
+ if ((eXRef != null) && eXRef.eIsProxy()) {
+ result = refactor(eXRef, oldURI, newURI, newUserModelResource) || result;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ boolean refactor(EObject xref, URI oldURI, URI newURI, Resource newUserModelResource) {
+ boolean result = false;
+
+ InternalEObject proxy = (InternalEObject) xref;
+ URI proxyURI = proxy.eProxyURI();
+ if (proxyURI.trimFragment().equals(oldURI)) {
+ String fragment = proxyURI.fragment();
+ EObject target = newUserModelResource.getEObject(fragment);
+ if (target != null) {
+ // Proxy resolves to the new resource? Good. Rewrite it
+ proxy.eSetProxyURI(newURI.appendFragment(fragment));
+ result = true;
+ }
+ }
+
+ return result;
+ }
+
+ static Predicate<EReference> needsRefactoring() {
+ return new Predicate<EReference>() {
+ @Override
+ public boolean apply(EReference input) {
+ return (input != null) && input.isChangeable() && !input.isDerived() && !input.isContainment() && !input.isContainer();
+ }
+ };
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IDecoratorModelUpdaterDelegate.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IDecoratorModelUpdaterDelegate.java
new file mode 100644
index 00000000000..ec51c7b2e61
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IDecoratorModelUpdaterDelegate.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+/**
+ * @author damus
+ *
+ */
+public interface IDecoratorModelUpdaterDelegate {
+
+ Package getDecoratorPackage(Resource resource);
+
+ Package createDecoratorPackage(Resource resource);
+
+ ProfileApplication getProfileApplication(Package package_, URI appliedProfileURI);
+
+ ProfileApplication addProfileApplication(Package package_, URI profileURI, URI appliedDefinitionURI);
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IRefactoringStep.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IRefactoringStep.java
new file mode 100644
index 00000000000..7d9366005f7
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/IRefactoringStep.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+
+
+
+/**
+ * Protocol of a step in a sequence of decorator-model resource refactoring steps.
+ */
+public interface IRefactoringStep {
+
+ boolean refactor(Resource resource, IProgressMonitor monitor) throws ExecutionException;
+
+ boolean unrefactor(Resource resource, IProgressMonitor monitor) throws ExecutionException;
+
+} \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/LoadedDecoratorModelUpdaterDelegate.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/LoadedDecoratorModelUpdaterDelegate.java
new file mode 100644
index 00000000000..c9e373d778e
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/LoadedDecoratorModelUpdaterDelegate.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+/**
+ * @author damus
+ *
+ */
+public class LoadedDecoratorModelUpdaterDelegate extends AbstractDecoratorModelUpdaterDelegate {
+
+ public LoadedDecoratorModelUpdaterDelegate(Package package_) {
+ super(package_);
+ }
+
+ @Override
+ public ProfileApplication addProfileApplication(Package package_, URI profileURI, URI appliedDefinitionURI) {
+ ProfileApplication result = null;
+
+ // Get the corresponding loaded profile application of the controlled package
+ Profile profile = (Profile) EMFHelper.getResourceSet(getControlledPackage()).getEObject(profileURI, true);
+ ProfileApplication toCopy = getControlledPackage().getProfileApplication(profile, true);
+
+ if (toCopy != null) {
+ result = EcoreUtil.copy(toCopy);
+ package_.getProfileApplications().add(result);
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostControlDecoratorModelUpdater.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostControlDecoratorModelUpdater.java
new file mode 100644
index 00000000000..0851837adcd
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostControlDecoratorModelUpdater.java
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+import com.google.common.collect.Sets;
+
+/**
+ * A post-control updater of the profile applications that are stored in a decorator model.
+ *
+ */
+public class PostControlDecoratorModelUpdater extends AbstractDecoratorModelUpdater {
+
+ // Mapping of profile URI to applied definition EPackage URI
+ private final Map<URI, URI> profilesToAdd;
+ private Set<URI> profilesAdded;
+
+ public PostControlDecoratorModelUpdater(IDecoratorModelUpdaterDelegate delegate, PackageRefactoringContext context, URI decoratorModelURI) {
+ super(delegate);
+
+ this.profilesToAdd = context.getAllExternalProfileApplicationsFor(decoratorModelURI);
+ }
+
+ @Override
+ public boolean refactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ boolean result = false;
+
+ monitor.beginTask(NLS.bind(Messages.PostControlDecoratorModelUpdater_0, resource.getURI().lastSegment()), IProgressMonitor.UNKNOWN);
+ if (!profilesToAdd.isEmpty()) {
+ Package evilTwin = getDecoratorPackage(resource);
+ if (evilTwin == null) {
+ evilTwin = createDecoratorPackage(resource);
+ result = true;
+ }
+
+ for (Map.Entry<URI, URI> next : profilesToAdd.entrySet()) {
+ URI profileURI = next.getKey();
+ if (!hasProfileApplication(evilTwin, profileURI)) {
+ addProfileApplication(evilTwin, profileURI, next.getValue());
+ result = true;
+
+ if (profilesAdded == null) {
+ profilesAdded = Sets.newHashSet();
+ }
+ profilesAdded.add(profileURI);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean unrefactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ boolean result = false;
+
+ monitor.beginTask(NLS.bind(Messages.PostControlDecoratorModelUpdater_1, resource.getURI().lastSegment()), IProgressMonitor.UNKNOWN);
+ if (profilesAdded != null) {
+ Package evilTwin = getDecoratorPackage(resource);
+ if (evilTwin != null) {
+ for (URI next : profilesAdded) {
+ ProfileApplication application = getProfileApplication(evilTwin, next);
+ if (application != null) {
+ application.destroy();
+ result = true;
+ }
+ }
+
+ if (evilTwin.getProfileApplications().isEmpty()) {
+ evilTwin.destroy();
+ result = true;
+ }
+ }
+
+ profilesAdded = null;
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostUncontrolDecoratorModelUpdater.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostUncontrolDecoratorModelUpdater.java
new file mode 100644
index 00000000000..97d7339827e
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/PostUncontrolDecoratorModelUpdater.java
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.PackageRefactoringContext;
+import org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.messages.Messages;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+
+/**
+ * A post-uncontrol updater of the profile applications that are stored in a decorator model.
+ */
+public class PostUncontrolDecoratorModelUpdater extends AbstractDecoratorModelUpdater {
+
+ // Mapping of profile URI to applied definition EPackage URI
+ private final Map<URI, URI> profilesToRemove;
+ private Map<URI, URI> profilesRemoved;
+
+ public PostUncontrolDecoratorModelUpdater(IDecoratorModelUpdaterDelegate delegate, PackageRefactoringContext context, URI decoratorModelURI) {
+ super(delegate);
+
+ // Compute the profile applications that we no longer need because they are the same definition that is
+ // inherited from the parent package
+ ImmutableMap.Builder<URI, URI> extraneousProfiles = ImmutableMap.builder();
+ Map<URI, URI> inherited = context.getInheritedExternalProfileApplicationsFor(decoratorModelURI);
+ for (Map.Entry<URI, URI> all : context.getAllExternalProfileApplicationsFor(decoratorModelURI).entrySet()) {
+ if (all.getValue().equals(inherited.get(all.getKey()))) {
+ extraneousProfiles.put(all.getKey(), all.getValue());
+ }
+ }
+ this.profilesToRemove = extraneousProfiles.build();
+ }
+
+ @Override
+ public boolean refactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ boolean result = false;
+
+ monitor.beginTask(NLS.bind(Messages.PostUncontrolDecoratorModelUpdater_0, resource.getURI().lastSegment()), IProgressMonitor.UNKNOWN);
+ if (!profilesToRemove.isEmpty()) {
+ Package evilTwin = getDecoratorPackage(resource);
+ if (evilTwin != null) {
+ for (Map.Entry<URI, URI> next : profilesToRemove.entrySet()) {
+ ProfileApplication application = getProfileApplication(evilTwin, next.getKey());
+ EPackage definition = (application == null) ? null : application.getAppliedDefinition();
+ if ((definition != null) && next.getValue().equals(EcoreUtil.getURI(definition))) {
+ application.destroy();
+ result = true;
+
+ if (profilesRemoved == null) {
+ profilesRemoved = Maps.newHashMap();
+ }
+ profilesRemoved.put(next.getKey(), next.getValue());
+ }
+ }
+
+ if (evilTwin.getProfileApplications().isEmpty()) {
+ // Remove it, too
+ evilTwin.destroy();
+ result = true;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean unrefactor(Resource resource, IProgressMonitor monitor) throws ExecutionException {
+ boolean result = false;
+
+ monitor.beginTask(NLS.bind(Messages.PostUncontrolDecoratorModelUpdater_1, resource.getURI().lastSegment()), IProgressMonitor.UNKNOWN);
+ if (profilesRemoved != null) {
+ Package evilTwin = getDecoratorPackage(resource);
+ if (evilTwin == null) {
+ evilTwin = createDecoratorPackage(resource);
+ result = true;
+ }
+
+ for (Map.Entry<URI, URI> next : profilesRemoved.entrySet()) {
+ if (!hasProfileApplication(evilTwin, next.getKey())) {
+ addProfileApplication(evilTwin, next.getKey(), next.getValue());
+ result = true;
+ }
+ }
+
+ profilesRemoved = null;
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/UnloadedDecoratorModelUpdaterDelegate.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/UnloadedDecoratorModelUpdaterDelegate.java
new file mode 100644
index 00000000000..9a69d2c7312
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode/src/org/eclipse/papyrus/uml/decoratormodel/internal/controlmode/updaters/UnloadedDecoratorModelUpdaterDelegate.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.controlmode.updaters;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * @author damus
+ *
+ */
+public class UnloadedDecoratorModelUpdaterDelegate extends AbstractDecoratorModelUpdaterDelegate {
+
+ public UnloadedDecoratorModelUpdaterDelegate(Package package_) {
+ super(package_);
+ }
+
+ @Override
+ public ProfileApplication addProfileApplication(Package package_, URI profileURI, URI appliedDefinitionURI) {
+ // Create a proxy for the profile
+ Profile profile = UMLFactory.eINSTANCE.createProfile();
+ ((InternalEObject) profile).eSetProxyURI(profileURI);
+ ProfileApplication result = package_.createProfileApplication();
+ result.setAppliedProfile(profile);
+
+ // and a proxy for the Ecore definition
+ EPackage definition = EcoreFactory.eINSTANCE.createEPackage();
+ ((InternalEObject) definition).eSetProxyURI(appliedDefinitionURI);
+ result.createEAnnotation(UMLUtil.UML2_UML_PACKAGE_2_0_NS_URI).getReferences().add(definition);
+
+ return result;
+ }
+
+}
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.classpath b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.classpath
index 64c5e31b7a2..64c5e31b7a2 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.classpath
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.classpath
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.project b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.project
index bd86b07e265..ff3c7c0fd61 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/.project
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.papyrus.uml.profile.externalresource.properties</name>
+ <name>org.eclipse.papyrus.uml.decoratormodel.properties</name>
<comment></comment>
<projects>
</projects>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..c585cc455ae
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+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
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.ui.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..c5182577e79
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.uml.decoratormodel.properties;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.decoratormodel.properties.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.views.properties;bundle-version="1.1.0",
+ org.eclipse.uml2.uml;bundle-version="4.1.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.properties;bundle-version="1.1.0",
+ org.eclipse.core.databinding.observable;bundle-version="1.4.1",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.papyrus.views.properties.model;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
+ org.eclipse.emf.edit;bundle-version="2.10.0",
+ org.eclipse.emf.transaction;bundle-version="1.8.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.1.0",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.decoratormodel;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.decoratormodel.ui;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.constraints;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.uml.decoratormodel.internal.properties.constraints;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.properties,
+ org.eclipse.papyrus.uml.decoratormodel.properties.elements,
+ org.eclipse.papyrus.uml.decoratormodel.properties.widgets
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/OSGI-INF/l10n/bundle.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..645c6c42673
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.uml.decoratormodel.properties
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Papyrus Decorator Model Property Sheets \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/about.html b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/about.html
new file mode 100644
index 00000000000..d35d5aed64c
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/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>June 5, 2007</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>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/build.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/build.properties
new file mode 100644
index 00000000000..b95c74127cb
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/build.properties
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ resources/,\
+ OSGI-INF/,\
+ icons/,\
+ about.html,\
+ documentation.pdoc
+src.includes = about.html
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/documentation.pdoc b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/documentation.pdoc
new file mode 100644
index 00000000000..53d668be2bb
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/documentation.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="Property sheet customizations for management of separate profile applications.">
+ <referent firstName="Christian" lastName="Damus" eMail="give.a.damus@gmail.com" currentCompany="independent"/>
+</doc:Documentation>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/dup_resource.png b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/dup_resource.png
new file mode 100644
index 00000000000..41efe451edb
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/dup_resource.png
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/externalize.gif b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/externalize.gif
new file mode 100644
index 00000000000..5a0837d1e47
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/externalize.gif
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/internalize.gif b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/internalize.gif
new file mode 100644
index 00000000000..d38085ad9c2
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/internalize.gif
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/unload_resource.png b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/unload_resource.png
new file mode 100644
index 00000000000..9f025e2a8b3
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/ctool16/unload_resource.png
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/dtool16/load_resource.png b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/dtool16/load_resource.png
new file mode 100644
index 00000000000..905ebeee0a7
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/dtool16/load_resource.png
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/etool16/load_resource.png b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/etool16/load_resource.png
new file mode 100644
index 00000000000..4fd6673d06d
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/icons/full/etool16/load_resource.png
Binary files differ
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/plugin.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/plugin.xml
index c95214422da..c95214422da 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource.properties/plugin.xml
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/plugin.xml
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/pom.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/pom.xml
new file mode 100644
index 00000000000..855d83f8bff
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../releng/top-pom-main.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.decoratormodel.properties</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResource.ctx b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResource.ctx
new file mode 100644
index 00000000000..bf1638b2dae
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResource.ctx
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<contexts:Context xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:constraints="http://www.eclipse.org/papyrus/constraints/0.9" xmlns:contexts="http://www.eclipse.org/papyrus/properties/contexts/0.9" name="UMLStereotypeApplicationExternalResource">
+ <dependencies href="ppe:/context/org.eclipse.papyrus.uml.properties/Model/UML/UML.ctx#/"/>
+ <tabs label="Profile" id="profile" category="org.eclipse.papyrus" priority="50">
+ <sections name="SinglePackageProfile" sectionFile="ui/SinglePackageProfile.xwt">
+ <widget href="ui/SinglePackageProfile.xwt#/"/>
+ </sections>
+ </tabs>
+ <tabs label="Applications" id="applications" category="org.eclipse.papyrus" priority="50">
+ <afterTab href="ppe:/context/org.eclipse.papyrus.uml.properties/Model/UML/UML.ctx#//@tabs.1"/>
+ <sections name="SinglePackageDecoratorModels" sectionFile="ui/SinglePackageDecoratorModels.xwt">
+ <widget href="ui/SinglePackageDecoratorModels.xwt#/"/>
+ </sections>
+ </tabs>
+ <views name="SinglePackageProfile" sections="//@tabs.0/@sections.0" automaticContext="true">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isSinglePackage" overrideable="false">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.properties/Model/Environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="umlClassName" value="Package"/>
+ </constraints>
+ </views>
+ <views name="SinglePackageDecoratorModels" sections="//@tabs.1/@sections.0">
+ <constraints xsi:type="constraints:SimpleConstraint" name="hasExternalizedProfileApplications">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi#//@constraintTypes.0"/>
+ </constraints>
+ </views>
+ <dataContexts name="PackageAdditions" label="Package Additions">
+ <elements name="Package">
+ <properties name="profileApplication" label="Profile Applications" type="Reference" description="References the ProfileApplications that indicate which profiles have been applied to the Package."/>
+ <properties name="externalProfileApplication" label="External Profile Applications" type="Reference" description="The models in the workspace that apply profiles to the package, loaded and unloaded."/>
+ </elements>
+ <modelElementFactory href="UMLStereotypeApplicationExternalResourceEnvironment.xmi#//@modelElementFactories.0"/>
+ </dataContexts>
+</contexts:Context>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi
new file mode 100644
index 00000000000..21eee0ec154
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/UMLStereotypeApplicationExternalResourceEnvironment.xmi
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<environment:Environment
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:environment="http://www.eclipse.org/papyrus/properties/environment/0.9">
+ <constraintTypes
+ label="Has Externalized Profile Applications"
+ constraintClass="org.eclipse.papyrus.uml.decoratormodel.internal.properties.constraints.HasExternalizedProfileApplicationsConstraint"/>
+ <modelElementFactories
+ name="Package Factory"
+ factoryClass="org.eclipse.papyrus.uml.decoratormodel.properties.elements.PackageModelElementFactory"/>
+ <propertyEditorTypes
+ label="External Resource Profile Application Editor"
+ widgetClass="ProfileApplicationPropertyEditor"
+ namespace="//@namespaces.0"
+ type="Reference"
+ multiplicity="-1"/>
+ <propertyEditorTypes
+ label="Decorator Model Editor"
+ widgetClass="DecoratorModelPropertyEditor"
+ namespace="//@namespaces.0"
+ type="Reference"
+ multiplicity="-1"/>
+ <namespaces
+ name="umlprofileexternalresource"
+ value="org.eclipse.papyrus.uml.decoratormodel.properties.widgets"/>
+</environment:Environment>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageDecoratorModels.xwt b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageDecoratorModels.xwt
new file mode 100644
index 00000000000..3f0cc7bfcf3
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageDecoratorModels.xwt
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:umlprofileexternalresource="clr-namespace:org.eclipse.papyrus.uml.decoratormodel.properties.widgets"
+ xmlns:uml="clr-namespace:org.eclipse.papyrus.uml.properties.widgets">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <umlprofileexternalresource:DecoratorModelPropertyEditor
+ input="{Binding}" property="PackageAdditions:externalProfileApplication"></umlprofileexternalresource:DecoratorModelPropertyEditor>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageProfile.xwt b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageProfile.xwt
new file mode 100644
index 00000000000..eb262a0531b
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/resources/ui/SinglePackageProfile.xwt
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:umlprofileexternalresource="clr-namespace:org.eclipse.papyrus.uml.decoratormodel.properties.widgets"
+ xmlns:uml="clr-namespace:org.eclipse.papyrus.uml.properties.widgets">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <umlprofileexternalresource:ProfileApplicationPropertyEditor
+ input="{Binding}" property="PackageAdditions:profileApplication"></umlprofileexternalresource:ProfileApplicationPropertyEditor>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/constraints/HasExternalizedProfileApplicationsConstraint.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/constraints/HasExternalizedProfileApplicationsConstraint.java
new file mode 100644
index 00000000000..3f2e801dc0e
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/constraints/HasExternalizedProfileApplicationsConstraint.java
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.properties.constraints;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelIndex;
+import org.eclipse.papyrus.uml.decoratormodel.properties.Activator;
+import org.eclipse.uml2.uml.Package;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.SetMultimap;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * A properties constraint matching packages that have loaded or unloaded decorator models.
+ */
+public class HasExternalizedProfileApplicationsConstraint extends AbstractConstraint {
+
+ /**
+ * Initializes me.
+ */
+ public HasExternalizedProfileApplicationsConstraint() {
+ super();
+ }
+
+ @Override
+ protected boolean match(Object selection) {
+ boolean result = false;
+
+ EObject object = EMFHelper.getEObject(selection);
+
+ if (object instanceof Package) {
+ Package package_ = (Package) object;
+
+ try {
+ result = !Iterables.isEmpty(DecoratorModelUtils.getDecoratorModelProfileApplications(package_));
+ if (!result) {
+ ListenableFuture<SetMultimap<URI, URI>> appliedProfiles = DecoratorModelIndex.getInstance().getAllAppliedProfilesAsync(EcoreUtil.getURI(package_));
+
+ // Optimistic enablement for responsiveness
+ result = !appliedProfiles.isDone() || !Futures.get(appliedProfiles, CoreException.class).isEmpty();
+ }
+ } catch (CoreException e) {
+ // Oh, well. I guess we won't show this property
+ Activator.getDefault().getLog().log(e.getStatus());
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected boolean equivalent(Constraint constraint) {
+ if (this == constraint) {
+ return true;
+ }
+ return constraint instanceof HasExternalizedProfileApplicationsConstraint;
+ }
+
+ @Override
+ public String toString() {
+ return "HasExternalizedProfileApplicationsConstraint"; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/Messages.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/Messages.java
new file mode 100644
index 00000000000..e339c7a5c7e
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/Messages.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.properties.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author damus
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.decoratormodel.internal.properties.messages.messages"; //$NON-NLS-1$
+ public static String DecoratorModelPropertyEditor_0;
+ public static String DecoratorModelPropertyEditor_1;
+ public static String DecoratorModelPropertyEditor_2;
+ public static String DecoratorModelPropertyEditor_3;
+ public static String DecoratorModelPropertyEditor_4;
+ public static String DecoratorModelPropertyEditor_5;
+ public static String DecoratorModelPropertyEditor_6;
+ public static String DecoratorModelPropertyEditor_7;
+ public static String DecoratorModelPropertyEditor_8;
+ public static String ProfileApplicationPropertyEditor_0;
+ public static String ProfileApplicationPropertyEditor_1;
+ public static String ProfileApplicationPropertyEditor_2;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/messages.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/messages.properties
new file mode 100644
index 00000000000..14cafbe6fa0
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/internal/properties/messages/messages.properties
@@ -0,0 +1,12 @@
+DecoratorModelPropertyEditor_0=External Profile Applications:
+DecoratorModelPropertyEditor_1=State
+DecoratorModelPropertyEditor_2=Profile Application
+DecoratorModelPropertyEditor_3=Load the selected profile application(s)
+DecoratorModelPropertyEditor_4=Unload the selected profile application(s)
+DecoratorModelPropertyEditor_5=Duplicate the selected profile application
+DecoratorModelPropertyEditor_6=Failed to unload profile application(s).
+DecoratorModelPropertyEditor_7=Loaded
+DecoratorModelPropertyEditor_8=Unloaded
+ProfileApplicationPropertyEditor_0=Externalize profile application
+ProfileApplicationPropertyEditor_1=Internalize profile application
+ProfileApplicationPropertyEditor_2=({0})
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/Activator.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/Activator.java
new file mode 100644
index 00000000000..87a3875b8f7
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/Activator.java
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Copyright (c) 2011, 2014 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 399859
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.decoratormodel.properties;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+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 {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.decoratormodel.properties"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the image at the given path from this plugin
+ *
+ * @param path
+ * the path of the image to be displayed
+ * @return The Image at the given location, or null if it couldn't be found
+ */
+ public Image getImage(String path) {
+ return getImage(PLUGIN_ID, path);
+ }
+
+ /**
+ * Returns the image from the given image descriptor
+ *
+ * @param pluginId
+ * The plugin in which the image is located
+ * @param path
+ * The path to the image from the plugin
+ * @return
+ * The Image at the given location, or null if it couldn't be found
+ */
+ public Image getImage(String pluginId, String path) {
+ final ImageRegistry registry = getImageRegistry();
+ String key = pluginId + "/" + path; //$NON-NLS-1$
+ Image image = registry.get(key);
+ if (image == null) {
+ registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
+ image = registry.get(key);
+ }
+ return image;
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ IWorkbenchWindow result = null;
+
+ IWorkbench bench = PlatformUI.getWorkbench();
+ if (bench != null) {
+ result = bench.getActiveWorkbenchWindow();
+ if (result == null) {
+ IWorkbenchWindow[] allWindows = bench.getWorkbenchWindows();
+ if (allWindows.length > 0) {
+ result = allWindows[0];
+ }
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/AppliedProfilesObservableList.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/AppliedProfilesObservableList.java
new file mode 100644
index 00000000000..8571d789f61
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/AppliedProfilesObservableList.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2012, 2014 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sebastien Poissonnet (CEA LIST) sebastien.poissonnet@cea.fr
+ * Mickaƫl ADAM (ALL4TEC) mickael.adam@all4tec.net - bug 435174
+ * Gabriel Pascual (ALL4TEC) - Bug 441511
+ * Christian W. Damus (CEA) - Bug 441227
+ * Christian W. Damus - bug 399859
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.decoratormodel.properties.elements;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.infra.core.resource.ResourceAdapter;
+import org.eclipse.papyrus.uml.tools.databinding.ProfileApplicationObservableList;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * Observable list for applied profiles.
+ */
+public class AppliedProfilesObservableList extends ProfileApplicationObservableList {
+
+ private ResourceAdapter adapter;
+
+ public AppliedProfilesObservableList(Package source, EditingDomain domain) {
+ super(source, domain);
+
+ adapter = createResourceAdapter();
+ domain.getResourceSet().eAdapters().add(adapter);
+ }
+
+ @Override
+ public synchronized void dispose() {
+ if (adapter.getTarget() != null) {
+ adapter.getTarget().eAdapters().remove(adapter);
+ }
+
+ super.dispose();
+ }
+
+ protected final Package getPackage() {
+ return (Package) getObserved();
+ }
+
+ private ResourceAdapter createResourceAdapter() {
+ return new ResourceAdapter() {
+ @Override
+ protected void handleResourceLoaded(Resource resource) {
+ refreshCacheList();
+ }
+
+ @Override
+ protected void handleResourceUnloaded(Resource resource) {
+ refreshCacheList();
+ }
+ };
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/DecoratorModelsObservableList.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/DecoratorModelsObservableList.java
new file mode 100644
index 00000000000..1da88fbfe40
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/DecoratorModelsObservableList.java
@@ -0,0 +1,243 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.properties.elements;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.eclipse.core.databinding.observable.IObserving;
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.core.databinding.observable.list.ObservableList;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.ResourceSetListener;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.core.resource.ResourceAdapter;
+import org.eclipse.papyrus.infra.tools.util.UIUtil;
+import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.infra.widgets.editors.ICommitListener;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelIndex;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelIndexEvent;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.IDecoratorModelIndexListener;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.ProfileApplication;
+import org.eclipse.uml2.uml.UMLPackage;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * The list of a {@link Package}'s decorator models, both loaded and unloaded.
+ */
+public class DecoratorModelsObservableList extends ObservableList implements ICommitListener, IObserving {
+
+ private final AtomicBoolean pendingCalculation = new AtomicBoolean();
+
+ private Package package_;
+
+ private TransactionalEditingDomain domain;
+
+ private final List<Command> commands;
+
+ private final ExecutorService realmExecutor;
+
+ private final ResourceSetListener resourceSetListener;
+
+ private final IDecoratorModelIndexListener indexListener;
+
+ /**
+ * Initializes me in the default realm.
+ *
+ * @param package_
+ * the package for which we track the decorator models
+ * @param domain
+ * the editing domain context in which to execute commands
+ */
+ public DecoratorModelsObservableList(Package package_, TransactionalEditingDomain domain) {
+ this(Realm.getDefault(), package_, domain);
+ }
+
+ /**
+ * Initializes me.
+ *
+ * @param realm
+ * the observable realm that owns me
+ * @param package_
+ * the package for which we track the decorator models
+ * @param domain
+ * the editing domain context in which to execute commands
+ */
+ public DecoratorModelsObservableList(Realm realm, Package package_, TransactionalEditingDomain domain) {
+ super(realm, Lists.newArrayList(), Object.class);
+
+ this.package_ = package_;
+ this.domain = domain;
+
+ this.commands = Lists.newArrayListWithExpectedSize(1);
+
+ this.realmExecutor = UIUtil.createObservableExecutor(realm);
+
+ this.resourceSetListener = new ResourceAdapter.Transactional() {
+ private NotificationFilter packageFilter;
+
+ @Override
+ protected NotificationFilter createFilter() {
+ packageFilter = NotificationFilter.createFeatureFilter(UMLPackage.Literals.PACKAGE__PROFILE_APPLICATION);
+ return super.createFilter().or(packageFilter);
+ }
+
+ @Override
+ public void notifyChanged(Notification msg) {
+ if (packageFilter.matches(msg)) {
+ // Some externalized profiles may no longer be available
+ calculate();
+ } else {
+ // Resource case
+ super.notifyChanged(msg);
+ }
+ }
+
+ @Override
+ protected void handleResourceLoaded(Resource resource) {
+ calculate();
+ }
+
+ @Override
+ protected void handleResourceUnloaded(Resource resource) {
+ calculate();
+ }
+ };
+ domain.addResourceSetListener(resourceSetListener);
+
+ this.indexListener = new IDecoratorModelIndexListener() {
+
+ public void indexChanged(DecoratorModelIndexEvent event) {
+ // Some unloaded decorator models may have changed
+ calculate();
+ }
+ };
+ DecoratorModelIndex.getInstance().addIndexListener(indexListener);
+
+ calculate();
+ }
+
+ public Package getObserved() {
+ return package_;
+ }
+
+ @Override
+ public synchronized void dispose() {
+ try {
+ DecoratorModelIndex.getInstance().removeIndexListener(indexListener);
+ if (domain != null) {
+ domain.removeResourceSetListener(resourceSetListener);
+ }
+ if (!realmExecutor.isShutdown()) {
+ realmExecutor.shutdownNow();
+ }
+ } finally {
+ super.dispose();
+ }
+ }
+
+ public void commit(AbstractEditor editor) {
+ if (!commands.isEmpty()) {
+ if (commands.size() == 1) {
+ domain.getCommandStack().execute(commands.get(0));
+ } else {
+ domain.getCommandStack().execute(new CompoundCommand(commands));
+ }
+ commands.clear();
+ }
+ }
+
+ void calculate() {
+ if (!pendingCalculation.compareAndSet(false, true) || isDisposed()) {
+ return;
+ }
+
+ // First, mark me stale
+ getRealm().exec(new Runnable() {
+
+ public void run() {
+ setStale(true);
+ }
+ });
+
+ // Then asynchronously compute my value
+ ListenableFuture<Set<URI>> decoratorModelURIs = DecoratorModelUtils.getUnloadedDecoratorModelsAsync(package_);
+ Futures.addCallback(decoratorModelURIs, new FutureCallback<Set<URI>>() {
+ public void onSuccess(Set<URI> result) {
+ if (isDisposed() || (domain == null) || (domain.getResourceSet() == null)) {
+ return;
+ }
+
+ try {
+ // compute all the unloaded models
+ Set<Object> newValue = Sets.<Object> newHashSet(result);
+ for (Resource next : domain.getResourceSet().getResources()) {
+ if (next.isLoaded()) {
+ newValue.remove(next.getURI());
+ }
+ }
+
+ // now get the loaded ones
+ for (ProfileApplication next : DecoratorModelUtils.getDecoratorModelProfileApplications(package_)) {
+ newValue.add(next.eResource());
+ }
+
+ List<Object> newList = Lists.newArrayList(newValue);
+ // because the ordering of all these sets is random, we must sort so that the list doesn't
+ // change its ordering randomly each time
+ sort(newList);
+
+ setStale(false);
+ updateWrappedList(newList);
+ } finally {
+ pendingCalculation.set(false);
+ }
+ }
+
+ public void onFailure(Throwable t) {
+ // TODO Auto-generated method stub
+ }
+ }, realmExecutor);
+ }
+
+ void sort(List<?> list) {
+ Collections.sort(list, new Comparator<Object>() {
+ public int compare(Object o1, Object o2) {
+ URI uri1 = getURI(o1);
+ URI uri2 = getURI(o2);
+ return uri1.toString().compareTo(uri2.toString());
+ }
+
+ URI getURI(Object o) {
+ return (o instanceof Resource) ? ((Resource) o).getURI() : (URI) o;
+ }
+ });
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElement.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElement.java
new file mode 100644
index 00000000000..24840e11e5a
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElement.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.properties.elements;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.uml.properties.modelelement.UMLModelElement;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Properties model element for packages.
+ */
+public class PackageModelElement extends UMLModelElement {
+ static final String DECORATOR_MODEL_PROPERTY = "externalProfileApplication"; //$NON-NLS-1$
+
+ public PackageModelElement(Package source, TransactionalEditingDomain domain) {
+ super(source, domain);
+ }
+
+ protected final Package getPackage() {
+ return (Package) getSource();
+ }
+
+ @Override
+ public IObservable doGetObservable(String propertyPath) {
+ if (propertyPath.equals(UMLPackage.Literals.PACKAGE__PROFILE_APPLICATION.getName())) {
+ return new AppliedProfilesObservableList(getPackage(), domain);
+ } else if (propertyPath.equals(DECORATOR_MODEL_PROPERTY)) {
+ return new DecoratorModelsObservableList(getPackage(), (TransactionalEditingDomain) domain);
+ }
+
+ return super.doGetObservable(propertyPath);
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElementFactory.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElementFactory.java
new file mode 100644
index 00000000000..08c7845d095
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/elements/PackageModelElementFactory.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.properties.elements;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.uml.properties.modelelement.UMLModelElement;
+import org.eclipse.papyrus.uml.properties.modelelement.UMLModelElementFactory;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * Properties model element factory for profile applications.
+ */
+public class PackageModelElementFactory extends UMLModelElementFactory {
+
+ public PackageModelElementFactory() {
+ super();
+ }
+
+ @Override
+ protected UMLModelElement doCreateFromSource(Object source, DataContextElement context) {
+ Element umlSource = UMLUtil.resolveUMLElement(source);
+ if (umlSource instanceof Package) {
+ return createPackageElement((Package) umlSource, context);
+ }
+
+ return super.doCreateFromSource(source, context);
+ }
+
+ protected UMLModelElement createPackageElement(Package package_, DataContextElement context) {
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(package_);
+ return new PackageModelElement(package_, domain);
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/DecoratorModelPropertyEditor.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/DecoratorModelPropertyEditor.java
new file mode 100644
index 00000000000..6d1009ff872
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/DecoratorModelPropertyEditor.java
@@ -0,0 +1,340 @@
+/*****************************************************************************
+ * Copyright (c) 2011, 2014 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 399859
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.properties.widgets;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.widgets.editors.AbstractListEditor;
+import org.eclipse.papyrus.uml.decoratormodel.internal.properties.messages.Messages;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.UnloadDecoratorModelHandler;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.providers.DecoratorModelLabelProvider;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.DuplicateDecoratorModelWizard;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.LoadProfileApplicationsWizard;
+import org.eclipse.papyrus.uml.decoratormodel.properties.Activator;
+import org.eclipse.papyrus.views.properties.widgets.AbstractPropertyEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.eclipse.uml2.uml.Package;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
+/**
+ * Property sheet editor for the "decorator models" property of a package.
+ */
+public class DecoratorModelPropertyEditor extends AbstractPropertyEditor {
+
+ public DecoratorModelPropertyEditor(Composite parent, int style) {
+ super(new DecoratorModelEditor(parent, style));
+ }
+
+ //
+ // Nested types
+ //
+
+ static class DecoratorModelEditor extends AbstractListEditor implements IChangeListener {
+
+ private TableViewer table;
+
+ private Button loadButton;
+
+ private Button unloadButton;
+
+ private Button duplicateButton;
+
+ private boolean preservingSelection;
+
+ protected DecoratorModelEditor(Composite parent, int style) {
+ super(parent, style, Messages.DecoratorModelPropertyEditor_0);
+ setLayout(new GridLayout(2, false));
+
+ createActionButtons(this);
+
+ table = new TableViewer(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.minimumHeight = 140;
+ gd.horizontalSpan = 2;
+ table.getTable().setLayoutData(gd);
+ TableLayout tableLayout = new TableLayout(true);
+ table.getTable().setLayout(tableLayout);
+ table.getTable().setHeaderVisible(true);
+ table.getTable().setLinesVisible(true);
+ table.setContentProvider(ArrayContentProvider.getInstance());
+
+ TableViewerColumn stateColumn = new TableViewerColumn(table, SWT.NONE);
+ stateColumn.getColumn().setText(Messages.DecoratorModelPropertyEditor_1);
+ stateColumn.setLabelProvider(new StateCellLabelProvider());
+ tableLayout.addColumnData(new ColumnWeightData(25, 100, true));
+
+ TableViewerColumn resourceColumn = new TableViewerColumn(table, SWT.NONE);
+ resourceColumn.getColumn().setText(Messages.DecoratorModelPropertyEditor_2);
+ resourceColumn.setLabelProvider(new DelegatingStyledCellLabelProvider(new DecoratorModelLabelProvider()));
+ tableLayout.addColumnData(new ColumnWeightData(75, 350, true));
+
+ table.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateButtons();
+ }
+ });
+ table.addDoubleClickListener(new IDoubleClickListener() {
+
+ public void doubleClick(DoubleClickEvent event) {
+ if (loadButton.isEnabled()) {
+ loadDecoratorModels();
+ }
+ }
+ });
+
+ updateButtons();
+ }
+
+ protected void createActionButtons(Composite parent) {
+ Composite buttonsArea = new Composite(parent, SWT.NONE);
+ buttonsArea.setLayoutData(new GridData(SWT.END, SWT.DEFAULT, false, false));
+ buttonsArea.setLayout(new RowLayout());
+
+ loadButton = new Button(buttonsArea, SWT.PUSH);
+ loadButton.setImage(Activator.getDefault().getImage("/icons/full/dtool16/load_resource.png")); //$NON-NLS-1$
+ loadButton.setToolTipText(Messages.DecoratorModelPropertyEditor_3);
+
+ unloadButton = new Button(buttonsArea, SWT.PUSH);
+ unloadButton.setImage(Activator.getDefault().getImage("/icons/full/ctool16/unload_resource.png")); //$NON-NLS-1$
+ unloadButton.setToolTipText(Messages.DecoratorModelPropertyEditor_4);
+
+ duplicateButton = new Button(buttonsArea, SWT.PUSH);
+ duplicateButton.setImage(Activator.getDefault().getImage("/icons/full/ctool16/dup_resource.png")); //$NON-NLS-1$
+ duplicateButton.setToolTipText(Messages.DecoratorModelPropertyEditor_5);
+
+ SelectionListener action = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ action((Button) e.widget);
+ }
+ };
+
+ loadButton.addSelectionListener(action);
+ unloadButton.addSelectionListener(action);
+ duplicateButton.addSelectionListener(action);
+ }
+
+ protected void action(Button button) {
+ if (button == loadButton) {
+ loadDecoratorModels();
+ } else if (button == unloadButton) {
+ unloadDecoratorModels();
+ } else if (button == duplicateButton) {
+ duplicateDecoratorModel();
+ }
+ updateButtons();
+ }
+
+ @Override
+ protected void doBinding() {
+ super.doBinding();
+
+ table.setInput(modelProperty);
+ modelProperty.addChangeListener(this);
+ }
+
+ public void handleChange(ChangeEvent event) {
+ if (!isDisposed()) {
+ preservingSelection(new Runnable() {
+
+ public void run() {
+ table.refresh();
+ }
+ });
+ }
+ }
+
+ protected Package getPackage() {
+ return (Package) getContextElement();
+ }
+
+ protected void loadDecoratorModels() {
+ Set<URI> resources = ImmutableSet.copyOf(Iterables.filter(((IStructuredSelection) table.getSelection()).toList(), URI.class));
+ if (!Iterables.isEmpty(resources)) {
+ final LoadProfileApplicationsWizard wizard = new LoadProfileApplicationsWizard(false, true);
+ wizard.init(getPackage(), resources);
+
+ preservingSelection(new Runnable() {
+
+ public void run() {
+ if (wizard.isComplete()) {
+ // Just do it
+ wizard.performFinish();
+ } else {
+ new WizardDialog(getShell(), wizard).open();
+ }
+ }
+ });
+ }
+ }
+
+ protected void unloadDecoratorModels() {
+ final Iterable<Resource> resources = Iterables.filter(((IStructuredSelection) table.getSelection()).toList(), Resource.class);
+ if (!Iterables.isEmpty(resources)) {
+ final ResourceSet rset = Iterables.getFirst(resources, null).getResourceSet();
+
+ preservingSelection(new Runnable() {
+
+ public void run() {
+ try {
+ UnloadDecoratorModelHandler.unloadResources(Activator.getActiveWorkbenchWindow(), rset, resources);
+ } catch (ExecutionException e) {
+ Throwable exc = (e.getCause() != null) ? e.getCause() : e;
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.DecoratorModelPropertyEditor_6, exc);
+ Activator.getDefault().getLog().log(status);
+ StatusManager.getManager().handle(status, StatusManager.SHOW);
+ }
+ }
+ });
+ }
+ }
+
+ protected void duplicateDecoratorModel() {
+ final Object selected = ((IStructuredSelection) table.getSelection()).getFirstElement();
+ if (selected != null) {
+ preservingSelection(new Runnable() {
+
+ public void run() {
+ DuplicateDecoratorModelWizard wizard = new DuplicateDecoratorModelWizard();
+ wizard.init(EMFHelper.getResourceSet(getPackage()), selected);
+ new WizardDialog(getShell(), wizard).open();
+ }
+ });
+ }
+ }
+
+ protected void updateButtons() {
+ List<?> selection = ((IStructuredSelection) table.getSelection()).toList();
+
+ boolean enableLoad = !selection.isEmpty();
+ boolean enableUnload = enableLoad;
+ boolean enableDup = selection.size() == 1;
+
+ if (enableLoad) {
+ for (Object next : selection) {
+ enableLoad = enableLoad && !(next instanceof Resource);
+ enableUnload = enableUnload && (next instanceof Resource);
+ }
+ }
+
+ loadButton.setImage(Activator.getDefault().getImage(enableLoad ? "/icons/full/etool16/load_resource.png" : "/icons/full/dtool16/load_resource.png")); //$NON-NLS-1$ //$NON-NLS-2$
+ loadButton.setEnabled(enableLoad);
+ unloadButton.setEnabled(enableUnload);
+ duplicateButton.setEnabled(enableDup);
+ }
+
+ void preservingSelection(Runnable runnable) {
+ final boolean wasPreservingSelection = preservingSelection;
+ List<Object> selection = null;
+ Set<URI> uris = null;
+
+ if (!preservingSelection) {
+ selection = Lists.newArrayList((Iterator<?>) ((IStructuredSelection) table.getSelection()).iterator());
+ uris = Sets.newHashSet();
+ for (Object next : selection) {
+ if (next instanceof Resource) {
+ next = ((Resource) next).getURI();
+ }
+ if (next instanceof URI) {
+ uris.add((URI) next);
+ }
+ }
+
+ preservingSelection = true;
+ }
+
+ try {
+ runnable.run();
+ } finally {
+ preservingSelection = wasPreservingSelection;
+
+ if (selection != null) {
+ selection.clear();
+ for (Object next : modelProperty) {
+ URI uri = (next instanceof Resource) ? ((Resource) next).getURI() : (next instanceof URI) ? (URI) next : null;
+ if (uris.contains(uri)) {
+ selection.add(next);
+ }
+ }
+ table.setSelection(new StructuredSelection(selection), true);
+ updateButtons();
+ }
+ }
+ }
+
+ @Override
+ public Object getEditableType() {
+ return List.class;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ // Pass
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ return true;
+ }
+
+ }
+
+ static class StateCellLabelProvider extends CellLabelProvider {
+ @Override
+ public void update(ViewerCell cell) {
+ cell.setText((cell.getElement() instanceof Resource) ? Messages.DecoratorModelPropertyEditor_7 : Messages.DecoratorModelPropertyEditor_8);
+ }
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/ProfileApplicationPropertyEditor.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/ProfileApplicationPropertyEditor.java
new file mode 100644
index 00000000000..af66845c7dd
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/src/org/eclipse/papyrus/uml/decoratormodel/properties/widgets/ProfileApplicationPropertyEditor.java
@@ -0,0 +1,208 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.properties.widgets;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.window.SameShellProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.decoratormodel.helper.DecoratorModelUtils;
+import org.eclipse.papyrus.uml.decoratormodel.internal.properties.messages.Messages;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.ExternalizeProfileApplicationsWizard;
+import org.eclipse.papyrus.uml.decoratormodel.properties.Activator;
+import org.eclipse.papyrus.uml.decoratormodel.ui.providers.DeleteEmptyDecoratorModelsPolicy;
+import org.eclipse.papyrus.uml.properties.widgets.ProfileApplicationEditor;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+import com.google.common.base.Function;
+import com.google.common.base.Strings;
+import com.google.common.collect.Iterables;
+
+/**
+ * Specialized property editor for profile applications of a package that enables editing of the selected profile application.
+ */
+public class ProfileApplicationPropertyEditor extends org.eclipse.papyrus.uml.properties.widgets.ProfileApplicationPropertyEditor {
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * @param style
+ */
+ public ProfileApplicationPropertyEditor(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected ProfileApplicationEditor createProfileApplicationEditor(Composite parent, int style) {
+ return new ExternalizableProfileApplicationEditor(parent, style);
+ }
+
+ //
+ // Nested types
+ //
+
+ static class ExternalizableProfileApplicationEditor extends ProfileApplicationEditor {
+
+ private Button externalizeButton;
+
+ private Button internalizeButton;
+
+ ExternalizableProfileApplicationEditor(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected void createListControls() {
+ super.createListControls();
+
+ externalizeButton = createButton(Activator.getDefault().getImage("/icons/full/ctool16/externalize.gif"), Messages.ProfileApplicationPropertyEditor_0); //$NON-NLS-1$
+ internalizeButton = createButton(Activator.getDefault().getImage("/icons/full/ctool16/internalize.gif"), Messages.ProfileApplicationPropertyEditor_1); //$NON-NLS-1$
+ }
+
+ @Override
+ protected ProfileColumnsLabelProvider createProfileColumnsLabelProvider(IBaseLabelProvider labelProvider) {
+ return new ExternalizableProfileColumnsLabelProvider(labelProvider);
+ }
+
+ @Override
+ protected void updateControls() {
+ super.updateControls();
+
+ final Package package_ = getInputPackage();
+ final Iterable<ProfileApplication> profileApplications = getSelectedProfileApplications();
+
+ boolean allInternalized = false;
+ for (ProfileApplication next : profileApplications) {
+ allInternalized = next.getApplyingPackage() == package_;
+ if (!allInternalized) {
+ break;
+ }
+ }
+ externalizeButton.setEnabled(allInternalized);
+
+ boolean allExternalized = false;
+ for (ProfileApplication next : profileApplications) {
+ allExternalized = next.getApplyingPackage() != package_;
+ if (!allExternalized) {
+ break;
+ }
+ }
+ internalizeButton.setEnabled(allExternalized);
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+
+ if (e.widget == externalizeButton) {
+ externalizeProfileApplications();
+ } else if (e.widget == internalizeButton) {
+ internalizeProfileApplications();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ Iterable<ProfileApplication> getSelectedProfileApplications() {
+ final Package package_ = getInputPackage();
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ return Iterables.transform(selection.toList(), new Function<Object, ProfileApplication>() {
+ public ProfileApplication apply(Object input) {
+ return package_.getProfileApplication((Profile) input, true);
+ }
+ });
+ }
+
+ Package getInputPackage() {
+ return (Package) getContextElement();
+ }
+
+ void externalizeProfileApplications() {
+ Package package_ = getInputPackage();
+
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(package_);
+ if (domain != null) {
+ ExternalizeProfileApplicationsWizard wizard = new ExternalizeProfileApplicationsWizard();
+ final Iterable<ProfileApplication> profileApplications = getSelectedProfileApplications();
+ wizard.init(package_, profileApplications);
+
+ WizardDialog dlg = new WizardDialog(getShell(), wizard);
+ if (dlg.open() == Window.OK) {
+ commit();
+ updateControls();
+ }
+ }
+ }
+
+ void internalizeProfileApplications() {
+ Package package_ = getInputPackage();
+
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(package_);
+ if (domain != null) {
+ final Iterable<ProfileApplication> profileApplications = getSelectedProfileApplications();
+ domain.getCommandStack().execute(DecoratorModelUtils.createReclaimProfileApplicationsCommand(profileApplications, new DeleteEmptyDecoratorModelsPolicy(new SameShellProvider(internalizeButton))));
+ commit();
+ updateControls();
+ }
+ }
+
+ //
+ // Nested types
+ //
+
+ protected class ExternalizableProfileColumnsLabelProvider extends ProfileColumnsLabelProvider {
+
+ public ExternalizableProfileColumnsLabelProvider(IBaseLabelProvider defaultLabelProvider) {
+ super(defaultLabelProvider);
+ }
+
+ @Override
+ public StyledString getStyledText(Object element) {
+ StyledString result = super.getStyledText(element);
+
+ ProfileApplication application = null;
+ if (element instanceof Profile) {
+ application = getInputPackage().getProfileApplication((Profile) element, true);
+ } else if (element instanceof ProfileApplication) {
+ application = (ProfileApplication) element;
+ }
+
+ if ((application != null) && (application.eResource() != getInputPackage().eResource())) {
+ Package rootPackage = (Package) EcoreUtil.getRootContainer(application);
+ String modelName = rootPackage.getName();
+ if (Strings.isNullOrEmpty(modelName)) {
+ modelName = rootPackage.eResource().getURI().trimFileExtension().lastSegment();
+ }
+ String qualifier = " " + NLS.bind(Messages.ProfileApplicationPropertyEditor_2, modelName); //$NON-NLS-1$
+
+ result.append(qualifier, StyledString.DECORATIONS_STYLER);
+ }
+
+ return result;
+ }
+ }
+ }
+
+}
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.classpath b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.classpath
index ad32c83a788..ad32c83a788 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.classpath
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.classpath
diff --git a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.project b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.project
index ac80b81cd93..10b0b694c9b 100644
--- a/sandbox/ExternalResourceStereotypeApplication/org.eclipse.papyrus.uml.profile.externalresource/.project
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.papyrus.uml.profile.externalresource</name>
+ <name>org.eclipse.papyrus.uml.decoratormodel.ui</name>
<comment></comment>
<projects>
</projects>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..94d61f00da6
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/META-INF/MANIFEST.MF b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..55c1d331102
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,42 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.uml.decoratormodel.ui;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.uml.decoratormodel.internal.ui.Activator
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
+ org.eclipse.uml2.uml;bundle-version="4.1.0";visibility:=reexport,
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.1.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.uml.decoratormodel;bundle-version="1.1.0",
+ org.eclipse.emf.edit.ui;bundle-version="2.10.0",
+ org.eclipse.core.expressions;bundle-version="3.4.600",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ org.eclipse.papyrus.editor;bundle-version="1.1.0",
+ org.eclipse.ui.ide;bundle-version="3.10.100",
+ org.eclipse.ui.navigator;bundle-version="3.5.500",
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="1.1.0";resolution:=optional,
+ org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.onefile;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.profile;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.uml.decoratormodel.internal.ui,
+ org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands;x-friends:="org.eclipse.papyrus.uml.decoratormodel.properties",
+ org.eclipse.papyrus.uml.decoratormodel.internal.ui.expressions;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.internal.ui.preferences;x-internal:=true,
+ org.eclipse.papyrus.uml.decoratormodel.internal.ui.providers;x-friends:="org.eclipse.papyrus.uml.decoratormodel.properties",
+ org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards;x-friends:="org.eclipse.papyrus.uml.decoratormodel.properties",
+ org.eclipse.papyrus.uml.decoratormodel.ui.providers
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/about.html b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/about.html
new file mode 100644
index 00000000000..d35d5aed64c
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.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>June 5, 2007</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>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/build.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/build.properties
new file mode 100644
index 00000000000..169989da1b8
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ documentation.pdoc,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/
+src.includes = about.html
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/documentation.pdoc b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/documentation.pdoc
new file mode 100644
index 00000000000..4887381972c
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/documentation.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="User interface elements for management of separate profile applications.">
+ <referent firstName="Christian" lastName="Damus" eMail="give.a.damus@gmail.com" currentCompany="independent"/>
+</doc:Documentation>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/icons/full/ovr16/profileApps.png b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/icons/full/ovr16/profileApps.png
new file mode 100644
index 00000000000..1214d5d30b4
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/icons/full/ovr16/profileApps.png
Binary files differ
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.properties b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.properties
new file mode 100644
index 00000000000..b82480134b3
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.properties
@@ -0,0 +1,38 @@
+# Copyright (c) 2014 Christian W. Damus and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Christian W. Damus - Initial API and implementation
+
+pluginName = Papyrus Decorator Models UI
+providerName = Eclipse Modeling Project
+
+externalize.label = Externalize Profile Applications...
+externalize.tooltip = Move profile applications into a separate model
+internalize.label = Internalize Profile Applications...
+internalize.tooltip = Reintegrate profile applications from a separate model into the main UML model
+unload.pkg.label = Unload Profile Applications
+unload.pkg.tooltip = Unload profile applications provided by the selected model
+load.label = Load Profile Applications...
+load.tooltip = Load external profile applications for the selected package
+unload.cmd.label = Unload Profile Applications...
+unload.cmd.tooltip = Unload profile applications for the selected package
+externalize.description = Move profile applications into separately loadable resources.
+externalize.name = Externalize Profile Applications
+internalize.description = Reintegrate externalized profile applications into the main UML model resource.
+internalize.name = Internalize Profile Applications
+unload.pkg.description = Unload profile applications provided by the selected resource.
+unload.pkg.name = Unload Profile Applications
+load.description = Load externalized profile applications for the selected package.
+load.name = Load Profile Applications
+unload.description = Unload profile applications for the selected package.
+unload.name = Unload Profile Applications
+cnf.filter.description = Filters out models that provide profile applications to Papyrus UML models.
+cnf.filter.name = Profile Applications
+profapps.decorator.label = Profile Applications
+profapps.decorator.description = Indicates workspace resources that are profile applications and packages in Model Explorer for which there are unloaded profile applications available that apply profiles to them.
+profapps.page.name = Profile Applications
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.xml
new file mode 100644
index 00000000000..ec1279518d5
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/plugin.xml
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.uml.modelrepair.refactor?after=additions">
+ <command
+ commandId="org.eclipse.papyrus.uml.decoratormodel.ui.ExternalizeProfiles"
+ label="%externalize.label"
+ style="push"
+ tooltip="%externalize.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate operator="and" ifEmpty="false">
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.uml.decoratormodel.ownsProfileApplications">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.decoratormodel.ui.InternalizeProfiles"
+ label="%internalize.label"
+ style="push"
+ tooltip="%internalize.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate operator="and" ifEmpty="false">
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.uml.decoratormodel.hasExternalProfileApplications">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
+ <command
+ commandId="org.eclipse.papyrus.uml.decoratormodel.ui.UnloadProfileApplications"
+ label="%unload.pkg.label"
+ style="push"
+ tooltip="%unload.pkg.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <iterate operator="and" ifEmpty="false">
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.uml.decoratormodel.isDecoratorModel">
+ </test>
+ </adapt>
+ </iterate>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.decoratormodel.ui.LoadAvailableDecoratorModels"
+ label="%load.label"
+ style="push"
+ tooltip="%load.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate operator="and" ifEmpty="false">
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.uml.decoratormodel.hasUnloadedDecoratorModels"
+ args="recursive,optimistic">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.decoratormodel.ui.UnloadLoadedDecoratorModels"
+ label="%unload.cmd.label"
+ style="push"
+ tooltip="%unload.cmd.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate operator="and" ifEmpty="false">
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.uml.decoratormodel.hasLoadedDecoratorModels"
+ args="recursive">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.ExternalizeProfilesHandler"
+ description="%externalize.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.ExternalizeProfiles"
+ name="%externalize.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.InternalizeProfilesHandler"
+ description="%internalize.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.InternalizeProfiles"
+ name="%internalize.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.UnloadDecoratorModelHandler"
+ description="%unload.pkg.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.UnloadProfileApplications"
+ name="%unload.pkg.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.LoadAvailableDecoratorModelsHandler"
+ description="%load.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.LoadAvailableDecoratorModels"
+ name="%load.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands.UnloadLoadedDecoratorModelsHandler"
+ description="%unload.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.UnloadLoadedDecoratorModels"
+ name="%unload.name">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.ui.expressions.PackagePropertyTester"
+ id="org.eclipse.papyrus.uml.decoratormodel.package"
+ namespace="org.eclipse.papyrus.uml.decoratormodel"
+ properties="ownsProfileApplications,hasExternalProfileApplications,isDecoratorModel,hasUnloadedDecoratorModels,hasLoadedDecoratorModels"
+ type="org.eclipse.uml2.uml.Package">
+ </propertyTester>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <commonFilter
+ activeByDefault="true"
+ description="%cnf.filter.description"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.DecoratorModelFilter"
+ name="%cnf.filter.name"
+ visibleInUI="true">
+ <filterExpression>
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <instanceof
+ value="org.eclipse.uml2.uml.Package">
+ </instanceof>
+ <test
+ property="org.eclipse.papyrus.uml.decoratormodel.isDecoratorModel">
+ </test>
+ </adapt>
+ </filterExpression>
+ </commonFilter>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ <includes>
+ <contentExtension
+ pattern="org.eclipse.papyrus.uml.decoratormodel.ui.*">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.ui.Startup"></startup>
+ </extension>
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.ui.providers.DecoratorModelLabelDecorator"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.DecoratorModel"
+ label="%profapps.decorator.label"
+ lightweight="true"
+ state="true">
+ <description>
+ %profapps.decorator.description
+ </description>
+ <enablement>
+ <or>
+ <objectClass
+ name="org.eclipse.emf.ecore.EObject">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.core.resources.IFile">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.papyrus.infra.onefile.model.IPapyrusFile">
+ </objectClass>
+ </or>
+ </enablement>
+ </decorator>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.core.model">
+ <modelSetSnippet
+ classname="org.eclipse.papyrus.uml.decoratormodel.internal.ui.providers.AvailableDecoratorModelsSnippet"
+ description="Interceptor of resource loads that optionally prompts to load available decorator models.">
+ </modelSetSnippet>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.ui.preferences.ProfileExternalizationUIPreferences">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
+ class="org.eclipse.papyrus.uml.decoratormodel.internal.ui.preferences.DecoratorModelPreferencePage"
+ id="org.eclipse.papyrus.uml.decoratormodel.ui.DecoratorModelPreferences"
+ name="%profapps.page.name">
+ </page>
+ </extension>
+</plugin>
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/pom.xml b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/pom.xml
new file mode 100644
index 00000000000..a2a1d6d5989
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../releng/top-pom-main.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.decoratormodel.ui</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Activator.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Activator.java
new file mode 100644
index 00000000000..df197410272
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Activator.java
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui;
+
+import java.util.concurrent.ExecutorService;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.infra.tools.util.UIUtil;
+import org.eclipse.papyrus.uml.decoratormodel.internal.resource.DecoratorModelIndex;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+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 {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.decoratormodel.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ private ExecutorService executorService;
+
+ /**
+ * Logging utility.
+ */
+ public static LogHelper log;
+
+ public Activator() {
+ super();
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ executorService = UIUtil.createUIExecutor(Display.getDefault());
+
+ plugin = this;
+ log = new LogHelper(this);
+
+ // Kick the index
+ DecoratorModelIndex.getInstance();
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ executorService.shutdown();
+ executorService = null;
+
+ plugin = null;
+ log = null;
+
+ super.stop(context);
+ }
+
+ /**
+ * Obtains the static instance.
+ *
+ * @return the static instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public ImageDescriptor getIcon(String path) {
+ if (!path.startsWith("icons/")) { //$NON-NLS-1$
+ path = "icons/" + path; //$NON-NLS-1$
+ }
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public ExecutorService getExecutorService() {
+ return executorService;
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ IWorkbenchWindow result = null;
+
+ IWorkbench bench = PlatformUI.getWorkbench();
+ if (bench != null) {
+ result = bench.getActiveWorkbenchWindow();
+ if (result == null) {
+ IWorkbenchWindow[] allWindows = bench.getWorkbenchWindows();
+ if (allWindows.length > 0) {
+ result = allWindows[0];
+ }
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Startup.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Startup.java
new file mode 100644
index 00000000000..3e8826b68b0
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/Startup.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui;
+
+import org.eclipse.ui.IStartup;
+
+/**
+ * Early start-up hook for the externalized profile applications subsystem.
+ */
+public class Startup implements IStartup {
+
+ public Startup() {
+ super();
+ }
+
+ @Override
+ public void earlyStartup() {
+ // Kick the index
+ Activator.getDefault();
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/ExternalizeProfilesHandler.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/ExternalizeProfilesHandler.java
new file mode 100644
index 00000000000..029aed14f48
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/ExternalizeProfilesHandler.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.ExternalizeProfileApplicationsWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Command handler for the "Externalize Profile Applications&hellip;" command.
+ */
+public class ExternalizeProfilesHandler extends AbstractHandler {
+
+ public ExternalizeProfilesHandler() {
+ super();
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbench bench = HandlerUtil.getActiveWorkbenchWindowChecked(event).getWorkbench();
+ ISelection selection = HandlerUtil.getActiveMenuSelectionChecked(event);
+
+ if (selection instanceof IStructuredSelection) {
+ ExternalizeProfileApplicationsWizard wizard = new ExternalizeProfileApplicationsWizard();
+ wizard.init(bench, (IStructuredSelection) selection);
+
+ WizardDialog dlg = new WizardDialog(bench.getActiveWorkbenchWindow().getShell(), wizard);
+ dlg.open();
+ }
+
+ return null;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/InternalizeProfilesHandler.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/InternalizeProfilesHandler.java
new file mode 100644
index 00000000000..2c2ab0175f1
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/InternalizeProfilesHandler.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.InternalizeProfileApplicationsWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Command handler for the "Internalize Profile Applications&hellip;" command.
+ */
+public class InternalizeProfilesHandler extends AbstractHandler {
+
+ public InternalizeProfilesHandler() {
+ super();
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbench bench = HandlerUtil.getActiveWorkbenchWindowChecked(event).getWorkbench();
+ ISelection selection = HandlerUtil.getActiveMenuSelectionChecked(event);
+
+ if (selection instanceof IStructuredSelection) {
+ InternalizeProfileApplicationsWizard wizard = new InternalizeProfileApplicationsWizard();
+ wizard.init(bench, (IStructuredSelection) selection);
+
+ WizardDialog dlg = new WizardDialog(bench.getActiveWorkbenchWindow().getShell(), wizard);
+ dlg.open();
+ }
+
+ return null;
+ }
+
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/LoadAvailableDecoratorModelsHandler.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/LoadAvailableDecoratorModelsHandler.java
new file mode 100644
index 00000000000..9a0ca979baf
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/LoadAvailableDecoratorModelsHandler.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.wizards.LoadProfileApplicationsWizard;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * Command handler for the "Load Available Profile Applications&hellip;" command.
+ */
+public class LoadAvailableDecoratorModelsHandler extends AbstractHandler {
+
+ public LoadAvailableDecoratorModelsHandler() {
+ super();
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event).getWorkbench().getActiveWorkbenchWindow();
+ ISelection selection = HandlerUtil.getActiveMenuSelectionChecked(event);
+
+ if (selection instanceof IStructuredSelection) {
+ Package package_ = (Package) EMFHelper.getEObject(((IStructuredSelection) selection).getFirstElement());
+ promptToLoadAvailableProfileApplications(window.getShell(), package_, false);
+ }
+
+ return null;
+ }
+
+ public static void promptToLoadAvailableProfileApplications(Shell parentShell, Package package_, final boolean autoPrompt) {
+ LoadProfileApplicationsWizard wizard = new LoadProfileApplicationsWizard(autoPrompt);
+ wizard.init(package_, Collections.<URI> emptySet());
+
+ WizardDialog dlg = new WizardDialog(parentShell, wizard);
+ dlg.open();
+ }
+}
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/UnloadDecoratorModelHandler.java b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/UnloadDecoratorModelHandler.java
new file mode 100644
index 00000000000..a09cc0227c5
--- /dev/null
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.ui/src/org/eclipse/papyrus/uml/decoratormodel/internal/ui/commands/UnloadDecoratorModelHandler.java
@@ -0,0 +1,273 @@
+/*****************************************************************************
+ * Copyright (c) 2014 Christian W. Damus and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.decoratormodel.internal.ui.commands;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Set;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.AbstractCommand.NonDirtying;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet;
+import org.eclipse.papyrus.uml.decoratormodel.internal.ui.messages.Messages;
+import org.eclipse.papyrus.uml.tools.utils.CustomUMLUtil;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.uml2.uml.Package;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
+
+/**
+ * Command handler for the "Unload Profile Applications" command.
+ */
+public class UnloadDecoratorModelHandler extends AbstractHandler {
+
+ public UnloadDecoratorModelHandler() {
+ super();
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ ISelection selection = HandlerUtil.getActiveMenuSelectionChecked(event);
+
+ ResourceSet resourceSet = null;
+ final Set<Resource> toUnload = Sets.newHashSet();
+ if (selection instanceof IStructuredSelection) {
+ for (Object next : ((IStructuredSelection) selection).toList()) {
+ EObject eObject = EMFHelper.getEObject(next);
+ if (eObject instanceof Package) {
+ Resource resource = eObject.eResource();
+ toUnload.add(resource);
+ resourceSet = resource.getResourceSet();
+ }
+ }
+ }
+
+ if (resourceSet != null) {
+ unloadResources(window, resourceSet, toUnload);
+ }
+
+ return null;
+ }
+
+ public static void unloadResources(IWorkbenchWindow uiContext, ResourceSet resourceSet, final Iterable<? extends Resource> resources) throws ExecutionException {
+ // Check for resources that need to be saved
+ final SaveHandler save = getSaveHandler(resourceSet);
+ boolean needSave = save.isSaveNeeded(resources);
+ if (needSave) {
+ if (!confirmSave(uiContext.getShell())) {
+ // Bail if user refused to save
+ return;
+ }
+
+ try {
+ uiContext.run(true, false, new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ save.save(resources, monitor);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ throw new ExecutionException(Messages.UnloadDecoratorModelHandler_0, e);
+ } catch (InvocationTargetException e) {
+ throw new ExecutionException(Messages.UnloadDecoratorModelHandler_1, e.getTargetException());
+ }
+ }
+
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resourceSet);
+ if (domain != null) {
+ class UnloadCommand extends AbstractCommand implements NonDirtying {
+ UnloadCommand() {
+ super(Messages.UnloadDecoratorModelHandler_2);
+ }
+
+ @Override
+ protected boolean prepare() {
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ for (Resource next : resources) {
+ // Destroy the contents of the resource to effect unapplication of stereotypes
+ CustomUMLUtil.destroyAll(next.getContents());
+
+ next.unload();
+ next.getResourceSet().getResources().remove(next);
+ next.eAdapters().clear();
+ }
+ }
+
+ /**
+ * Unloading resources breaks undo/redo of any previous commands that involved their
+ * contents.
+ *
+ * @return {@code false}, always
+ */
+ @Override
+ public boolean canUndo() {
+ return false;
+ }
+
+ @Override
+ public void redo() {
+ throw new IllegalStateException("command was not undone"); //$NON-NLS-1$
+ }
+ }
+
+ domain.getCommandStack().execute(new UnloadCommand());
+ }
+ }
+
+ static SaveHandler getSaveHandler(ResourceSet resourceSet) {
+ return (resourceSet instanceof ModelSet) ? new ModelSetSaveHandlerImpl((ModelSet) resourceSet) : new SaveHandlerImpl(resourceSet);
+ }
+
+ static boolean confirmSave(Shell parentShell) {
+ return MessageDialog.openConfirm(parentShell, Messages.UnloadDecoratorModelHandler_2, Messages.UnloadDecoratorModelHandler_3);
+ }
+
+ //
+ // Nested types
+ //
+
+ interface SaveHandler {
+ boolean isSaveNeeded(Iterable<? extends Resource> resources);
+
+ void save(Iterable<? extends Resource> resources, IProgressMonitor monitor) throws IOException;
+ }
+
+ static class SaveHandlerImpl implements SaveHandler {
+ private final ResourceSet resourceSet;
+
+ SaveHandlerImpl(ResourceSet resourceSet) {
+ this.resourceSet = resourceSet;
+ }
+
+ @Override
+ public boolean isSaveNeeded(Iterable<? extends Resource> resources) {
+ boolean result = false;
+ boolean trackingModification = true;
+
+ for (Resource next : resources) {
+ if (!next.isTrackingModification()) {
+