Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra')
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.classpath7
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.project28
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/META-INF/MANIFEST.MF13
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/about.html28
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/build.properties9
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/classf_obj.gifbin0 -> 373 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/file_obj.gifbin0 -> 354 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/jar_obj.gifbin0 -> 587 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/packagefolder_obj.gifbin0 -> 709 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/plugin_obj.gifbin0 -> 328 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/sample.gifbin0 -> 983 bytes
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.properties16
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.xml15
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/pluginexplorer.pdoc4
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java99
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/EmbeddedFile.java125
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PhysicalFile.java147
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Plugin.java227
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginEntry.java76
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentDialog.java182
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentLabelProvider.java33
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentProvider.java124
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentSelectionValidator.java34
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentView.java154
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java27
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java74
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml95
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java793
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/GmfEditorFactory.java3
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/DynamicDiagramsMenuContribution.java101
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramEditHelper.java178
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java120
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java165
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java15
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationUtils.java482
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java34
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java124
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/ControlDiagramsCommand.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml29
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/CreateDiagramWithNavigationHandler.java173
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx110
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java88
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java78
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java158
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml70
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/AbstractCreateNattableEditorHandler.java38
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java102
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java78
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java112
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java69
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java107
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/NattablePackage.java79
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/Table.java76
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/NattablePackageImpl.java41
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/TableImpl.java369
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF9
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml16
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom49
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom68
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet13
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom17
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java35
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java32
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java72
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java37
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java35
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt8
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java50
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/provider/ContextFeatureContentProvider.java65
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/utils/Constants.java2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml53
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd7
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF1
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.classpath7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/META-INF/MANIFEST.MF19
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/build.properties12
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreateChildRule_insertionPath_PathElement.pngbin0 -> 480 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_childRules_ChildRule.pngbin0 -> 595 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_paletteRules_PaletteRule.pngbin0 -> 629 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_modelRules_ModelRule.pngbin0 -> 674 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_owningRules_OwningRule.pngbin0 -> 626 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ChildRule.pngbin0 -> 490 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ElementImport.pngbin0 -> 657 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.pngbin0 -> 577 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.pngbin0 -> 540 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PaletteRule.pngbin0 -> 584 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusConfiguration.pngbin0 -> 747 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusDiagram.pngbin0 -> 453 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusSyncTable.pngbin0 -> 756 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusTable.pngbin0 -> 471 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.pngbin0 -> 638 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.pngbin0 -> 620 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PathElement.pngbin0 -> 388 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.properties91
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.xml22
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/CategoryItemProvider.java169
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ChildRuleItemProvider.java248
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationEditPlugin.java106
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationItemProviderAdapterFactory.java498
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ElementImportItemProvider.java182
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ModelRuleItemProvider.java251
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/OwningRuleItemProvider.java210
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PaletteRuleItemProvider.java152
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java255
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusDiagramItemProvider.java226
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusSyncTableItemProvider.java115
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusTableItemProvider.java148
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewItemProvider.java316
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewpointItemProvider.java166
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PathElementItemProvider.java202
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RuleItemProvider.java155
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.classpath7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/META-INF/MANIFEST.MF21
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/build.properties11
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/icons/full/obj16/ConfigurationModelFile.pngbin0 -> 747 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/icons/full/wizban/NewConfiguration.pngbin0 -> 3821 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/icons/full/wizban/NewConfiguration.svg250
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/plugin.properties65
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/plugin.xml34
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/src/org/eclipse/papyrus/infra/viewpoints/configuration/presentation/ConfigurationActionBarContributor.java434
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/src/org/eclipse/papyrus/infra/viewpoints/configuration/presentation/ConfigurationEditor.java1795
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/src/org/eclipse/papyrus/infra/viewpoints/configuration/presentation/ConfigurationEditorPlugin.java108
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/src/org/eclipse/papyrus/infra/viewpoints/configuration/presentation/ConfigurationModelWizard.java602
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/.classpath8
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/META-INF/MANIFEST.MF22
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/build.properties14
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/EClassPropertyDescriptor.java54
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/EPackagePropertyDescriptor.java55
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/EReferencePropertyDescriptor.java42
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ProfilePropertyDescriptor.java55
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/StereotypePropertyDescriptor.java83
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/SurrogateItemPropertyDescriptor.java69
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ConfigurationURLSelectionDialog.java149
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ECoreModelContentProvider.java68
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/IModelElementValidator.java29
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java222
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/ChildRule.svg209
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/ElementImport.svg206
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/ModelRule.svg228
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/OwningRule.svg209
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PaletteRule.svg315
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusConfiguration.svg213
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusDiagram.svg192
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusSyncTable.svg452
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusTable.svg440
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusView.svg272
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PapyrusViewpoint.svg199
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/PathElement.svg177
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/icons/svg/Stakeholder.svg320
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/model/configuration.ecore110
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/model/configuration.genmodel46
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/plugin.properties16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/plugin.xml11
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/Activator.java43
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/Category.java61
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/ChildRule.java124
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/ConfigurationFactory.java161
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/ConfigurationPackage.java2230
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/ElementImport.java89
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/ModelRule.java124
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/OwningRule.java107
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PaletteRule.java60
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusConfiguration.java108
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusDiagram.java137
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusSyncTable.java28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusTable.java60
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusView.java183
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PapyrusViewpoint.java61
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/PathElement.java95
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/Rule.java62
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/CategoryImpl.java174
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/ChildRuleImpl.java319
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/ConfigurationFactoryImpl.java238
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/ConfigurationPackageImpl.java864
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/ElementImportImpl.java228
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/ModelRuleImpl.java321
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/OwningRuleImpl.java272
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PaletteRuleImpl.java173
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusConfigurationImpl.java281
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusDiagramImpl.java354
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusSyncTableImpl.java50
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusTableImpl.java173
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusViewImpl.java442
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PapyrusViewpointImpl.java168
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/PathElementImpl.java255
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/impl/RuleImpl.java174
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/util/ConfigurationAdapterFactory.java438
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/src/org/eclipse/papyrus/infra/viewpoints/configuration/util/ConfigurationSwitch.java474
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/.classpath6
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/.settings/org.eclipse.core.resources.prefs3
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/META-INF/MANIFEST.MF8
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/build.properties6
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/plugin.properties16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/plugin.xml12
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/captures/config_sample.pngbin0 -> 12893 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/captures/menu_filtered.pngbin0 -> 8668 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/captures/menu_normal.pngbin0 -> 28682 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/captures/preferences.pngbin0 -> 13523 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/captures/properties.pngbin0 -> 19650 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/viewpoints-toc.xml28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/viewpoints.html34
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.doc/resources/viewpoints.mediawiki240
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/.classpath7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/META-INF/MANIFEST.MF15
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/build.properties12
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_concerns_Concern.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_correspondences_Correspondence.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_decisions_ArchitectureDecision.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_expresses_Architecture.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_rationales_ArchitectureRationale.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_rules_CorrespondenceRule.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_stakeholders_Stakeholder.pngbin0 -> 582 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_system_System.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_viewpoints_ArchitectureViewpoint.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureDescription_views_ArchitectureView.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureFramework_concerns_Concern.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureFramework_rules_CorrespondenceRule.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureFramework_stakeholders_Stakeholder.pngbin0 -> 582 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureFramework_viewpoints_ArchitectureViewpoint.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureView_models_ArchitectureModel.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/ctool16/CreateArchitectureViewpoint_modelKinds_ModelKind.gifbin0 -> 223 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/Architecture.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureDecision.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureDescription.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureFramework.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureModel.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureRationale.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureView.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ArchitectureViewpoint.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/Concern.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/Correspondence.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/CorrespondenceRule.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/ModelKind.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/Stakeholder.pngbin0 -> 525 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/icons/full/obj16/System.gifbin0 -> 129 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/plugin.properties95
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/plugin.xml22
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ADElementItemProvider.java180
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureDecisionItemProvider.java261
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureDescriptionItemProvider.java241
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureFrameworkItemProvider.java199
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureItemProvider.java156
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureModelItemProvider.java146
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureRationaleItemProvider.java146
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureViewItemProvider.java214
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ArchitectureViewpointItemProvider.java214
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ConcernItemProvider.java238
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/CorrespondenceItemProvider.java179
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/CorrespondenceRuleItemProvider.java156
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/Iso42010EditPlugin.java100
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/Iso42010ItemProviderAdapterFactory.java522
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/ModelKindItemProvider.java146
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/StakeholderItemProvider.java187
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010.edit/src/org/eclipse/papyrus/infra/viewpoints/iso42010/provider/SystemItemProvider.java213
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/.classpath7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/META-INF/MANIFEST.MF16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/build.properties12
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/model/iso42010.ecore129
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/model/iso42010.genmodel84
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/plugin.properties16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/plugin.xml18
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ADElement.java82
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Activator.java43
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Architecture.java63
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureDecision.java148
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureDescription.java226
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureFramework.java104
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureModel.java91
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureRationale.java53
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureView.java101
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ArchitectureViewpoint.java101
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Concern.java129
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Correspondence.java72
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/CorrespondenceRule.java55
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Iso42010Factory.java170
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Iso42010Package.java2304
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/ModelKind.java82
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/Stakeholder.java99
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/System.java111
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ADElementImpl.java248
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureDecisionImpl.java368
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureDescriptionImpl.java557
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureFrameworkImpl.java274
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureImpl.java220
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureModelImpl.java295
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureRationaleImpl.java176
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureViewImpl.java308
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ArchitectureViewpointImpl.java308
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ConcernImpl.java331
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/CorrespondenceImpl.java214
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/CorrespondenceRuleImpl.java178
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/Iso42010FactoryImpl.java263
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/Iso42010PackageImpl.java1007
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/ModelKindImpl.java253
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/StakeholderImpl.java303
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/impl/SystemImpl.java336
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/util/Iso42010AdapterFactory.java397
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.iso42010/src/org/eclipse/papyrus/infra/viewpoints/iso42010/util/Iso42010Switch.java437
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/.classpath8
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/.settings/org.eclipse.core.resources.prefs2
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF29
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/build.properties14
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration195
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Diagram_Package.gifbin0 -> 111 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewDiagram.gifbin0 -> 917 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewTable.gifbin0 -> 907 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Table.gifbin0 -> 893 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/UnavailableDiagram.gifbin0 -> 915 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/UnavailableTable.gifbin0 -> 914 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/UnavailableView.gifbin0 -> 901 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/View.gifbin0 -> 898 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/messages.properties13
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/model/style.ecore10
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/model/style.genmodel17
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/plugin.properties16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/plugin.xml51
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/custom.exsd113
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/profilehelper.exsd102
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd102
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/PapyrusViewStyle.java91
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/StyleFactory.java53
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/StylePackage.java200
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/impl/PapyrusViewStyleImpl.java229
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/impl/StyleFactoryImpl.java106
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/impl/StylePackageImpl.java210
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/util/StyleAdapterFactory.java151
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src-gen/org/eclipse/papyrus/infra/viewpoints/style/util/StyleSwitch.java139
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/Activator.java79
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/DynamicCommandHandler.java68
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/DynamicContribution.java77
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/IProfileHelper.java47
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/IViewTypeHelper.java60
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ModelAddData.java195
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/NotationUtils.java168
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java978
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PreferenceConstants.java73
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PreferenceInitializer.java41
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ProfileUtils.java86
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/UnavailableViewPrototype.java135
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java440
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java255
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewpointExplorer.java90
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/WeightedConfiguration.java123
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/.classpath7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/.project28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/META-INF/MANIFEST.MF18
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/about.html28
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/build.properties8
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/plugin.properties16
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/plugin.xml20
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/src/org/eclipse/papyrus/infra/viewpoints/preferences/Activator.java63
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/src/org/eclipse/papyrus/infra/viewpoints/preferences/ResourceFieldEditor.java158
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/src/org/eclipse/papyrus/infra/viewpoints/preferences/UpdatableComboBoxFieldEditor.java232
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.preferences/src/org/eclipse/papyrus/infra/viewpoints/preferences/ViewpointsPreferencePage.java295
391 files changed, 45933 insertions, 1375 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.classpath b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.classpath
new file mode 100755
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.project b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.project
new file mode 100755
index 00000000000..935d5ed70f1
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.core.pluginexplorer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/META-INF/MANIFEST.MF
new file mode 100755
index 00000000000..140ef3e5e4c
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.core.pluginexplorer;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.core.pluginexplorer.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %providerName
+Export-Package: org.eclipse.papyrus.infra.core.pluginexplorer
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/about.html b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/about.html
new file mode 100755
index 00000000000..dd02e0be168
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/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>December 2, 2009</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/build.properties b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/build.properties
new file mode 100755
index 00000000000..223e2e481f2
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ icons/,\
+ plugin.properties,\
+ plugin.xml
+src.includes = about.html
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/classf_obj.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/classf_obj.gif
new file mode 100755
index 00000000000..365e3721618
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/classf_obj.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/file_obj.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/file_obj.gif
new file mode 100755
index 00000000000..7ccc6a70317
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/file_obj.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/jar_obj.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/jar_obj.gif
new file mode 100755
index 00000000000..2fa1d777bc7
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/jar_obj.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/packagefolder_obj.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/packagefolder_obj.gif
new file mode 100755
index 00000000000..fca9c53e629
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/packagefolder_obj.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/plugin_obj.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/plugin_obj.gif
new file mode 100755
index 00000000000..8493df40dfe
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/plugin_obj.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/sample.gif b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/sample.gif
new file mode 100755
index 00000000000..34fb3c9d8cb
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/icons/sample.gif
Binary files differ
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.properties b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.properties
new file mode 100755
index 00000000000..2d32327eb5d
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.properties
@@ -0,0 +1,16 @@
+##########################################################################################
+# Copyright (c) 2013 CEA LIST.
+#
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation
+#
+########################################################################################
+
+pluginName = Plugin Explorer (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.xml b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.xml
new file mode 100755
index 00000000000..8f40342ff2d
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/plugin.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.eclipse.papyrus.views.category"
+ class="org.eclipse.papyrus.infra.core.pluginexplorer.PluginsContentView"
+ icon="icons/plugin_obj.gif"
+ id="org.eclipse.papyrus.infra.core.pluginexplorer.PluginsContentView"
+ name="Plugin Content Explorer">
+ </view>
+ </extension>
+
+</plugin>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/pluginexplorer.pdoc b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/pluginexplorer.pdoc
new file mode 100755
index 00000000000..ca34f5f4af0
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/pluginexplorer.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="This plugin gives access to the inner content of Eclipse plugins">
+ <referent firstName="Laurent " lastName="Wouters" eMail="laurent.wouters@cea.fr" currentCompany="CEA LIST"/>
+</doc:Documentation>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java
new file mode 100755
index 00000000000..a2aad4c02ce
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.net.URL;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+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.infra.core.pluginexplorer"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ // the plugin's context
+ private BundleContext context;
+
+ // The log for this plugin
+ private LogHelper log;
+
+ /**
+ * Gets the context of this plugin
+ * @return The plugin's context
+ */
+ public BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Gets the Papyrus log associated with this plugin
+ * @return The Papyrus log for this plugin
+ */
+ public LogHelper getPapyrusLog() {
+ return log;
+ }
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ this.log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ this.context = context;
+ ImageRegistry registry = getImageRegistry();
+ registry.put("plugin", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/plugin_obj.gif")));
+ registry.put("folder", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/packagefolder_obj.gif")));
+ registry.put("class", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/classf_obj.gif")));
+ registry.put("file", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/file_obj.gif")));
+ registry.put("jar", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/jar_obj.gif")));
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ 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;
+ }
+
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/EmbeddedFile.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/EmbeddedFile.java
new file mode 100755
index 00000000000..5a384d9a9f0
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/EmbeddedFile.java
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a file embedded in a Jar container that is a plugin loaded by Eclipse
+ * @author Laurent Wouters
+ */
+public class EmbeddedFile implements PluginEntry {
+ /**
+ * The parent plugin
+ */
+ private Plugin plugin;
+ /**
+ * The relative path to this file within the plugin
+ */
+ private String relativePath;
+ /**
+ * The name of this file
+ */
+ private String name;
+ /**
+ * The children list
+ */
+ private List<PluginEntry> children;
+
+ /**
+ * Gets the Jar entry as a String corresponding to this file
+ * @return The Jar entry for this file as a String
+ */
+ public String getEntry() { return relativePath; }
+
+
+ /**
+ * Creates the representation of a Jar entry as a plugin entry
+ * @param plugin The parent plugin
+ * @param entryName The Jar entry as a String
+ */
+ public EmbeddedFile(Plugin plugin, String entryName) {
+ this.plugin = plugin;
+ this.relativePath = entryName;
+ if (entryName.endsWith("/"))
+ this.relativePath = entryName.substring(0, entryName.length() - 1);
+ this.name = this.relativePath;
+ this.children = new ArrayList<PluginEntry>();
+ }
+
+ /**
+ * Creates the representation of a Jar entry as a plugin entry
+ * @param plugin The parent plugin
+ * @param entryName The Jar entry as a String
+ * @param parentEntry The parent Jar entry as a String
+ */
+ public EmbeddedFile(Plugin plugin, String entryName, String parentEntry) {
+ this.plugin = plugin;
+ this.relativePath = entryName;
+ if (entryName.endsWith("/"))
+ this.relativePath = entryName.substring(0, entryName.length() - 1);
+ this.name = relativePath.substring(parentEntry.length() + 1);
+ this.children = new ArrayList<PluginEntry>();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getPlugin()
+ */
+ public Plugin getPlugin() { return plugin; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getName()
+ */
+ public String getName() { return name; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getLogicalPath()
+ */
+ public String getLogicalPath() { return "platform:/plugin/" + plugin.getName() + "/" + relativePath; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getPhysicalPath()
+ */
+ public String getPhysicalPath() { return null; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#hasChildren()
+ */
+ public boolean hasChildren() { return (!children.isEmpty()); }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#children()
+ */
+ public List<PluginEntry> children() { return children; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getChild(java.lang.String)
+ */
+ public PluginEntry getChild(String name) {
+ for (PluginEntry entry : children)
+ if (entry.getName().equals(name))
+ return entry;
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getInputStream()
+ */
+ public InputStream getInputStream() {
+ return plugin.getStreamInJar(relativePath);
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PhysicalFile.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PhysicalFile.java
new file mode 100755
index 00000000000..83defc3ba87
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PhysicalFile.java
@@ -0,0 +1,147 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * Represents a physical file (on disk) as a resource within a plugin
+ * @author Laurent Wouters
+ */
+public class PhysicalFile implements PluginEntry {
+ /**
+ * A constant empty list of entries
+ */
+ private static final List<PluginEntry> empty = new ArrayList<PluginEntry>(0);
+
+ /**
+ * The parent plugin
+ */
+ private Plugin plugin;
+ /**
+ * The physical file represented by this object
+ */
+ private File file;
+ /**
+ * The cache of children
+ */
+ private List<PluginEntry> cache;
+
+ /**
+ * Creates the representation of a physical file as a plugin entry
+ * @param plugin The parent plugin
+ * @param file The represented physical file
+ */
+ public PhysicalFile(Plugin plugin, File file) {
+ this.plugin = plugin;
+ this.file = file;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getPlugin()
+ */
+ public Plugin getPlugin() { return plugin; }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getName()
+ */
+ public String getName() { return file.getName(); }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getLogicalPath()
+ */
+ public String getLogicalPath() {
+ IPath pp = new Path(plugin.getPhysicalPath());
+ IPath physical = new Path(file.getAbsolutePath());
+ return "platform:/plugin/" + plugin.getName() + "/" + physical.makeRelativeTo(pp).toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getPhysicalPath()
+ */
+ public String getPhysicalPath() { return file.getAbsolutePath(); }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#hasChildren()
+ */
+ public boolean hasChildren() {
+ if (file.isDirectory()) {
+ File[] content = file.listFiles();
+ return (content != null && content.length > 0);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#children()
+ */
+ public List<PluginEntry> children() {
+ if (cache != null)
+ return cache;
+ if (!file.isDirectory()) {
+ cache = empty;
+ return empty;
+ }
+ buildCache();
+ return cache;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getChild(java.lang.String)
+ */
+ public PluginEntry getChild(String name) {
+ if (cache == null)
+ buildCache();
+ for (PluginEntry entry : cache)
+ if (entry.getName().equals(name))
+ return entry;
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.core.pluginexplorer.PluginEntry#getInputStream()
+ */
+ public InputStream getInputStream() {
+ try {
+ return new FileInputStream(file);
+ } catch (FileNotFoundException e) {
+ // Cannot happen, unless the file has been deleted after the lookup
+ // in which case, too bad
+ return null;
+ }
+ }
+
+ /**
+ * Builds the cache of children entries
+ */
+ private void buildCache() {
+ File[] content = file.listFiles();
+ if (content == null || content.length == 0) {
+ cache = empty;
+ } else {
+ cache = new ArrayList<PluginEntry>(content.length);
+ for (int i=0; i!=content.length; i++)
+ cache.add(new PhysicalFile(plugin, content[i]));
+ }
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Plugin.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Plugin.java
new file mode 100755
index 00000000000..87165ce0428
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Plugin.java
@@ -0,0 +1,227 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.osgi.framework.Bundle;
+
+/**
+ * Represents an Eclipse plugin that can be introspected
+ * @author Laurent Wouters
+ */
+public class Plugin {
+
+ /**
+ * Gets an array of all the currently loaded plugins
+ * @return The currently loaded plugins
+ */
+ public static Plugin[] getLoadedPlugins() {
+ Bundle[] loaded = Activator.getDefault().getContext().getBundles();
+ Plugin[] plugins = new Plugin[loaded.length];
+ for (int i=0; i!=loaded.length; i++)
+ plugins[i] = new Plugin(loaded[i]);
+ return plugins;
+ }
+
+ /**
+ * The Eclipse bundle represented by this object
+ */
+ private Bundle bundle;
+ /**
+ * The list of entries at the plugin's root
+ */
+ private List<PluginEntry> entries;
+ /**
+ * The physical file represented by this object.
+ * It may be a jar file, or a folder.
+ */
+ private File physicalLocation;
+
+ /**
+ * Gets the corresponding Eclipse bundle
+ * @return The Eclipse bundle represented by this object
+ */
+ public Bundle getBundle() { return bundle; }
+
+ /**
+ * Gets whether this plugin contains resources
+ * @return <code>true</code> if this plugin contains resources
+ */
+ public boolean hasEntries() { return (!entries.isEmpty()); }
+
+ /**
+ * Gets the top entries within this plugin
+ * @return The top entries
+ */
+ public List<PluginEntry> entries() { return entries; }
+
+ /**
+ * Gets the qualified name of this plugin.
+ * This is the symbolic name of the represented bundle
+ * @return The plugin's name
+ */
+ public String getName() { return bundle.getSymbolicName(); }
+
+ /**
+ * Initializes this plugin with the given Eclipse bundle
+ * @param bundle The Eclipse bundle to represent
+ */
+ public Plugin(Bundle bundle) {
+ this.bundle = bundle;
+ this.entries = new ArrayList<PluginEntry>();
+ try { physicalLocation = FileLocator.getBundleFile(bundle); }
+ catch (IOException e) {
+ Activator.getDefault().getPapyrusLog().error("Failed to locate the plugin " + bundle.getSymbolicName(), e);
+ }
+ if (physicalLocation == null)
+ return;
+ if (physicalLocation.isDirectory())
+ buildFromDirectory();
+ else
+ buildFromJar();
+ }
+
+ /**
+ * Gets the absolute physical path to this plugin
+ * @return The absolute path to this plugin
+ */
+ public String getPhysicalPath() {
+ if (physicalLocation == null)
+ return null;
+ return physicalLocation.getAbsolutePath();
+ }
+
+ /**
+ * Gets the entry corresponding to the given path, or <code>null</code> if none is found.
+ * Paths shall be of the form <code>part1/part2/part3</code>, etc.
+ * @param path The path to lookup for an entry
+ * @return The corresponding entry or <code>null</code> if none is found
+ */
+ public PluginEntry getEntry(String path) {
+ // sanitize
+ int start = (path.startsWith("/") ? 1 : 0);
+ int end = (path.endsWith("/") ? path.length() - 1 : path.length());
+ path = path.substring(start, end);
+ // split into the path elements
+ String[] parts = path.split("/");
+ PluginEntry current = null;
+ for (PluginEntry e : entries) {
+ if (e.getName().equals(parts[0])) {
+ current = e;
+ break;
+ }
+ }
+ if (current == null)
+ return null;
+ for (int i=1; i!=parts.length; i++) {
+ current = current.getChild(parts[i]);
+ if (current == null)
+ return null;
+ }
+ return current;
+ }
+
+ /**
+ * Builds this plugin from a physical directory
+ */
+ private void buildFromDirectory() {
+ File[] content = physicalLocation.listFiles();
+ if (content == null || content.length == 0)
+ return;
+ for (int i=0; i!=content.length; i++)
+ entries.add(new PhysicalFile(this, content[i]));
+ }
+
+ /**
+ * Builds this plugin from a Jar file
+ */
+ private void buildFromJar() {
+ try {
+ JarFile jar = new JarFile(physicalLocation);
+ List<JarEntry> content = new ArrayList<JarEntry>();
+ Enumeration<JarEntry> e = jar.entries();
+ while (e.hasMoreElements())
+ content.add(e.nextElement());
+ Collections.sort(content, new Comparator<JarEntry>() {
+ public int compare(JarEntry arg0, JarEntry arg1) {
+ return arg0.getName().compareTo(arg1.getName());
+ }
+ });
+ int next = 0;
+ while (next < content.size()) {
+ EmbeddedFile child = new EmbeddedFile(this, content.get(next).getName());
+ next = buildChildren(child, content, next + 1);
+ entries.add(child);
+ }
+ jar.close();
+ }
+ catch (IOException e) { }
+ }
+
+ /**
+ * Builds the given embedded file with the given data
+ * @param parent The parent embedded directory
+ * @param content The sorted list of all the jar entries
+ * @param index The current index in the list of jar entries
+ * @return The final index within the jar entries
+ */
+ private int buildChildren(EmbeddedFile parent, List<JarEntry> content, int index) {
+ if (index >= content.size())
+ return index;
+ int next = index;
+ while (next < content.size() && content.get(next).getName().startsWith(parent.getEntry())) {
+ EmbeddedFile child = new EmbeddedFile(this, content.get(next).getName(), parent.getEntry());
+ next = buildChildren(child, content, next + 1);
+ parent.children().add(child);
+ }
+ return next;
+ }
+
+ InputStream getStreamInJar(String localPath) {
+ try {
+ final JarFile jar = new JarFile(physicalLocation);
+ final JarEntry entry = jar.getJarEntry(localPath);
+ return new InputStream() {
+ private InputStream inner = jar.getInputStream(entry);
+ @Override
+ public int read() throws IOException {
+ return inner.read();
+ }
+ @Override
+ public void close() {
+ try {
+ inner.close();
+ jar.close();
+ }
+ catch (IOException e) { }
+ }
+ };
+ }
+ catch (IOException e) {
+ return null;
+ }
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginEntry.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginEntry.java
new file mode 100755
index 00000000000..3c7bf7556ff
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginEntry.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.io.InputStream;
+import java.util.List;
+
+
+/**
+ * Represents a resource within a plugin
+ * @author Laurent Wouters
+ */
+public interface PluginEntry {
+ /**
+ * Gets the parent plugin
+ * @return The parent plugin
+ */
+ Plugin getPlugin();
+
+ /**
+ * Gets the name of this entry
+ * @return The simple name of this entry
+ */
+ String getName();
+
+ /**
+ * Gets the String representation of the URI that can be used to access this resource.
+ * The returned URI is always prefixed by the <code>platform:/plugin/</code> scheme.
+ * @return The logical path to this entry
+ */
+ String getLogicalPath();
+
+ /**
+ * Gets the String representation of the physical path to the file represented by this entry.
+ * This path only exists for files already on disk, for embedded files this method should return <code>null</null>.
+ * @return The physical absolute path to the file
+ */
+ String getPhysicalPath();
+
+ /**
+ * Gets whether this entry has children (sub-entries), in which case this entry is a directory.
+ * @return <code>true</code> if this entry contains sub-entries
+ */
+ boolean hasChildren();
+
+ /**
+ * Gets the children of this entry (sub-entries)
+ * @return The children entries
+ */
+ List<PluginEntry> children();
+
+ /**
+ * Gets the child of this entry with the given name, or null if none is found
+ * @param name The name to lookup for
+ * @return The child entry with the given name
+ */
+ PluginEntry getChild(String name);
+
+ /**
+ * Gets an input stream on the resource represented by this entry
+ * @return An input stream on the resource
+ */
+ InputStream getInputStream();
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentDialog.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentDialog.java
new file mode 100755
index 00000000000..f5d6ddb4375
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentDialog.java
@@ -0,0 +1,182 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.io.File;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SegmentEvent;
+import org.eclipse.swt.events.SegmentListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.osgi.framework.Bundle;
+
+/**
+ * Represents a dialog for the selection of plugins and their resources by a user
+ * @author Laurent Wouters
+ */
+public class PluginsContentDialog extends Dialog {
+ private static final int SIZE_WIDTH = 400;
+ private static final int SIZE_HEIGHT = 300;
+
+ private PluginsContentSelectionValidator validator;
+ private String title;
+ private String message;
+ private Plugin[] plugins;
+ private TreeViewer tree;
+ private Text field;
+ private Object selection;
+
+ /**
+ * Gets the selected element
+ * @return The element selected by the user
+ */
+ public Object getSelection() {
+ return selection;
+ }
+
+ /**
+ * Creates a new dialog
+ * @param parentShell The parent shell
+ * @param validator The validator used for validating the user's selection
+ * @param title The dialog's title
+ * @param message The dialog's message
+ */
+ public PluginsContentDialog(Shell parentShell, PluginsContentSelectionValidator validator, String title, String message) {
+ super(parentShell);
+ this.validator = validator;
+ this.title = title;
+ this.message = message;
+ this.plugins = Plugin.getLoadedPlugins();
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ // create composite
+ Composite composite = (Composite) super.createDialogArea(parent);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ composite.setLayout(gridLayout);
+
+ Label label = new Label(composite, SWT.WRAP | SWT.SINGLE);
+ label.setText(message);
+ label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
+
+ field = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ field.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
+ field.addSegmentListener(new SegmentListener(){
+ public void getSegments(SegmentEvent event) {
+ if (tree != null)
+ tree.setContentProvider(new PluginsContentProvider(plugins, field.getText()));
+ }
+ });
+
+ Composite inner = new Composite(composite, SWT.NONE);
+ inner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.FILL_VERTICAL));
+ inner.setLayout(new FillLayout());
+
+ tree = new TreeViewer(inner, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ tree.setLabelProvider(new PluginsContentLabelProvider());
+ tree.setSorter(getViewerSorter());
+ tree.setContentProvider(new PluginsContentProvider(plugins, null));
+ tree.setInput(PluginsContentProvider.treeRoot);
+ tree.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection s = (IStructuredSelection)event.getSelection();
+ selection = s.getFirstElement();
+ resetValidity();
+ }
+ });
+
+ applyDialogFont(composite);
+ return composite;
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control composite = super.createButtonBar(parent);
+ resetValidity();
+ return composite;
+ }
+
+ /**
+ * Enquires about the current validity of the selection and disables or enables the dialog's validation correspondingly
+ */
+ private void resetValidity() {
+ if (selection == null) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ return;
+ }
+ if (validator == null) {
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ return;
+ }
+ boolean valid = false;
+ if (selection instanceof Plugin)
+ valid = validator.isValid((Plugin)selection);
+ else if (selection instanceof PluginEntry)
+ valid = validator.isValid((PluginEntry)selection);
+ getButton(IDialogConstants.OK_ID).setEnabled(valid);
+ }
+
+ @Override
+ protected boolean isResizable() { return true; }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setSize(SIZE_WIDTH, SIZE_HEIGHT);
+ Point size = shell.getParent().getShell().getSize();
+ shell.setLocation((size.x - SIZE_WIDTH)/2, (size.y - SIZE_HEIGHT)/2);
+ shell.setText(title);
+ }
+
+ /**
+ * Gets the viewer sorter for this dialog
+ * @return A viewer sorter
+ */
+ private ViewerSorter getViewerSorter() {
+ return new ViewerSorter() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if (e1 instanceof Bundle) {
+ Bundle b1 = (Bundle)e1;
+ Bundle b2 = (Bundle)e2;
+ return b1.getSymbolicName().compareTo(b2.getSymbolicName());
+ } else if (e1 instanceof File) {
+ File f1 = (File)e1;
+ File f2 = (File)e2;
+ return (f1.getName().compareTo(f2.getName()));
+ }
+ return super.compare(viewer, e1, e2);
+ }
+ };
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentLabelProvider.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentLabelProvider.java
new file mode 100755
index 00000000000..8161504028f
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentLabelProvider.java
@@ -0,0 +1,33 @@
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class PluginsContentLabelProvider extends LabelProvider {
+ @Override
+ public Image getImage(Object element) {
+ ImageRegistry registry = Activator.getDefault().getImageRegistry();
+ if (element instanceof Plugin) {
+ return registry.get("plugin");
+ } else if (element instanceof PluginEntry) {
+ if (((PluginEntry) element).hasChildren())
+ return registry.get("folder");
+ String name = ((PluginEntry) element).getName();
+ if (name.endsWith(".class"))
+ return registry.get("class");
+ else if (name.endsWith(".jar"))
+ return registry.get("jar");
+ }
+ return registry.get("file");
+ }
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Plugin) {
+ return ((Plugin)element).getName();
+ } else if (element instanceof PluginEntry) {
+ return ((PluginEntry)element).getName();
+ }
+ return element.toString();
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentProvider.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentProvider.java
new file mode 100755
index 00000000000..84ef2271d6e
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentProvider.java
@@ -0,0 +1,124 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Represents a provider of plugins their content
+ * @author Laurent Wouters
+ */
+public class PluginsContentProvider implements ITreeContentProvider {
+
+ /**
+ * The root of all plugins
+ */
+ public static final Object treeRoot = new Object();
+
+ /**
+ * The unfiltered list of loaded plugins
+ */
+ private Plugin[] plugins;
+ /**
+ * The current filter
+ */
+ private String filter;
+
+ /**
+ * Creates the provider with the given filter on plugins' names
+ * @param plugins The plugins to provide
+ * @param filter The filter used on plugins' names
+ */
+ public PluginsContentProvider(Plugin[] plugins, String filter) {
+ this.plugins = plugins;
+ this.filter = filter;
+ if (this.filter != null && this.filter.isEmpty())
+ this.filter = null;
+ }
+
+ /**
+ * Gets the plugins to provide after the application of the filter
+ * @return The plugins to provide
+ */
+ private Object[] getFilteredPlugins() {
+ if (filter == null)
+ return plugins;
+ List<Plugin> list = new ArrayList<Plugin>();
+ for (int i=0; i!=plugins.length; i++) {
+ String name = plugins[i].getName();
+ if (name.contains(filter))
+ list.add(plugins[i]);
+ }
+ return list.toArray();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() { }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return getFilteredPlugins();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object element) {
+ if (element == treeRoot)
+ return getFilteredPlugins();
+ if (element instanceof Plugin)
+ return ((Plugin)element).entries().toArray();
+ else if (element instanceof PluginEntry)
+ return ((PluginEntry)element).children().toArray();
+ return new Object[0];
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ public Object getParent(Object element) {
+ if (element == treeRoot)
+ return null;
+ if (element instanceof Plugin)
+ return treeRoot;
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element) {
+ if (element == treeRoot)
+ return true;
+ if (element instanceof Plugin)
+ return ((Plugin)element).hasEntries();
+ else if (element instanceof PluginEntry)
+ return ((PluginEntry)element).hasChildren();
+ return false;
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentSelectionValidator.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentSelectionValidator.java
new file mode 100755
index 00000000000..9b90f2958e1
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentSelectionValidator.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+/**
+ * Validates the selection of a resource in a plugin
+ * @author Laurent Wouters
+ */
+public interface PluginsContentSelectionValidator {
+ /**
+ * Determines whether the given plugin is a valid selection
+ * @param plugin The plugin
+ * @return <code>true</code> if the plugin is a valid selection
+ */
+ boolean isValid(Plugin plugin);
+ /**
+ * Determines whether the given plugin entry is a valid selection
+ * @param entry The plugin entry
+ * @return <code>true</code> if the plugin entry is a valid selection
+ */
+ boolean isValid(PluginEntry entry);
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentView.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentView.java
new file mode 100755
index 00000000000..fc1a76362da
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/PluginsContentView.java
@@ -0,0 +1,154 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.pluginexplorer;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.io.File;
+
+import org.eclipse.jface.action.AbstractAction;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.SegmentEvent;
+import org.eclipse.swt.events.SegmentListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.part.ViewPart;
+import org.osgi.framework.Bundle;
+
+/**
+ * This represents an Eclipse View displaying reflective information about the loaded Eclipse plugins
+ * @author Laurent Wouters
+ */
+public class PluginsContentView extends ViewPart {
+
+ /**
+ * The ID of the view as specified by the extension.
+ */
+ public static final String ID = "org.eclipse.papyrus.infra.core.pluginexplorer.PluginReflectorView";
+
+ private Plugin[] plugins;
+ private TreeViewer tree;
+ private Text field;
+
+ /**
+ * Initializes this view
+ */
+ public PluginsContentView() {
+ this.plugins = Plugin.getLoadedPlugins();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ parent.setLayout(gridLayout);
+
+ field = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ field.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
+ field.addSegmentListener(new SegmentListener(){
+ public void getSegments(SegmentEvent event) {
+ if (tree != null)
+ tree.setContentProvider(new PluginsContentProvider(plugins, field.getText()));
+ }
+ });
+
+ Composite inner = new Composite(parent, SWT.NONE);
+ inner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.FILL_VERTICAL));
+ inner.setLayout(new FillLayout());
+
+ tree = new TreeViewer(inner, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ tree.setLabelProvider(new PluginsContentLabelProvider());
+ tree.setSorter(getViewerSorter());
+ tree.setContentProvider(new PluginsContentProvider(plugins, null));
+ tree.setInput(PluginsContentProvider.treeRoot);
+ tree.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if(event.getSelection() instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection)event.getSelection();
+ Object obj = selection.getFirstElement();
+
+ MenuManager menuMgr = new MenuManager();
+ Menu menu = menuMgr.createContextMenu(tree.getControl());
+ tree.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, tree);
+
+ if (obj instanceof PluginEntry)
+ fillMenuFor((PluginEntry)obj, menuMgr);
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+ */
+ @Override
+ public void setFocus() {
+ field.setFocus();
+ }
+
+ /**
+ * Gets the viewer sorter for this dialog
+ * @return A viewer sorter
+ */
+ private ViewerSorter getViewerSorter() {
+ return new ViewerSorter() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if (e1 instanceof Bundle) {
+ Bundle b1 = (Bundle)e1;
+ Bundle b2 = (Bundle)e2;
+ return b1.getSymbolicName().compareTo(b2.getSymbolicName());
+ } else if (e1 instanceof File) {
+ File f1 = (File)e1;
+ File f2 = (File)e2;
+ return (f1.getName().compareTo(f2.getName()));
+ }
+ return super.compare(viewer, e1, e2);
+ }
+ };
+ }
+
+ private void fillMenuFor(final PluginEntry entry, MenuManager menu) {
+ menu.add(new org.eclipse.jface.action.Action("Copy URI to clipboard") {
+ @Override
+ public void run() {
+ StringSelection transferable = new StringSelection(entry.getLogicalPath());
+ Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+ clipboard.setContents(transferable, null);
+ }
+ });
+ }
+} \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
index c8f2154ede7..385a581b8bf 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
org.eclipse.gmf.runtime.notation.edit;bundle-version="1.7.0",
org.w3c.dom.svg;bundle-version="1.1.0"
Export-Package: org.eclipse.papyrus.infra.gmfdiag.css,
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
index 28183752898..62f2a628285 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
@@ -28,6 +28,11 @@ import org.eclipse.papyrus.infra.gmfdiag.css.engine.DiagramCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
/**
* Default implementation for CSSDiagram
@@ -84,9 +89,31 @@ public class CSSDiagramImpl extends DiagramImpl implements CSSDiagram {
}
}
+ StyleSheet s = getViewpointDefinedStylesheet();
+ if (s != null)
+ result.add(s);
+
return result;
}
+ private StyleSheet getViewpointDefinedStylesheet() {
+ ViewPrototype proto = ViewPrototype.get(this);
+ if (proto == null) {
+ return null;
+ }
+ PapyrusView conf = proto.getConfiguration();
+ if (conf == null || !(conf instanceof PapyrusDiagram)) {
+ return null;
+ }
+ String path = ((PapyrusDiagram) conf).getCustomStyle();
+ if (path == null || path.isEmpty()) {
+ return null;
+ }
+ StyleSheetReference ref = StylesheetsFactory.eINSTANCE.createStyleSheetReference();
+ ref.setPath(path);
+ return ref;
+ }
+
private class DiagramDisposeListener extends AdapterImpl {
@Override
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/META-INF/MANIFEST.MF
index 8870a72c112..493e7348a61 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/META-INF/MANIFEST.MF
@@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ui.workbench,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
org.eclipse.core.expressions;bundle-version="3.4.500",
org.eclipse.gmf.runtime.diagram.ui.resources.editor
Bundle-Vendor: %providerName
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java
index cf4e726d3f5..532f4ebe38b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/ICreationCommand.java
@@ -12,7 +12,10 @@ package org.eclipse.papyrus.commands;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
/**
* Define a command use to create new diagram. It use to provide Eclipse
@@ -24,33 +27,66 @@ import org.eclipse.papyrus.infra.core.resource.ModelSet;
public interface ICreationCommand {
/**
- * Create a new diagram in diResourceSet with the given name and open it.
+ * Create a diagram.
+ * This method will try to find an adequate view for the passed arguments
*
* @param modelSet
- * the resourceSet containing all diagrams
- * @param container
- * of the diagram, if container is null, the diagram is contained
- * by the top level container
- * @param diagramName
- * the name of the new diagram or null to use a dialog to choose
- * the name
+ * the current model set
+ * @param owner
+ * the diagram's owner and root element
+ * @param name
+ * the diagram's name
+ * @return the created diagram, or <code>null</code> if the creation failed
*/
- public void createDiagram(ModelSet modelSet, EObject container, String diagramName);
+ public Diagram createDiagram(ModelSet modelSet, EObject owner, String name);
/**
- * Get a command to create a new diagram in diResourceSet with the given
- * name.
+ * Create a diagram.
*
* @param modelSet
- * the resourceSet containing all diagrams
- * @param container
- * of the diagram, if container is null, the diagram is contained
- * by the top level container
- * @param diagramName
- * the name of the new diagram or null to use a dialog to choose
- * the name
+ * the current model set
+ * @param owner
+ * the diagram's owner
+ * @param element
+ * the diagram's model element
+ * @param prototype
+ * the diagram's prototype
+ * @param name
+ * the diagram's name
+ * @return the created diagram, or <code>null</code> if the creation failed
*/
- public ICommand getCreateDiagramCommand(final ModelSet modelSet, final EObject container, final String diagramName);
+ public Diagram createDiagram(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name);
+
+ /**
+ * Gets the GMF command for the diagram creation
+ * This method will try to find an adequate view for the passed arguments
+ *
+ * @param modelSet
+ * the current model set
+ * @param owner
+ * the diagram's owner and root element
+ * @param name
+ * the diagram's name
+ * @return the created diagram, or <code>null</code> if the creation failed
+ */
+ public ICommand getCreateDiagramCommand(ModelSet modelSet, EObject owner, String name);
+
+ /**
+ * Gets the GMF command for the diagram creation
+ *
+ * @param modelSet
+ * the current model set
+ * @param owner
+ * the diagram's owner
+ * @param element
+ * the diagram's model element
+ * @param prototype
+ * the diagram's prototype
+ * @param name
+ * the diagram's name
+ * @return the created diagram, or <code>null</code> if the creation failed
+ */
+ public ICommand getCreateDiagramCommand(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name);
/**
* Get the type of the diagram to create.
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 2df85a9ff59..5d782327186 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -55,6 +55,8 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0",
org.eclipse.papyrus.infra.services.decoration;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
org.eclipse.papyrus.uml.tools
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
index 2d220dd6389..9ed75968eea 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
@@ -7,8 +7,8 @@
<extension-point id="shapeProvider" name="ShapeProvider" schema="schema/shapeProvider.exsd"/>
<extension-point id="notationTypesMapping" name="notationTypesMapping" schema="schema/notationTypesMapping.exsd"/>
<extension-point id="svgPostProcessors" name="svgPostProcessors" schema="schema/svgPostProcessors.exsd"/>
- <extension-point id="pasteCommandProvider" name="pasteCommandProvider" schema="schema/pasteCommandProvider.exsd"/>
-
+ <extension-point id="pasteCommandProvider" name="pasteCommandProvider" schema="schema/pasteCommandProvider.exsd"/>
+
<extension
point="org.eclipse.ui.handlers">
<handler
@@ -148,6 +148,27 @@
</binding>
</extension>
<extension
+ point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
+ <metamodel
+ nsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation">
+ <metamodelType
+ eclass="Diagram"
+ edithelper="org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramEditHelper"
+ id="org.eclipse.papyrus.infra.gmfdiag.common.DiagramElementType"
+ name="Diagram">
+ </metamodelType>
+ </metamodel>
+</extension>
+<extension
+ point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
+ <binding
+ context="org.eclipse.papyrus.infra.services.edit.TypeContext">
+ <elementType
+ ref="org.eclipse.papyrus.infra.gmfdiag.common.DiagramElementType">
+ </elementType>
+ </binding>
+</extension>
+<extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramPropertyTester"
@@ -163,6 +184,76 @@
properties="isGmfDiagramContextActive"
type="java.util.Collection">
</propertyTester>
+</extension>
+<extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
+ <dynamic
+ class="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution"
+ id="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution">
+ </dynamic>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:org.eclipse.papyrus.ui.menu">
+ <menu
+ icon="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewDiagram.gif"
+ id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams"
+ label="New Diagram">
+ <dynamic
+ class="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution"
+ id="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution">
+ </dynamic>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar">
+ <command
+ commandId="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.diagrams.command"
+ icon="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewDiagram.gif"
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.diagrams"
+ label="Create a new diagram ..."
+ style="pulldown"
+ tooltip="Create a new diagram ...">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </toolbar>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:org.eclipse.papyrus.infra.viewpoints.policy.toolbar.diagrams">
+ <dynamic
+ class="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution"
+ id="org.eclipse.papyrus.infra.gmfdiag.common.handler.DynamicDiagramsMenuContribution">
+ </dynamic>
+ </menuContribution>
+</extension>
+<extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.infra.viewpoints.policy.commands"
+ defaultHandler="org.eclipse.papyrus.infra.viewpoints.policy.DynamicCommandHandler"
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.diagrams.command"
+ name="Create Dynamic Diagram Command">
+ </command>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.viewpoints.policy.viewType">
+ <helper
+ class="org.eclipse.papyrus.infra.gmfdiag.common.helper.GMFDiagramViewTypeHelper">
+ </helper>
</extension>
<extension
point="org.eclipse.papyrus.infra.gmfdiag.common.shapeProvider">
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java
index 103b1eb5ee7..6ebafce763c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java
@@ -1,382 +1,411 @@
-/*****************************************************************************
- * Copyright (c) 2008, 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
- * Christian W. Damus (CEA) - only calculate affected files for workspace resources (CDO)
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.common;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-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.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.commands.ICreationCommand;
-import org.eclipse.papyrus.commands.OpenDiagramCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModelUtils;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
-import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
-import org.eclipse.papyrus.uml.tools.model.UmlUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Command creating a new GMF diagram in Papyrus. This command is intended to be used in eclipse
- * extensions.
- *
- * Commands to create a GMF Diagram can subclass this class. There is two kinds of commands: -
- * Eclipse handlers issuing commands (toolbar, menu, ...). This commands can find the active editor
- * by using the Worbench.getActivePArt(). The entry point is {@link #execute(ExecutionEvent)}. -
- * Commands called during editor initializing (like wizard). This commands require the diResourceSet
- * to work. The entry point is {@link #createDiagram(DiResourceSet, EObject, String)}
- *
- * @author cedric dumoulin
- * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
- */
-public abstract class AbstractPapyrusGmfCreateDiagramCommandHandler extends AbstractHandler implements IHandler, ICreationCommand {
-
- /**
- * Method called when the command is invoked.
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- ServicesRegistry registry;
- try {
- registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
- } catch (ServiceException ex) {
- throw new ExecutionException("Cannot retrieve the ServicesRegistry", ex);
- }
-
- EObject container = null;
- // if editor is open and active
- container = getSelectedElement();
- runAsTransaction(container, registry);
- return null;
- }
-
- /**
- * Create a new class diagram
- *
- * @param sharedObjects
- * @param container
- * The uml element to which the diagram should be attached, if possible.
- * @throws ExecutionException
- */
- protected void runAsTransaction(EObject container, ServicesRegistry registry) throws ExecutionException {
-
- ModelSet modelSet;
- try {
- modelSet = registry.getService(ModelSet.class);
- } catch (ServiceException e) {
- throw new ExecutionException("Can't get ModelSet", e);
- }
-
- runAsTransaction(modelSet, container, null);
- }
-
- /**
- * Create a new gmf diagram
- *
- * @param sharedObjects
- * @param container
- * The eObject to which the diagram should be attached, if possible.
- */
- protected void runAsTransaction(final ModelSet modelSet, final EObject container, String name) {
- TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
- CompositeCommand cmd = new CompositeCommand("Create diagram");
- ICommand createCmd = getCreateDiagramCommand(modelSet, container, name);
- cmd.add(createCmd);
- cmd.add(new OpenDiagramCommand(dom, createCmd));
-
- dom.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
- }
-
- /**
- * Get the root element associated with canvas.
- */
- protected EObject getRootElement(Resource modelResource) {
- EObject rootElement = null;
- if(modelResource != null && modelResource.getContents() != null && modelResource.getContents().size() > 0) {
- Object root = modelResource.getContents().get(0);
- if(root instanceof EObject) {
- rootElement = (EObject)root;
- }
- }
-
- return rootElement;
- }
-
- /**
- * Store model element in the resource.
- */
- protected void attachModelToResource(EObject root, Resource resource) {
- resource.getContents().add(root);
- }
-
- /**
- * Get the type of the diagram to create.
- *
- * @return diagram type
- */
- public String getCreatedDiagramType() {
- return getDiagramNotationID();
- }
-
- /**
- * @return
- */
- abstract protected String getDiagramNotationID();
-
- /**
- * @return
- */
- abstract protected PreferencesHint getPreferenceHint();
-
- /**
- * Get the name used for diagram.
- *
- * @return
- */
- abstract protected String getDefaultDiagramName();
-
- /**
- * Get currently selected element.
- *
- * @return The currently selected element, or null if any.
- */
- protected EObject getSelectedElement() {
- EObject eObject = null;
- Object selection = getCurrentSelection();
- if(selection != null) {
- eObject = EMFHelper.getEObject(selection);
- }
- return eObject;
- }
-
- /**
- * Get current selection first element.
- *
- * @return the selected element or null.
- */
- private Object getCurrentSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- return structuredSelection.getFirstElement();
- }
-
- return null;
- }
-
- /**
- * Create a diagram.
- *
- * @param diagramResource
- * the diagram resource
- * @param owner
- * the diagram container
- * @param name
- * the diagram name
- * @return
- */
- protected Diagram createDiagram(Resource diagramResource, EObject owner, String name) {
- // create diagram
- Diagram diagram = ViewService.createDiagram(owner, getDiagramNotationID(), getPreferenceHint());
- if(diagram != null) {
- diagram.setName(name);
- diagram.setElement(owner);
- initializeDiagram(diagram);
- diagramResource.getContents().add(diagram);
- }
- return diagram;
- }
-
- protected void initializeDiagram(EObject diagram) {
- };
-
- /**
- * Get the current MultiDiagramEditor.
- *
- * @return
- */
- protected IMultiDiagramEditor getMultiDiagramEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = page.getActiveEditor();
- return (IMultiDiagramEditor)editorPart;
- }
-
- /**
- * Open popup to enter the new diagram name
- *
- * @param defaultValue
- * the default value
- * @return the entered diagram name
- */
- protected String openDiagramNameDialog(String defaultValue) {
- if(defaultValue == null) {
- defaultValue = "";
- }
-
- InputDialog inputDialog = new InputDialog(Display.getCurrent().getActiveShell(), Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_SelectNewDiagramName, Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_NewDiagramName, defaultValue, null);
- int result = inputDialog.open();
-
- if(result == Window.OK) {
- String name = inputDialog.getValue();
- if(name == null || name.length() == 0) {
- name = defaultValue;
- }
- return name;
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void createDiagram(final ModelSet modelSet, final EObject container, final String diagramName) {
- runAsTransaction(modelSet, container, diagramName);
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getCreateDiagramCommand(final ModelSet modelSet, final EObject container, final String diagramName) {
- //Diagram creation should not change the semantic resource
- final Resource modelResource = UmlUtils.getUmlResource(modelSet);
- final Resource notationResource = NotationUtils.getNotationResource(modelSet);
- final Resource diResource = DiModelUtils.getDiResource(modelSet);
-
- ArrayList<IFile> modifiedFiles = new ArrayList<IFile>();
- if (notationResource.getURI().isPlatformResource()) {
- modifiedFiles.add(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(notationResource.getURI().toPlatformString(true))));
- }
- if (diResource.getURI().isPlatformResource()) {
- modifiedFiles.add(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(diResource.getURI().toPlatformString(true))));
- }
-
- return new AbstractTransactionalCommand(modelSet.getTransactionalEditingDomain(), Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_CreateDiagramCommandLabel, modifiedFiles) {
-
- protected Diagram diagram;
-
- protected EObject modelElement;
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- String name = diagramName;
- if(name == null) {
- name = openDiagramNameDialog(getDefaultDiagramName());
- }
- // canceled
- if(name == null) {
- return CommandResult.newCancelledCommandResult();
- }
-
- EObject model = container;
- if(model == null) {
- model = getRootElement(modelResource);
- attachModelToResource(model, modelResource);
- }
-
- diagram = createDiagram(notationResource, model, name);
-
- if(diagram != null) {
- try {
- IPageManager pageManager = ServiceUtilsForResource.getInstance().getIPageManager(diResource);
- pageManager.addPage(diagram);
- return CommandResult.newOKCommandResult(diagram);
- } catch (ServiceException ex) {
- Activator.log.error(ex);
- return CommandResult.newErrorCommandResult(ex);
- }
- }
- return CommandResult.newErrorCommandResult("Error during diagram creation");
- }
-
- @Override
- protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // the undo corresponds to a destroy diagram command
- // during diagram creation no adapters are set to the diagram so the setElement is not registered
- // to remove the cross reference using the element reference it is better to use the destroy element command
- // DestroyElementPapyrusCommand depc = (diagram != null) ? new DestroyElementPapyrusCommand(new DestroyElementRequest(diagram, false)) : null;
- IStatus status = super.doUndo(monitor, info);
-
- modelElement = diagram.getElement();
- diagram.setElement(null);
- return status;
- }
-
- @Override
- protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- diagram.setElement(modelElement);
- IStatus status = super.doRedo(monitor, info);
- return status;
- }
- };
- }
-
- /**
- * Get the ISashWindowsContentProvider from the main editor.
- *
- * @return
- */
- protected ISashWindowsContentProvider getISashWindowsContentProvider(ServicesRegistry registry) {
- try {
- return registry.getService(ISashWindowsContentProvider.class);
- } catch (ServiceException ex) {
- Activator.log.error(ex);
- return null;
- }
- }
-
- /**
- * Check if the creation of this diagram is strongly attached to its parent or if it can be reassigned after creation.
- *
- * @return true if parent can be reassigned
- */
- public boolean isParentReassignable() {
- // yes by default
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008, 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - only calculate affected files for workspace resources (CDO)
+ * Laurent Wouters (CEA) - laurent.wouters@cea.fr - Refactoring for viewpoints
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+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.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.commands.OpenDiagramCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModelUtils;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ui.IModelElementValidator;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ui.ModelElementSelectionDialog;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.uml.tools.model.UmlUtils;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Command creating a new GMF diagram in Papyrus. This command is intended to be used in eclipse
+ * extensions.
+ *
+ * Commands to create a GMF Diagram can subclass this class. There is two kinds of commands: -
+ * Eclipse handlers issuing commands (toolbar, menu, ...). This commands can find the active editor
+ * by using the Worbench.getActivePArt(). The entry point is {@link #execute(ExecutionEvent)}. -
+ * Commands called during editor initializing (like wizard). This commands require the diResourceSet
+ * to work. The entry point is {@link #createDiagram(Resource, EObject, String)}
+ *
+ * @author cedric dumoulin
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public abstract class AbstractPapyrusGmfCreateDiagramCommandHandler extends AbstractHandler implements IHandler, ICreationCommand {
+
+ /**
+ * Inner class for the creation of diagrams
+ *
+ * @author Laurent Wouters
+ *
+ */
+ private class Creator {
+ private ModelSet modelSet;
+ private EObject owner;
+ private EObject element;
+ private ViewPrototype prototype;
+ private String name;
+
+ public Creator(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name) {
+ this.modelSet = modelSet;
+ this.owner = owner;
+ this.element = element;
+ this.prototype = prototype;
+ this.name = name;
+ }
+
+ private Diagram createDiagram() throws ServiceException {
+ Resource modelResource = UmlUtils.getUmlResource(modelSet);
+ Resource notationResource = NotationUtils.getNotationResource(modelSet);
+ Resource diResource = DiModelUtils.getDiResource(modelSet);
+
+ if (owner == null) {
+ owner = getRootElement(modelResource);
+ attachModelToResource(owner, modelResource);
+ }
+
+ if (!PolicyChecker.getCurrent().canOwnNewView(owner, prototype)) {
+ ModelElementSelectionDialog dialog = new ModelElementSelectionDialog(Display.getCurrent().getActiveShell(), getMultiDiagramEditor().getServicesRegistry(), "Select an appropriate owner for the diagram:", getRootElement(modelResource), owner,
+ new IModelElementValidator() {
+ public String isSelectable(EObject element) {
+ if (PolicyChecker.getCurrent().canOwnNewView(owner, prototype))
+ return null;
+ return "This element cannot own the diagram.";
+ }
+ });
+ int result = dialog.open();
+ if (result != Window.OK)
+ return null;
+ owner = dialog.getSelection();
+ }
+
+ element = prototype.getRootFor(owner);
+ if (!PolicyChecker.getCurrent().canHaveNewView(element, owner, prototype)) {
+ StringBuilder builder = new StringBuilder("Select a root element for the diagram. Allowed types: ");
+ if (prototype.getConfiguration() == null) {
+ builder.append("<unknown>");
+ } else if (prototype.getConfiguration().getModelRules().size() == 0) {
+ builder.append("<unknown>");
+ } else {
+ boolean first = true;
+ for (ModelRule rule : prototype.getConfiguration().getModelRules()) {
+ EClass model = rule.getElement();
+ if (model != null) {
+ if (!first) {
+ builder.append(", ");
+ }
+ first = false;
+ builder.append(model.getName());
+ }
+ }
+ }
+ builder.append(".");
+ ModelElementSelectionDialog dialog = new ModelElementSelectionDialog(Display.getCurrent().getActiveShell(), getMultiDiagramEditor().getServicesRegistry(), builder.toString(), getRootElement(modelResource), element,
+ new IModelElementValidator() {
+ public String isSelectable(EObject element) {
+ if (PolicyChecker.getCurrent().canHaveNewView(element, owner, prototype))
+ return null;
+ return "This element cannot be the root element of the diagram.";
+ }
+ });
+ int result = dialog.open();
+ if (result != Window.OK)
+ return null;
+ element = dialog.getSelection();
+ }
+
+ if (name == null) {
+ name = openDiagramNameDialog(prototype.isNatural() ? getDefaultDiagramName() : "New" + prototype.getLabel().replace(" ", ""));
+ }
+ // canceled
+ if (name == null) {
+ return null;
+ }
+
+ Diagram diagram = doCreateDiagram(notationResource, owner, element, prototype, name);
+
+ if (diagram != null) {
+ IPageManager pageManager = ServiceUtilsForResource.getInstance().getIPageManager(diResource);
+ pageManager.addPage(diagram);
+
+ }
+ return diagram;
+ }
+ }
+
+
+ /**
+ * Get the root element associated with canvas.
+ */
+ private EObject getRootElement(Resource modelResource) {
+ EObject rootElement = null;
+ if (modelResource != null && modelResource.getContents() != null && modelResource.getContents().size() > 0) {
+ Object root = modelResource.getContents().get(0);
+ if (root instanceof EObject) {
+ rootElement = (EObject) root;
+ }
+ }
+
+ return rootElement;
+ }
+
+ /**
+ * Store model element in the resource.
+ */
+ private void attachModelToResource(EObject root, Resource resource) {
+ resource.getContents().add(root);
+ }
+
+ /**
+ * Get the current MultiDiagramEditor.
+ */
+ private IMultiDiagramEditor getMultiDiagramEditor() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editorPart = page.getActiveEditor();
+ return (IMultiDiagramEditor) editorPart;
+ }
+
+ /**
+ * Open popup to enter the new diagram name
+ *
+ * @param defaultValue
+ * the default value
+ * @return the entered diagram name
+ */
+ private String openDiagramNameDialog(String defaultValue) {
+ if (defaultValue == null) {
+ defaultValue = "";
+ }
+
+ InputDialog inputDialog = new InputDialog(Display.getCurrent().getActiveShell(), Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_SelectNewDiagramName, Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_NewDiagramName, defaultValue, null);
+ int result = inputDialog.open();
+
+ if (result == Window.OK) {
+ String name = inputDialog.getValue();
+ if (name == null || name.length() == 0) {
+ name = defaultValue;
+ }
+ return name;
+ }
+ return null;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#createDiagram(org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.EObject, java.lang.String)
+ */
+ public final Diagram createDiagram(ModelSet modelSet, EObject owner, String name) {
+ ViewPrototype proto = ViewPrototype.get(getCreatedDiagramType(), owner, owner);
+ if (proto == null)
+ return null;
+ return createDiagram(modelSet, owner, owner, proto, name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#createDiagram(org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype, java.lang.String)
+ */
+ public final Diagram createDiagram(ModelSet modelSet, EObject owner, EObject element, ViewPrototype prototype, String name) {
+ ICommand createCmd = getCreateDiagramCommand(modelSet, owner, element, prototype, name);
+ TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
+ CompositeCommand cmd = new CompositeCommand("Create diagram");
+ cmd.add(createCmd);
+ cmd.add(new OpenDiagramCommand(dom, createCmd));
+ dom.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#getCreateDiagramCommand(org.eclipse.papyrus.infra.core.resource.ModelSet, org.eclipse.emf.ecore.EObject, java.lang.String)
+ */
+ public final ICommand getCreateDiagramCommand(ModelSet modelSet, EObject owner, String name) {
+ ViewPrototype proto = ViewPrototype.get(getCreatedDiagramType(), owner, owner);
+ if (proto == null)
+ return null;
+ return getCreateDiagramCommand(modelSet, owner, owner, proto, name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#getCreateDiagramCommand(org.eclipse.papyrus.infra.core.resource.ModelSet, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype,
+ * java.lang.String)
+ */
+ public final ICommand getCreateDiagramCommand(final ModelSet modelSet, final EObject owner, final EObject element, final ViewPrototype prototype, final String name) {
+ // Diagram creation should not change the semantic resource
+ final Resource notationResource = NotationUtils.getNotationResource(modelSet);
+ final Resource diResource = DiModelUtils.getDiResource(modelSet);
+
+ ArrayList<IFile> modifiedFiles = new ArrayList<IFile>();
+ if (notationResource.getURI().isPlatformResource()) {
+ modifiedFiles.add(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(notationResource.getURI().toPlatformString(true))));
+ }
+ if (diResource.getURI().isPlatformResource()) {
+ modifiedFiles.add(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(diResource.getURI().toPlatformString(true))));
+ }
+
+ return new AbstractTransactionalCommand(modelSet.getTransactionalEditingDomain(), Messages.AbstractPapyrusGmfCreateDiagramCommandHandler_CreateDiagramCommandLabel, modifiedFiles) {
+ private Diagram diagram = null;
+ private EObject diagramElement = null;
+ private EObject diagramOwner = null;
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Creator creator = new Creator(modelSet, owner, element, prototype, name);
+ try {
+ diagram = creator.createDiagram();
+ if (diagram == null)
+ return CommandResult.newCancelledCommandResult();
+ diagramElement = diagram.getElement();
+ diagramOwner = DiagramUtils.getOwner(diagram);
+ return CommandResult.newOKCommandResult(diagram);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+ return CommandResult.newErrorCommandResult("Error during diagram creation");
+ }
+
+ @Override
+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // the undo corresponds to a destroy diagram command
+ // during diagram creation no adapters are set to the diagram so the setElement is not registered
+ // to remove the cross reference using the element reference it is better to use the destroy element command
+ // DestroyElementPapyrusCommand depc = (diagram != null) ? new DestroyElementPapyrusCommand(new DestroyElementRequest(diagram, false)) : null;
+ IStatus status = super.doUndo(monitor, info);
+ diagram.setElement(null);
+ return status;
+ }
+
+ @Override
+ protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ diagram.setElement(diagramElement);
+ DiagramUtils.setOwner(diagram, diagramOwner);
+ IStatus status = super.doRedo(monitor, info);
+ return status;
+ }
+ };
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#getCreatedDiagramType()
+ */
+ public String getCreatedDiagramType() {
+ return getDiagramNotationID();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.commands.ICreationCommand#isParentReassignable()
+ */
+ public boolean isParentReassignable() {
+ // yes by default
+ return true;
+ }
+
+
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // This method should not be called, use the execute(ExecutionEvent, ViewPrototype, String) method.
+ throw new UnsupportedOperationException();
+ }
+
+
+ protected abstract String getDiagramNotationID();
+
+ protected abstract PreferencesHint getPreferenceHint();
+
+ protected abstract String getDefaultDiagramName();
+
+ /**
+ * Overridable method that effectively create the diagram with the given validated parameters
+ *
+ * @param diagramResource
+ * the diagram resource
+ * @param owner
+ * the diagram's owner
+ * @param element
+ * the diagram's model element
+ * @param prototype
+ * the diagram's prototype
+ * @param name
+ * the diagram's name
+ * @return the created diagram, or <code>null</code> if the creation failed
+ */
+ protected Diagram doCreateDiagram(Resource diagramResource, EObject owner, EObject element, ViewPrototype prototype, String name) {
+ // create diagram
+ Diagram diagram = ViewService.createDiagram(element, getDiagramNotationID(), getPreferenceHint());
+ if (diagram != null) {
+ diagram.setName(name);
+ diagram.setElement(element);
+ DiagramUtils.setOwner(diagram, owner);
+ if (!prototype.isNatural())
+ DiagramUtils.setPrototype(diagram, prototype);
+ initializeDiagram(diagram);
+ diagramResource.getContents().add(diagram);
+ }
+ return diagram;
+ }
+
+ /**
+ * Overridable method for the initialization of create diagrams
+ *
+ * @param diagram
+ * the created diagram
+ */
+ protected void initializeDiagram(EObject diagram) {
+
+ };
+}
+
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/GmfEditorFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/GmfEditorFactory.java
index 0ade2777252..5c7b9e57d0e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/GmfEditorFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/GmfEditorFactory.java
@@ -26,6 +26,7 @@ import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
@@ -201,7 +202,7 @@ public class GmfEditorFactory extends AbstractEditorFactory {
*
*/
public Image getTabIcon() {
- ImageDescriptor imageDescriptor = getEditorDescriptor().getIcon();
+ ImageDescriptor imageDescriptor = DiagramUtils.getPrototype(diagram).getIconDescriptor();
if(imageDescriptor == null)
return null;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/DynamicDiagramsMenuContribution.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/DynamicDiagramsMenuContribution.java
new file mode 100755
index 00000000000..cd6e89e6823
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/DynamicDiagramsMenuContribution.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.handler;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram;
+import org.eclipse.papyrus.infra.viewpoints.policy.DynamicContribution;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the dynamic contribution of a policy to menus
+ * @author Laurent Wouters
+ */
+public class DynamicDiagramsMenuContribution extends DynamicContribution {
+ /**
+ * Constructor.
+ */
+ public DynamicDiagramsMenuContribution() { }
+
+ /**
+ * Constructor.
+ * @param id
+ */
+ public DynamicDiagramsMenuContribution(String id) {
+ super(id);
+ }
+
+ /**
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ final EObject selection = getSelection();
+ if (selection == null)
+ return new IContributionItem[0];
+
+ // build a list of all the available prototypes
+ List<ViewPrototype> data = new ArrayList<ViewPrototype>();
+ for (final ViewPrototype proto : PolicyChecker.getCurrent().getPrototypesFor(selection)) {
+ if (!(proto.getConfiguration() instanceof PapyrusDiagram))
+ continue;
+ data.add(proto);
+ }
+
+ // sort them
+ Collections.sort(data, new ViewPrototype.Comp());
+
+ // build the full labels
+ List<String> labels = new ArrayList<String>(data.size());
+ String last = null;
+ boolean first = true;
+ for (ViewPrototype item : data) {
+ String label = item.getLabel();
+ if (last != null && last.equals(label)) {
+ // name collision
+ if (first) {
+ labels.set(labels.size() - 1, data.get(labels.size() - 1).getFullLabel());
+ first = false;
+ }
+ labels.add(item.getFullLabel());
+ } else {
+ labels.add(label);
+ last = label;
+ first = true;
+ }
+ }
+
+ // build the menu
+ List<IContributionItem> items = new ArrayList<IContributionItem>(data.size());
+ for (int i = 0; i != data.size(); i++) {
+ final ViewPrototype proto = data.get(i);
+ String label = labels.get(i);
+ items.add(new ActionContributionItem(new Action(CREATE_MESSAGE + label, proto.getIconDescriptor()) {
+ @Override
+ public void run() {
+ proto.instantiateOn(selection);
+ }
+ }));
+ }
+ return items.toArray(new IContributionItem[items.size()]);
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramEditHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramEditHelper.java
new file mode 100755
index 00000000000..96a332820f5
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramEditHelper.java
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.helper;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+
+/**
+ * Represents an Edit Helper for GMF Diagrams
+ * @author Laurent Wouters
+ */
+public class DiagramEditHelper implements IEditHelper {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper#canEdit(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ */
+ public boolean canEdit(IEditCommandRequest req) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper#getEditCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ */
+ public ICommand getEditCommand(final IEditCommandRequest req) {
+ if (req instanceof DestroyElementRequest) {
+ DestroyElementRequest r = (DestroyElementRequest)req;
+ return getDestroyDiagramCommand((Diagram)r.getElementToDestroy());
+ } else if (req instanceof SetRequest) {
+ SetRequest r = (SetRequest)req;
+ return GetSimpleSetCommand(r.getElementToEdit(), r.getFeature(), r.getValue());
+ } else if (req instanceof CreateElementRequest) {
+ CreateElementRequest r = (CreateElementRequest)req;
+ EObject container = r.getContainer();
+ if (container instanceof Diagram)
+ return getCreateCommand((Diagram)container, r.getContainmentFeature(), r.getElementType());
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper#getContainedValues(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EReference)
+ */
+ public List getContainedValues(EObject eContainer, EReference feature) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Gets the command for destroying the given diagram
+ * @param diagram The diagram to destroy
+ * @return The appropriate command
+ */
+ private ICommand getDestroyDiagramCommand(final Diagram diagram) {
+ final Resource resource = diagram.eResource();
+ return new AbstractCommand("Destroy diagram") {
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ resource.getContents().remove(diagram);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ resource.getContents().remove(diagram);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ resource.getContents().add(diagram);
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * Gets the command for setting a property of a view
+ * @param object The object to modify
+ * @param feature The feature to modify
+ * @param newValue The new value for the feature
+ * @return The appropriate command
+ */
+ private ICommand GetSimpleSetCommand(final EObject object, final EStructuralFeature feature, final Object newValue) {
+ return new AbstractCommand("Edit property") {
+ private Object oldValue;
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ oldValue = object.eGet(feature);
+ object.eSet(feature, newValue);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ object.eSet(feature, newValue);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ object.eSet(feature, oldValue);
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+
+ /**
+ * Gets the command for the creation of an element in a diagram
+ * @param diagram The diagram to change
+ * @param reference The containment feature
+ * @param type The type of the element to be created
+ * @return The appropriate command
+ */
+ private ICommand getCreateCommand(final Diagram diagram, final EReference reference, final IElementType type) {
+ return new AbstractCommand("Create element") {
+ private EObject newElement;
+ private ModelAddData data;
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ data = PolicyChecker.getCurrent().getChildAddData(diagram, diagram.getElement().eClass(), type.getEClass());
+ if (!data.isPermitted())
+ return CommandResult.newErrorCommandResult("The current active viewpoint policy prevents the addition of this element to the view");
+ newElement = type.getEClass().getEPackage().getEFactoryInstance().create(type.getEClass());
+ if (data.isPathDefined()) {
+ if (!data.execute(diagram.getElement(), newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the path");
+ } else {
+ diagram.getElement().eSet(reference, newElement);
+ }
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ data.redoExecute();
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ data.undoExecute();
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java
new file mode 100755
index 00000000000..e28a4eaf4ec
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java
@@ -0,0 +1,120 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.helper;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.commands.Activator;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents a prototype of GMF diagram for the viewpoints infrastructure
+ * @author Laurent Wouters
+ */
+public class DiagramPrototype extends ViewPrototype {
+ protected final String category;
+ protected final AbstractPapyrusGmfCreateDiagramCommandHandler command;
+
+ public DiagramPrototype(PapyrusView configuration, String category, AbstractPapyrusGmfCreateDiagramCommandHandler command) {
+ super(configuration);
+ this.category = category;
+ this.command = command;
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner) {
+ return instantiateOn(owner, null);
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner, String name) {
+ ServicesRegistry registry;
+ try {
+ registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(owner);
+ } catch (ServiceException ex) {
+ Activator.log.error(ex);
+ return false;
+ }
+ ModelSet modelSet;
+ try {
+ modelSet = registry.getService(ModelSet.class);
+ } catch (ServiceException ex) {
+ Activator.log.error(ex);
+ return false;
+ }
+ Object result = command.createDiagram(modelSet, owner, owner, this, name);
+ return (result != null);
+ }
+
+ @Override
+ public boolean isOwnerReassignable() {
+ // Users can always move diagrams that are part of their viewpoint
+ return true;
+ }
+
+ @Override
+ public Command getCommandChangeOwner(EObject view, final EObject target) {
+ final Diagram diagram = (Diagram)view;
+ final EObject previous = DiagramUtils.getOwner(diagram);
+ return new AbstractCommand("Change diagram owner") {
+ @Override
+ public void execute() {
+ DiagramUtils.setOwner(diagram, target);
+ }
+ @Override
+ public void redo() {
+ DiagramUtils.setOwner(diagram, previous);
+ }
+ @Override
+ protected boolean prepare() { return true; }
+ };
+ }
+
+ @Override
+ public Command getCommandChangeRoot(EObject view, final EObject target) {
+ final Diagram diagram = (Diagram)view;
+ final EObject previous = diagram.getElement();
+ return new AbstractCommand("Change diagram root element") {
+ @Override
+ public void execute() {
+ diagram.setElement(target);
+ }
+ @Override
+ public void redo() {
+ diagram.setElement(previous);
+ }
+ @Override
+ protected boolean prepare() { return true; }
+ };
+ }
+
+ @Override
+ public EObject getOwnerOf(EObject view) {
+ return DiagramUtils.getOwner((Diagram)view);
+ }
+
+ @Override
+ public EObject getRootOf(EObject view) {
+ return ((Diagram)view).getElement();
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
new file mode 100755
index 00000000000..19544a0c3ea
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
@@ -0,0 +1,165 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.helper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the dynamic contribution of a policy to menus
+ * @author Laurent Wouters
+ */
+public class GMFDiagramViewTypeHelper implements IViewTypeHelper {
+ /**
+ * ID of the extension point for Papyrus diagrams
+ */
+ private static final String EXTENSION_PAPYRUS_DIAGRAM = "org.eclipse.papyrus.infra.core.papyrusDiagram";
+
+ private static class NakedViewPrototype extends DiagramPrototype {
+ private final String label;
+ private final String icon;
+ public NakedViewPrototype(PapyrusView configuration, String category, AbstractPapyrusGmfCreateDiagramCommandHandler command, String label, String icon) {
+ super(configuration, category, command);
+ this.label = label;
+ this.icon = icon;
+ }
+ @Override
+ public String getLabel() { return label; }
+ @Override
+ public String getIconURI() { return icon; }
+ }
+
+ private static class Implementation {
+ public final String name;
+ public final String icon;
+ public final String language;
+ public final AbstractPapyrusGmfCreateDiagramCommandHandler command;
+ public Implementation(String name, String icon, String language, AbstractPapyrusGmfCreateDiagramCommandHandler command) {
+ this.name = name;
+ this.icon = icon;
+ this.language = language;
+ this.command = command;
+ }
+ }
+
+
+ /**
+ * The cache of prototypes
+ */
+ private Map<PapyrusView, DiagramPrototype> cache;
+
+ /**
+ * The cache of implementations
+ */
+ private Map<String, Implementation> implementations;
+
+ /**
+ * @see org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper#isSupported(org.eclipse.emf.ecore.EClass)
+ */
+ public boolean isSupported(EClass type) {
+ return EcoreUtil.equals(type, ConfigurationPackage.eINSTANCE.getPapyrusDiagram());
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper#isSupported(org.eclipse.emf.ecore.EObject)
+ */
+ public boolean isSupported(EObject view) {
+ return (view instanceof Diagram);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper#getPrototypeFor(org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView)
+ */
+ public ViewPrototype getPrototypeFor(PapyrusView configuration) {
+ if (!(configuration instanceof PapyrusDiagram))
+ return null;
+ if (implementations == null)
+ buildImplementationCache();
+ if (cache == null)
+ cache = new HashMap<PapyrusView, DiagramPrototype>();
+ if (cache.containsKey(configuration))
+ return cache.get(configuration);
+ if (!implementations.containsKey(configuration.getImplementationID()))
+ return null;
+ Implementation impl = implementations.get(configuration.getImplementationID());
+ if (ViewPrototype.isNatural(configuration)) {
+ NakedViewPrototype proto = new NakedViewPrototype(configuration, impl.language, impl.command, impl.name, impl.icon);
+ cache.put(configuration, proto);
+ return proto;
+ } else {
+ DiagramPrototype proto = new DiagramPrototype(configuration, impl.language, impl.command);
+ cache.put(configuration, proto);
+ return proto;
+ }
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper#getPrototypeOf(org.eclipse.emf.ecore.EObject)
+ */
+ public ViewPrototype getPrototypeOf(EObject view) {
+ if (!(view instanceof Diagram))
+ return null;
+ return DiagramUtils.getPrototype((Diagram)view);
+ }
+
+ /**
+ * Builds the cache of metadata
+ */
+ private void buildImplementationCache() {
+ implementations = new HashMap<String, Implementation>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint point = registry.getExtensionPoint(EXTENSION_PAPYRUS_DIAGRAM);
+ IExtension[] extensions = point.getExtensions();
+ for (int i=0; i!=extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i].getConfigurationElements();
+ for (int j=0; j!=elements.length; j++) {
+ if (elements[j].getName().equals("creationCommand")) {
+ try {
+ Object obj = elements[j].createExecutableExtension("creationCommandClass");
+ if (obj instanceof AbstractPapyrusGmfCreateDiagramCommandHandler) {
+ AbstractPapyrusGmfCreateDiagramCommandHandler command = (AbstractPapyrusGmfCreateDiagramCommandHandler)obj;
+ String label = elements[j].getAttribute("label");
+ String icon = elements[j].getAttribute("icon");
+ String language = elements[j].getAttribute("language");
+ String implID = command.getCreatedDiagramType();
+ if (!icon.startsWith("platform:/"))
+ icon = "platform:/plugin/" + extensions[i].getContributor().getName() + "/" + icon;
+ if (!implementations.containsKey(implID))
+ implementations.put(implID, new Implementation(label, icon, language, command));
+ }
+ }
+ catch (CoreException e) { }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
index 7d783690bec..5d9b14456b6 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
@@ -11,7 +11,6 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.helper;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
@@ -34,18 +33,8 @@ public class NotationHelper {
if(source instanceof View) {
return (View)source;
}
- if(source instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable)source;
- Object adapter = adaptable.getAdapter(View.class);
- if(adapter != null) {
- return (View)adapter;
- }
- adapter = EMFHelper.getEObject(adaptable);
- if(adapter instanceof View) {
- return (View)adapter;
- }
- }
- return null;
+ EObject obj = EMFHelper.getEObject(source);
+ return (obj instanceof View) ? (View) obj : null;
}
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationUtils.java
index 9ad8ee049be..606fa01febd 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationUtils.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationUtils.java
@@ -1,272 +1,210 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.common.model;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-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 org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.papyrus.infra.core.resource.IModel;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-/**
- * Utilities method to manage notation models. Should be moved in a more
- * suitable plugin
- */
-public class NotationUtils {
-
- /**
- * Get the notation Resource.
- *
- * @return
- *
- * @deprecated Usage of the internal Resource is discouraged.
- */
- @Deprecated
- public static Resource getNotationResource() {
- return getNotationModel().getResource();
- }
-
- /**
- * Gets the NotationModel for the currently selected editor. <br>
- * Warning: This method is designed to be call from ui.handlers. It is not
- * designed to be call from Editors. This method can return null if called
- * during the MultiEditor initialization.
- *
- * @see ServiceUtilsForActionHandlers.getInstance().getModelSet()
- *
- * @return The {@link NotationModel} of the current editor, or null if not
- * found.
- */
- public static NotationModel getNotationModel() {
-
- try {
- return (NotationModel)ServiceUtilsForActionHandlers.getInstance().getModelSet().getModel(NotationModel.MODEL_ID);
- } catch (ServiceException e) {
- return null;
- }
- }
-
- /**
- * Gets the NotationModel for the currently selected editor. <br>
- * Warning: This method is designed to be call from ui.handlers. It is not
- * designed to be call from Editors. This method can return null if called
- * during the MultiEditor initialization.
- *
- * @see ServiceUtilsForActionHandlers.getInstance().getModelSet()
- *
- * @return The {@link NotationModel} of the current editor, or null if not
- * found.
- * @throws ServiceException
- * If an error occurs while getting or starting the service.
- */
- public static NotationModel getNotationModelChecked() throws ServiceException {
-
- return (NotationModel)ServiceUtilsForActionHandlers.getInstance().getModelSet().getModel(NotationModel.MODEL_ID);
- }
-
- /**
- * Gets the NotationModel from the {@link ModelSet}. <br>
- *
- * @param modelsManager
- * The modelManager containing the requested model.
- *
- * @return The {@link NotationModel} registered in modelManager, or null if
- * not found.
- */
- public static NotationModel getNotationModel(ModelSet modelsManager) {
-
- return (NotationModel)modelsManager.getModel(NotationModel.MODEL_ID);
- }
-
- /**
- * Gets the direct associated diagram of the specified eObject.
- *
- * @param eObject
- * @param notationResource
- *
- * @return the associated diagram
- */
- public static Diagram getAssociatedDiagram(Resource notationResource, EObject eObject) {
- if(notationResource != null) {
- for(EObject obj : notationResource.getContents()) {
- if(obj instanceof Diagram) {
- Diagram diagram = (Diagram)obj;
- if(eObject != null && eObject.equals(diagram.getElement())) {
- return diagram;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Gets the direct associated diagram of the specified eObject.
- *
- * @param eObject
- * @param notationResource
- * @param resolve
- * the resource if true
- *
- * @return the associated diagram
- */
- public static Diagram getAssociatedDiagram(Resource notationResource, EObject eObject, boolean resolve) {
- if(notationResource != null && resolve) {
- EcoreUtil.resolveAll(notationResource);
- }
- return getAssociatedDiagram(notationResource, eObject);
- }
-
- /**
- * Gets the all the diagrams contained in the specified ancestor eObject
- *
- * @param notationResource
- * @param eObject
- *
- * @return all the contained diagrams
- *
- */
- public static List<Diagram> getDiagrams(Resource notationResource, EObject eObject) {
- List<Diagram> diagrams = new LinkedList<Diagram>();
- if(notationResource != null) {
- for(EObject obj : notationResource.getContents()) {
- if(obj instanceof Diagram) {
- Diagram diagram = (Diagram)obj;
- if(EcoreUtil.isAncestor(eObject, diagram.getElement())) {
- diagrams.add(diagram);
- }
- }
- }
- }
- return diagrams;
- }
-
- /**
- * Gets the all the diagrams contained in the specified ancestor eObject
- *
- * @param notationResource
- * @param eObject
- * @param resolve
- * the resource if true
- *
- * @return all the contained diagrams
- */
- public static List<Diagram> getDiagrams(Resource notationResource, EObject eObject, boolean resolve) {
- if(notationResource != null && resolve) {
- EcoreUtil.resolveAll(notationResource);
- }
- return getDiagrams(notationResource, eObject);
- }
-
- /**
- * Helper to retrieve the Notation resource associated to a ModelSet. May be null.
- *
- * @param from
- * @return
- */
- public static Resource getNotationResource(ModelSet from) {
- IModel notationModel = from.getModel(NotationModel.MODEL_ID);
- if(notationModel instanceof NotationModel) {
- return ((NotationModel)notationModel).getResource();
- }
- return null;
- }
-
- /**
- * Helper to retrieve the Notation resource associated to a ServicesRegistry. May be null.
- *
- * @param from
- * @return
- */
- public static Resource getNotationResource(ServicesRegistry registry) {
- try {
- ModelSet modelSet = ServiceUtils.getInstance().getModelSet(registry);
- return getNotationResource(modelSet);
- } catch (ServiceException ex) {
- Activator.log.error(ex);
- return null;
- }
- }
-
- /**
- * Gets the loaded associated diagrams of the specified eObject.
- * This method uses the cross referencer to compute them.
- *
- * @param eObject
- * @param notationResource
- *
- * @return the associated diagram
- */
- public static List<Diagram> getLoadedAssociatedDiagrams(EObject eObject) {
- Predicate<EStructuralFeature.Setting> p = new Predicate<EStructuralFeature.Setting>() {
-
- public boolean apply(EStructuralFeature.Setting setting) {
- return setting.getEObject() instanceof Diagram && NotationPackage.Literals.VIEW__ELEMENT.equals(setting.getEStructuralFeature());
- }
- };
- Function<EStructuralFeature.Setting, Diagram> f = new Function<EStructuralFeature.Setting, Diagram>() {
-
- public Diagram apply(EStructuralFeature.Setting setting) {
- return (Diagram)setting.getEObject();
- }
-
- };
- return Lists.newArrayList(Iterables.transform(Iterables.filter(EMFHelper.getUsages(eObject), p), f));
- }
-
- /**
- * Gets the all the diagrams contained in the specified ancestor eObject and
- * currently stored in the specified notation resource.
- *
- * @param notationResource
- * @param eObject
- *
- * @return all the contained diagrams
- *
- */
- public static List<Diagram> getAllDescendantDiagramsInResource(EObject eObject, Resource notationResource) {
- List<Diagram> diagrams = new ArrayList<Diagram>();
- if(notationResource != null) {
- for(EObject obj : notationResource.getContents()) {
- if(obj instanceof Diagram) {
- Diagram diagram = (Diagram)obj;
- if(EcoreUtil.isAncestor(eObject, diagram.getElement())) {
- diagrams.add(diagram);
- }
- }
- }
- }
- return diagrams;
- }
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+
+/**
+ * Utilities method to manage notation models. Should be moved in a more
+ * suitable plugin
+ */
+public class NotationUtils {
+
+ /**
+ * Get the notation Resource.
+ *
+ * @return
+ *
+ * @deprecated Usage of the internal Resource is discouraged.
+ */
+ @Deprecated
+ public static Resource getNotationResource() {
+ return getNotationModel().getResource();
+ }
+
+ /**
+ * Gets the NotationModel for the currently selected editor. <br>
+ * Warning: This method is designed to be call from ui.handlers. It is not
+ * designed to be call from Editors. This method can return null if called
+ * during the MultiEditor initialization.
+ *
+ * @see ServiceUtilsForActionHandlers.getInstance().getModelSet()
+ *
+ * @return The {@link NotationModel} of the current editor, or null if not
+ * found.
+ */
+ public static NotationModel getNotationModel() {
+
+ try {
+ return (NotationModel)ServiceUtilsForActionHandlers.getInstance().getModelSet().getModel(NotationModel.MODEL_ID);
+ } catch (ServiceException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Gets the NotationModel for the currently selected editor. <br>
+ * Warning: This method is designed to be call from ui.handlers. It is not
+ * designed to be call from Editors. This method can return null if called
+ * during the MultiEditor initialization.
+ *
+ * @see ServiceUtilsForActionHandlers.getInstance().getModelSet()
+ *
+ * @return The {@link NotationModel} of the current editor, or null if not
+ * found.
+ * @throws ServiceException
+ * If an error occurs while getting or starting the service.
+ */
+ public static NotationModel getNotationModelChecked() throws ServiceException {
+
+ return (NotationModel)ServiceUtilsForActionHandlers.getInstance().getModelSet().getModel(NotationModel.MODEL_ID);
+ }
+
+ /**
+ * Gets the NotationModel from the {@link ModelSet}. <br>
+ *
+ * @param modelsManager
+ * The modelManager containing the requested model.
+ *
+ * @return The {@link NotationModel} registered in modelManager, or null if
+ * not found.
+ */
+ public static NotationModel getNotationModel(ModelSet modelsManager) {
+
+ return (NotationModel)modelsManager.getModel(NotationModel.MODEL_ID);
+ }
+
+ /**
+ * Gets the direct associated diagram of the specified eObject.
+ *
+ * @param eObject
+ * @param notationResource
+ *
+ * @return the associated diagram
+ */
+ public static Diagram getAssociatedDiagram(Resource notationResource, EObject eObject) {
+ if(notationResource != null) {
+ for(EObject obj : notationResource.getContents()) {
+ if(obj instanceof Diagram) {
+ Diagram diagram = (Diagram)obj;
+ if (DiagramUtils.getOwner(diagram) == eObject)
+ return diagram;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the direct associated diagram of the specified eObject.
+ *
+ * @param eObject
+ * @param notationResource
+ * @param resolve
+ * the resource if true
+ *
+ * @return the associated diagram
+ */
+ public static Diagram getAssociatedDiagram(Resource notationResource, EObject eObject, boolean resolve) {
+ if(notationResource != null && resolve) {
+ EcoreUtil.resolveAll(notationResource);
+ }
+ return getAssociatedDiagram(notationResource, eObject);
+ }
+
+ /**
+ * Gets the all the diagrams contained in the specified ancestor eObject
+ *
+ * @param notationResource
+ * @param eObject
+ *
+ * @return all the contained diagrams
+ *
+ */
+ public static List<Diagram> getDiagrams(Resource notationResource, EObject eObject) {
+ List<Diagram> diagrams = new LinkedList<Diagram>();
+ if(notationResource != null) {
+ for(EObject obj : notationResource.getContents()) {
+ if(obj instanceof Diagram) {
+ Diagram diagram = (Diagram)obj;
+ if (EcoreUtil.isAncestor(eObject, DiagramUtils.getOwner(diagram)))
+ diagrams.add(diagram);
+ }
+ }
+ }
+ return diagrams;
+ }
+
+ /**
+ * Gets the all the diagrams contained in the specified ancestor eObject
+ *
+ * @param notationResource
+ * @param eObject
+ * @param resolve
+ * the resource if true
+ *
+ * @return all the contained diagrams
+ */
+ public static List<Diagram> getDiagrams(Resource notationResource, EObject eObject, boolean resolve) {
+ if(notationResource != null && resolve) {
+ EcoreUtil.resolveAll(notationResource);
+ }
+ return getDiagrams(notationResource, eObject);
+ }
+
+ /**
+ * Helper to retrieve the Notation resource associated to a ModelSet. May be null.
+ *
+ * @param from
+ * @return
+ */
+ public static Resource getNotationResource(ModelSet from) {
+ IModel notationModel = from.getModel(NotationModel.MODEL_ID);
+ if(notationModel instanceof NotationModel) {
+ return ((NotationModel)notationModel).getResource();
+ }
+ return null;
+ }
+
+ /**
+ * Helper to retrieve the Notation resource associated to a ServicesRegistry. May be null.
+ *
+ * @param from
+ * @return
+ */
+ public static Resource getNotationResource(ServicesRegistry registry) {
+ try {
+ ModelSet modelSet = ServiceUtils.getInstance().getModelSet(registry);
+ return getNotationResource(modelSet);
+ } catch (ServiceException ex) {
+ Activator.log.error(ex);
+ return null;
+ }
+ }
+}
+
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
index cd8d0de611f..7a7c2daef82 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/NotationLabelProvider.java
@@ -11,6 +11,8 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.providers;
+import javax.swing.text.Element;
+
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
@@ -19,15 +21,14 @@ import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.DecorationNode;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
-import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
-import org.eclipse.papyrus.infra.core.extension.diagrameditor.PluggableEditorFactoryReader;
import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
import org.eclipse.papyrus.infra.gmfdiag.common.types.NotationTypesMap;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.NamedElement;
-import org.w3c.dom.Element;
/**
* A Label Provider for GMF Notation model
@@ -37,28 +38,27 @@ public class NotationLabelProvider extends EMFLabelProvider {
/** icon for a compartment */
public static final String ICON_COMPARTMENT = "/icons/none_comp_vis.gif"; //$NON-NLS-1$
- private IPageIconsRegistry pageIconsRegistry;
-
@Override
public void dispose() {
super.dispose();
- if(pageIconsRegistry != null) {
- pageIconsRegistry.dispose();
- pageIconsRegistry = null;
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ EObject eObject = EMFHelper.getEObject(element);
+ if (eObject != null) {
+ return getImage(eObject);
}
+ return super.getImage(element);
}
@Override
protected Image getImage(EObject element) {
if(element instanceof Diagram) {
- //return getPagesIconsRegistry().getEditorIcp
- if(pageIconsRegistry == null) {
- pageIconsRegistry = new PageIconsRegistry();
- PluggableEditorFactoryReader editorReader = new PluggableEditorFactoryReader(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID);
- editorReader.populate((PageIconsRegistry)pageIconsRegistry);
- }
-
- return pageIconsRegistry.getEditorIcon(element);
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram)element);
+ if (proto == null)
+ return null;
+ return proto.getIcon();
}
// if the element is a compartment
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
new file mode 100755
index 00000000000..4e78d0e5047
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
@@ -0,0 +1,124 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.utils;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.viewpoints.style.PapyrusViewStyle;
+import org.eclipse.papyrus.infra.viewpoints.style.StylePackage;
+
+/**
+ * Utilities for the management of configuration-related data on views and diagrams
+ * @author Laurent Wouters
+ */
+public class DiagramUtils {
+
+ /**
+ * Gets the diagram associated to the given edit part
+ * @param part The edit part
+ * @return The diagram associated to the edit part, or <code>null</code> if none is found
+ */
+ public static Diagram getDiagramFrom(EditPart part) {
+ EditPart current = part;
+ while (current != null) {
+ Object model = current.getModel();
+ if (model instanceof Diagram)
+ return (Diagram)model;
+ current = current.getParent();
+ }
+ return null;
+ }
+
+ /**
+ * Gets the owner of a diagram as it will appear in the model explorer.
+ * In the case where the diagram does not yet have a defined owner, the diagram's root element will be returned instead.
+ * @param diagram A diagram
+ * @return The diagram's owner
+ */
+ public static EObject getOwner(Diagram diagram) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null) {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)style;
+ EObject value = pvs.getOwner();
+ if (value != null)
+ return value;
+ }
+ // This is the legacy fallback for old diagrams
+ return diagram.getElement();
+ }
+
+ /**
+ * Sets the owner of a diagram as it will appear in the model explorer
+ * @param diagram A diagram
+ * @param owner The new diagram's owner
+ */
+ public static void setOwner(Diagram diagram, EObject owner) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null) {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)style;
+ pvs.setOwner(owner);
+ } else {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ pvs.setOwner(owner);
+ }
+ }
+
+ /**
+ * Gets the prototype of a diagram
+ * @param diagram A diagram
+ * @return The diagram's prototype
+ */
+ public static ViewPrototype getPrototype(Diagram diagram) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null) {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)style;
+ PapyrusView config = pvs.getConfiguration();
+ if (config != null) {
+ if (PolicyChecker.getCurrent().isInViewpoint(config))
+ return ViewPrototype.get(config);
+ return ViewPrototype.UNAVAILABLE_DIAGRAM;
+ }
+ return ViewPrototype.get(diagram.getType(), pvs.getOwner(), diagram.getElement());
+ }
+ // This is the legacy fallback for old diagrams
+ if ("Package".equals(diagram.getType())) {
+ for (ViewPrototype prototype : PolicyChecker.getCurrent().getAllPrototypes()) {
+ if ("UML Package Diagram".equals(prototype.getLabel()))
+ return prototype;
+ }
+ }
+ return ViewPrototype.get(diagram.getType(), diagram.getElement(), diagram.getElement());
+ }
+
+ /**
+ * Sets the prototype of a diagram
+ * @param diagram A diagram
+ * @param configuration The new diagram's prototype
+ */
+ public static void setPrototype(Diagram diagram, ViewPrototype prototype) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null) {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)style;
+ pvs.setConfiguration(prototype.getConfiguration());
+ } else {
+ PapyrusViewStyle pvs = (PapyrusViewStyle)diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ pvs.setConfiguration(prototype.getConfiguration());
+ }
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/ControlDiagramsCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/ControlDiagramsCommand.java
index 34ed42b72bc..08fb60c2c03 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/ControlDiagramsCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.controlmode/src/org/eclipse/papyrus/infra/gmfdiag/controlmode/ControlDiagramsCommand.java
@@ -99,7 +99,7 @@ public class ControlDiagramsCommand extends AbstractControlCommand {
if(notationResource == null) {
throw new ExecutionException("unable to retrieve old notation resource");
}
- return NotationUtils.getAllDescendantDiagramsInResource(getRequest().getTargetObject(), notationResource);
+ return NotationUtils.getDiagrams(notationResource, getRequest().getTargetObject());
}
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
index a0090e3f2c6..7ad5863dd55 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
@@ -18,7 +18,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.emf.facet.efacet,
org.eclipse.papyrus.emf.facet.efacet.metamodel,
org.eclipse.papyrus.emf.facet.custom.metamodel,
- org.eclipse.papyrus.infra.emf
+ org.eclipse.papyrus.infra.emf,
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
index 90d477a5bca..6d23ed58823 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
@@ -2,34 +2,9 @@
<?eclipse version="3.4"?>
<plugin>
-
-<extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
- <modeldeclaration file="resources/PapyrusDiagram.custom"/>
-</extension>
-
- <!-- TODO: EMF-FACET
- <extension point="org.eclipse.papyrus.emf.facet.infra.query.registration">
- <modelqueryset file="resources/PapyrusNotationFacet.querySet">
- </modelqueryset>
- </extension>
-
- <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization
- file="resources/PapyrusNotation.uiCustom"
- loadByDefault="true"/>
- </extension>
- <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization
- file="resources/PapyrusNotationFacet.uiCustom"
- loadByDefault="true"/>
- </extension>
- <extension
- point="org.eclipse.papyrus.emf.facet.infra.facet.registration">
- <facetset
- file="resources/PapyrusNotationFacet.facetSet">
- </facetset>
+ <extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration file="resources/PapyrusDiagram.custom"/>
</extension>
- -->
<extension
point="org.eclipse.ui.handlers">
<handler
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
index c5c535df52d..c9ebb4e79b6 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
@@ -20,6 +20,7 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
@@ -41,7 +42,7 @@ public class GetContainedDiagrams extends AbstractEditorContainerQuery implement
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
+ if (EcoreUtil.equals(DiagramUtils.getOwner((Diagram) root), source)) {
result.add((Diagram)root);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
index 23b836b4cf5..3572004ef38 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
@@ -14,6 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils;
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
@@ -27,6 +29,7 @@ public class GetDiagramIcon extends AbstractGetEditorIconQuery implements IJavaQ
public IImage evaluate(Diagram source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- return ImageUtils.wrap(org.eclipse.emf.common.util.URI.createPlatformPluginURI(getEditorRegistry(source).getEditorURLIcon(source), true).toString()); //$NON-NLS-1$
+ ViewPrototype prototype = DiagramUtils.getPrototype(source);
+ return ImageUtils.wrap(prototype.getIconURI());
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
index 23e6be9f436..348eff81323 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
@@ -46,7 +47,7 @@ public class IsDiagramContainer extends AbstractEditorContainerQuery implements
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
+ if (EcoreUtil.equals(DiagramUtils.getOwner((Diagram) root), source)) {
return true;
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/CreateDiagramWithNavigationHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/CreateDiagramWithNavigationHandler.java
deleted file mode 100644
index 3bc66d3ed60..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/CreateDiagramWithNavigationHandler.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.navigation;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.ICreationCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.extension.commands.ICreationCondition;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.emf.utils.BusinessModelResolver;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
-import org.eclipse.papyrus.infra.widgets.toolbox.dialog.InformationDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * This command handler will try to create a diagram on the currently selected
- * element, using navigation if necessary. The action is always available and
- * the check is done in the run to avoid heavy navigation computation on each
- * selection change.
- *
- * @author mvelten
- *
- */
-public abstract class CreateDiagramWithNavigationHandler extends AbstractHandler {
-
- private ICreationCondition creationCondition;
-
- private ICreationCommand creationCommand;
-
- public CreateDiagramWithNavigationHandler(ICreationCommand creationCommand, ICreationCondition creationCondition) {
- super();
- this.creationCommand = creationCommand;
- this.creationCondition = creationCondition;
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- NavigableElement navElement = getNavigableElementWhereToCreateDiagram(event);
- ServicesRegistry registry;
- try {
- registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
- } catch (ServiceException ex) {
- Activator.log.error(ex);
- return null;
- }
-
- if(navElement == null) {
- InformationDialog dialog = new InformationDialog(Display.getCurrent().getActiveShell(), "Impossible diagram creation", "It is not possible to create this diagram on the selected element.", null, null, SWT.OK, MessageDialog.WARNING, new String[]{ IDialogConstants.OK_LABEL });
- dialog.open();
- } else {
- createDiagram(navElement, registry);
- }
- return null;
- }
-
- private NavigableElement getNavigableElementWhereToCreateDiagram(ExecutionEvent event) {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection.isEmpty()) {
- return null;
- }
-
- if(selection instanceof IStructuredSelection) {
- EObject selectedElement = EMFHelper.getEObject(((IStructuredSelection)selection).getFirstElement());
-
- if(selectedElement != null) {
- // First check if the current element can host the requested diagram
- if(creationCondition.create(selectedElement)) {
- return new ExistingNavigableElement(selectedElement, null);
- } else {
- List<NavigableElement> navElements = NavigationHelper.getInstance().getAllNavigableElements(selectedElement);
- // this will sort elements by navigation depth
- Collections.sort(navElements);
-
- for(NavigableElement navElement : navElements) {
- // ignore existing elements because we want a hierarchy to
- // be created if it is not on the current element
- if(navElement instanceof CreatedNavigableElement && creationCondition.create(navElement.getElement())) {
- return navElement;
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private void createDiagram(NavigableElement navElement, ServicesRegistry registry) {
- ModelSet modelSet;
- try {
- modelSet = ServiceUtils.getInstance().getModelSet(registry);
- } catch (ServiceException ex) {
- Activator.log.error(ex);
- return;
- }
-
- if(navElement != null && modelSet != null) {
- try {
- CompositeCommand command = NavigationHelper.getLinkCreateAndOpenNavigableDiagramCommand(navElement, creationCommand, null, modelSet);
- modelSet.getTransactionalEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- } catch (Exception e) {
- }
- }
- }
-
- /**
- * Resolve semantic element
- *
- * @param object
- * the object to resolve
- * @return <code>null</code> or the semantic element associated to the
- * specified object
- */
- protected EObject resolveSemanticObject(Object object) {
- if(object instanceof EObject) {
- return (EObject)object;
- }
- Object businessObject = BusinessModelResolver.getInstance().getBusinessModel(object);
- if(businessObject instanceof EObject) {
- return (EObject)businessObject;
- }
- return null;
- }
-
- @Override
- public void setEnabled(Object evaluationContext) {
- if(evaluationContext instanceof IEvaluationContext) {
- Object selectionVariable = ((IEvaluationContext)evaluationContext).getDefaultVariable();
-
- if(selectionVariable instanceof Collection<?>) {
- List<?> selection = (selectionVariable instanceof List<?>) ? (List<?>)selectionVariable : new java.util.ArrayList<Object>((Collection<?>)selectionVariable);
- if(selection.size() != 1) {
- setBaseEnabled(false);
- return;
- }
-
- EObject target = EMFHelper.getEObject(selection.get(0));
- setBaseEnabled(creationCondition.create(target));
- }
- }
- super.setEnabled(evaluationContext);
- }
-
-}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
index d922ee2a532..cbdf8697d24 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.infra.gmfdiag.properties.extension,
org.eclipse.papyrus.infra.gmfdiag.properties.modelelement
Bundle-Vendor: %Bundle-Vendor
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
index 530b8df9e75..484a6246643 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
@@ -37,9 +37,6 @@
<sections name="Single RelativeBendpoints" sectionFile="ui/SingleRelativeBendpoints.xwt">
<widget href="ui/SingleRelativeBendpoints.xwt#/"/>
</sections>
- <sections name="Single Diagram" sectionFile="ui/SingleDiagram.xwt">
- <widget href="ui/SingleDiagram.xwt#/"/>
- </sections>
<sections name="Single Image" sectionFile="ui/SingleImage.xwt">
<widget href="ui/SingleImage.xwt#/"/>
</sections>
@@ -184,18 +181,18 @@
<widget href="ui/SingleRulersAndGrid.xwt#/"/>
</sections>
</tabs>
- <views name="Single Diagram" sections="//@tabs.0/@sections.12" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
+ <tabs label="General" id="general" category="org.eclipse.papyrus" priority="75">
+ <sections name="Single Diagram" sectionFile="ui/SingleDiagram.xwt">
+ <widget href="ui/SingleDiagram.xwt#/"/>
+ </sections>
+ </tabs>
+ <views name="Single Diagram" sections="//@tabs.2/@sections.0" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/>
</constraints>
</views>
- <views name="Single Decorable Element" sections="//@tabs.0/@sections.58" automaticContext="true" datacontexts="//@dataContexts.1/@elements.0">
- <constraints xsi:type="constraints:SimpleConstraint" name="isDecorableElementConstraint">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.4"/>
- </constraints>
- </views>
<views name="Single Edge" sections="//@tabs.0/@sections.0" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleEdge">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
@@ -280,112 +277,112 @@
<properties xsi:type="constraints:ValueProperty" name="className" value="RelativeBendpoints"/>
</constraints>
</views>
- <views name="Single Image" sections="//@tabs.0/@sections.13" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
+ <views name="Single Image" sections="//@tabs.0/@sections.12" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleImage">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Image"/>
</constraints>
</views>
- <views name="Single Guide" sections="//@tabs.0/@sections.14" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
+ <views name="Single Guide" sections="//@tabs.0/@sections.13" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleGuide">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Guide"/>
</constraints>
</views>
- <views name="Single NodeEntry" sections="//@tabs.0/@sections.15" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
+ <views name="Single NodeEntry" sections="//@tabs.0/@sections.14" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleNodeEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="NodeEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.16" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
+ <views name="Single StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.15" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStringToPropertyValueMapEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringToPropertyValueMapEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single PropertyValue" sections="//@tabs.0/@sections.17" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
+ <views name="Single PropertyValue" sections="//@tabs.0/@sections.16" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
<constraints xsi:type="constraints:SimpleConstraint" name="isSinglePropertyValue">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="PropertyValue"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StringObjectConverter" sections="//@tabs.0/@sections.18" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
+ <views name="Single StringObjectConverter" sections="//@tabs.0/@sections.17" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStringObjectConverter">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringObjectConverter"/>
</constraints>
</views>
- <views name="Single Shape" sections="//@tabs.0/@sections.19" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
+ <views name="Single Shape" sections="//@tabs.0/@sections.18" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleShape">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Shape"/>
</constraints>
</views>
- <views name="Single Compartment" sections="//@tabs.0/@sections.20" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
+ <views name="Single Compartment" sections="//@tabs.0/@sections.19" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Compartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single ListCompartment" sections="//@tabs.0/@sections.21" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
+ <views name="Single ListCompartment" sections="//@tabs.0/@sections.20" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="ListCompartment"/>
</constraints>
</views>
- <views name="Single Connector" sections="//@tabs.0/@sections.22" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
+ <views name="Single Connector" sections="//@tabs.0/@sections.21" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleConnector">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Connector"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StandardDiagram" sections="//@tabs.0/@sections.23" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
+ <views name="Single StandardDiagram" sections="//@tabs.0/@sections.22" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStandardDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StandardDiagram"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single DecorationNode" sections="//@tabs.0/@sections.24" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
+ <views name="Single DecorationNode" sections="//@tabs.0/@sections.23" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="DecorationNode"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single BasicDecorationNode" sections="//@tabs.0/@sections.25" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
+ <views name="Single BasicDecorationNode" sections="//@tabs.0/@sections.24" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicDecorationNode"/>
</constraints>
</views>
- <views name="Single BasicCompartment" sections="//@tabs.0/@sections.26" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
+ <views name="Single BasicCompartment" sections="//@tabs.0/@sections.25" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single BasicSemanticCompartment" sections="//@tabs.0/@sections.27" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
+ <views name="Single BasicSemanticCompartment" sections="//@tabs.0/@sections.26" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicSemanticCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicSemanticCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single SemanticListCompartment" sections="//@tabs.0/@sections.28" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
+ <views name="Single SemanticListCompartment" sections="//@tabs.0/@sections.27" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleSemanticListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="SemanticListCompartment"/>
@@ -398,209 +395,214 @@
<properties xsi:type="constraints:ValueProperty" name="className" value="org.eclipse.papyrus.infra.gmfdiag.properties.constraint.IsSingleDiagramEditorConstraint"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Edge" sections="//@tabs.0/@sections.29" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
+ <views elementMultiplicity="-1" name="Multiple Edge" sections="//@tabs.0/@sections.28" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleEdge">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Edge"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Node" sections="//@tabs.0/@sections.30" automaticContext="true" datacontexts="//@dataContexts.0/@elements.1">
+ <views elementMultiplicity="-1" name="Multiple Node" sections="//@tabs.0/@sections.29" automaticContext="true" datacontexts="//@dataContexts.0/@elements.1">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Node"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple LayoutConstraint" sections="//@tabs.0/@sections.31" automaticContext="true" datacontexts="//@dataContexts.0/@elements.2">
+ <views elementMultiplicity="-1" name="Multiple LayoutConstraint" sections="//@tabs.0/@sections.30" automaticContext="true" datacontexts="//@dataContexts.0/@elements.2">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleLayoutConstraint">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="LayoutConstraint"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Size" sections="//@tabs.0/@sections.32" automaticContext="true" datacontexts="//@dataContexts.0/@elements.3">
+ <views elementMultiplicity="-1" name="Multiple Size" sections="//@tabs.0/@sections.31" automaticContext="true" datacontexts="//@dataContexts.0/@elements.3">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleSize">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Size"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Location" sections="//@tabs.0/@sections.33" automaticContext="true" datacontexts="//@dataContexts.0/@elements.4">
+ <views elementMultiplicity="-1" name="Multiple Location" sections="//@tabs.0/@sections.32" automaticContext="true" datacontexts="//@dataContexts.0/@elements.4">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleLocation">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Location"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Bounds" sections="//@tabs.0/@sections.34" automaticContext="true" datacontexts="//@dataContexts.0/@elements.5">
+ <views elementMultiplicity="-1" name="Multiple Bounds" sections="//@tabs.0/@sections.33" automaticContext="true" datacontexts="//@dataContexts.0/@elements.5">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBounds">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Bounds"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Ratio" sections="//@tabs.0/@sections.35" automaticContext="true" datacontexts="//@dataContexts.0/@elements.6">
+ <views elementMultiplicity="-1" name="Multiple Ratio" sections="//@tabs.0/@sections.34" automaticContext="true" datacontexts="//@dataContexts.0/@elements.6">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleRatio">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Ratio"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Anchor" sections="//@tabs.0/@sections.36" automaticContext="true" datacontexts="//@dataContexts.0/@elements.7">
+ <views elementMultiplicity="-1" name="Multiple Anchor" sections="//@tabs.0/@sections.35" automaticContext="true" datacontexts="//@dataContexts.0/@elements.7">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleAnchor">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Anchor"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Bendpoints" sections="//@tabs.0/@sections.37" automaticContext="true" datacontexts="//@dataContexts.0/@elements.8">
+ <views elementMultiplicity="-1" name="Multiple Bendpoints" sections="//@tabs.0/@sections.36" automaticContext="true" datacontexts="//@dataContexts.0/@elements.8">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBendpoints">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Bendpoints"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple IdentityAnchor" sections="//@tabs.0/@sections.38" automaticContext="true" datacontexts="//@dataContexts.0/@elements.9">
+ <views elementMultiplicity="-1" name="Multiple IdentityAnchor" sections="//@tabs.0/@sections.37" automaticContext="true" datacontexts="//@dataContexts.0/@elements.9">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleIdentityAnchor">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="IdentityAnchor"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple View" sections="//@tabs.0/@sections.39" automaticContext="true" datacontexts="//@dataContexts.0/@elements.10">
+ <views elementMultiplicity="-1" name="Multiple View" sections="//@tabs.0/@sections.38" automaticContext="true" datacontexts="//@dataContexts.0/@elements.10">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleView">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="View"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple RelativeBendpoints" sections="//@tabs.0/@sections.40" automaticContext="true" datacontexts="//@dataContexts.0/@elements.11">
+ <views elementMultiplicity="-1" name="Multiple RelativeBendpoints" sections="//@tabs.0/@sections.39" automaticContext="true" datacontexts="//@dataContexts.0/@elements.11">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleRelativeBendpoints">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="RelativeBendpoints"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Diagram" sections="//@tabs.0/@sections.41" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
+ <views elementMultiplicity="-1" name="Multiple Diagram" sections="//@tabs.0/@sections.40" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Image" sections="//@tabs.0/@sections.42" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
+ <views elementMultiplicity="-1" name="Multiple Image" sections="//@tabs.0/@sections.41" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleImage">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Image"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Guide" sections="//@tabs.0/@sections.43" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
+ <views elementMultiplicity="-1" name="Multiple Guide" sections="//@tabs.0/@sections.42" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleGuide">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Guide"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple NodeEntry" sections="//@tabs.0/@sections.44" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
+ <views elementMultiplicity="-1" name="Multiple NodeEntry" sections="//@tabs.0/@sections.43" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleNodeEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="NodeEntry"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.45" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
+ <views elementMultiplicity="-1" name="Multiple StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.44" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStringToPropertyValueMapEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringToPropertyValueMapEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple PropertyValue" sections="//@tabs.0/@sections.46" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
+ <views elementMultiplicity="-1" name="Multiple PropertyValue" sections="//@tabs.0/@sections.45" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultiplePropertyValue">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="PropertyValue"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StringObjectConverter" sections="//@tabs.0/@sections.47" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
+ <views elementMultiplicity="-1" name="Multiple StringObjectConverter" sections="//@tabs.0/@sections.46" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStringObjectConverter">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringObjectConverter"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Shape" sections="//@tabs.0/@sections.48" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
+ <views elementMultiplicity="-1" name="Multiple Shape" sections="//@tabs.0/@sections.47" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleShape">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Shape"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Compartment" sections="//@tabs.0/@sections.49" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
+ <views elementMultiplicity="-1" name="Multiple Compartment" sections="//@tabs.0/@sections.48" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Compartment"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple ListCompartment" sections="//@tabs.0/@sections.50" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
+ <views elementMultiplicity="-1" name="Multiple ListCompartment" sections="//@tabs.0/@sections.49" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="ListCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Connector" sections="//@tabs.0/@sections.51" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
+ <views elementMultiplicity="-1" name="Multiple Connector" sections="//@tabs.0/@sections.50" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleConnector">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Connector"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StandardDiagram" sections="//@tabs.0/@sections.52" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
+ <views elementMultiplicity="-1" name="Multiple StandardDiagram" sections="//@tabs.0/@sections.51" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStandardDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StandardDiagram"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple DecorationNode" sections="//@tabs.0/@sections.53" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
+ <views elementMultiplicity="-1" name="Multiple DecorationNode" sections="//@tabs.0/@sections.52" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="DecorationNode"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicDecorationNode" sections="//@tabs.0/@sections.54" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
+ <views elementMultiplicity="-1" name="Multiple BasicDecorationNode" sections="//@tabs.0/@sections.53" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicDecorationNode"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicCompartment" sections="//@tabs.0/@sections.55" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
+ <views elementMultiplicity="-1" name="Multiple BasicCompartment" sections="//@tabs.0/@sections.54" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicCompartment"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicSemanticCompartment" sections="//@tabs.0/@sections.56" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
+ <views elementMultiplicity="-1" name="Multiple BasicSemanticCompartment" sections="//@tabs.0/@sections.55" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicSemanticCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicSemanticCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple SemanticListCompartment" sections="//@tabs.0/@sections.57" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
+ <views elementMultiplicity="-1" name="Multiple SemanticListCompartment" sections="//@tabs.0/@sections.56" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleSemanticListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="SemanticListCompartment"/>
</constraints>
</views>
+ <views name="Single Decorable Element" sections="//@tabs.0/@sections.57" automaticContext="true" datacontexts="//@dataContexts.1/@elements.0">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isDecorableElementConstraint">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.4"/>
+ </constraints>
+ </views>
<dataContexts name="notation" label="notation">
<elements name="Edge" supertypes="//@dataContexts.0/@elements.10">
<properties name="source" type="Reference"/>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
index 0e7eb2296f9..d08acaed9e0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
@@ -11,6 +11,8 @@
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:StringEditor input="{Binding}" property="notation:Diagram:name"></ppe:StringEditor>
- <ppe:StringLabel input="{Binding}" property="notation:View:type"></ppe:StringLabel>
+ <ppe:ReferenceLabel input="{Binding}" property="notation:View:prototype" readOnly="true" customLabel="View Type"></ppe:ReferenceLabel>
+ <ppe:ReferenceDialog input="{Binding}" property="notation:View:owner" customLabel="Owner"></ppe:ReferenceDialog>
+ <ppe:ReferenceDialog input="{Binding}" property="notation:View:element" customLabel="Root element"></ppe:ReferenceDialog>
</Composite>
</Composite> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
index f85b81ae344..a85ef90af4c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
@@ -19,17 +19,28 @@ import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.gmfdiag.properties.Activator;
import org.eclipse.papyrus.infra.gmfdiag.properties.databinding.GradientObservableValue;
+import org.eclipse.papyrus.infra.gmfdiag.properties.provider.ModelContentProvider;
+import org.eclipse.papyrus.infra.gmfdiag.properties.util.LegacyOwnerObservable;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.viewpoints.style.StylePackage;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableList;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
+import org.eclipse.swt.graphics.Image;
/**
* A ModelElement to represent an element of the GMF Notation metamodel
@@ -65,7 +76,29 @@ public class GMFModelElement extends EMFModelElement {
}
@Override
+ protected boolean isFeatureEditable(String propertyPath) {
+ if (propertyPath.endsWith("owner")) {
+ return true;
+ }
+ return super.isFeatureEditable(propertyPath);
+ }
+
+ @Override
protected IObservable doGetObservable(String propertyPath) {
+ if (propertyPath.endsWith("owner")) {
+ Diagram diagram = (Diagram)source;
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
+ return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
+ } else if (propertyPath.endsWith("prototype")) {
+ Diagram diagram = (Diagram)source;
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
+ return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
+ }
+
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(propertyPath);
@@ -88,6 +121,22 @@ public class GMFModelElement extends EMFModelElement {
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
+ if (propertyPath.endsWith("prototype")) {
+ return new ILabelProvider() {
+ public void addListener(ILabelProviderListener listener) { }
+ public void removeListener(ILabelProviderListener listener) { }
+ public void dispose() { }
+ public boolean isLabelProperty(Object element, String property) { return false; }
+ public Image getImage(Object element) {
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ return proto.getIcon();
+ }
+ public String getText(Object element) {
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ return proto.getQualifiedName();
+ }
+ };
+ }
try {
return ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, source).getLabelProvider();
} catch (ServiceException ex) {
@@ -96,4 +145,43 @@ public class GMFModelElement extends EMFModelElement {
}
}
+ /**
+ * @see org.eclipse.papyrus.views.properties.modelelement.EMFModelElement#getContentProvider(java.lang.String)
+ */
+ @Override
+ public IStaticContentProvider getContentProvider(String propertyPath) {
+ if (propertyPath.endsWith("element")) {
+ Diagram diagram = (Diagram)source;
+ return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
+ @Override
+ protected boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype) {
+ return PolicyChecker.getCurrent().canHaveNewView(selection, DiagramUtils.getOwner(diagram), prototype);
+ }
+ };
+ } else if (propertyPath.endsWith("owner")) {
+ Diagram diagram = (Diagram) source;
+ return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
+ @Override
+ protected boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype) {
+ return PolicyChecker.getCurrent().canHaveNewView(diagram.getElement(), selection, prototype);
+ }
+ };
+ }
+ return super.getContentProvider(propertyPath);
+ }
+
+ /**
+ * Gets the root EObject from the given one
+ * @param obj An object
+ * @return The root object which is an ancestor of the given one
+ */
+ private EObject getRoot(EObject obj) {
+ EObject current = obj;
+ EObject parent = obj.eContainer();
+ while (parent != null) {
+ current = parent;
+ parent = parent.eContainer();
+ }
+ return current;
+ }
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
new file mode 100755
index 00000000000..78e29021201
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.properties.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ui.ECoreModelContentProvider;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+/**
+ * Represents a simple ECore model content provider for the selection of a diagram's root model element
+ * @author Laurent Wouters
+ */
+public abstract class ModelContentProvider extends ECoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider {
+
+ /**
+ * The diagram
+ */
+ private Diagram diagram;
+
+ /**
+ * Initializes the provider with the given root
+ * @param diagram The diagram for which a root model element is to be provided
+ * @param root The root object
+ */
+ public ModelContentProvider(Diagram diagram, EObject root) {
+ super(root);
+ this.diagram = diagram;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider#getElements()
+ */
+ public Object[] getElements() {
+ return getElements(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(java.lang.Object)
+ */
+ public boolean isValidValue(Object element) {
+ if (element == null)
+ return false;
+ if (!(element instanceof EObject))
+ return false;
+ ViewPrototype prototype = DiagramUtils.getPrototype(diagram);
+ if (prototype == null)
+ return false;
+ return isValid((EObject) element, diagram, prototype);
+ }
+
+ /**
+ * Determines whether the selection is valid
+ *
+ * @param selection
+ * The selection
+ * @param diagram
+ * The diagram
+ * @param prototype
+ * The diagram's prototype
+ * @return <code>true</code> if the selection is valid
+ */
+ protected abstract boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype);
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
new file mode 100755
index 00000000000..8b941318fae
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
@@ -0,0 +1,158 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.properties.util;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
+import org.eclipse.core.databinding.observable.value.ValueDiff;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.style.StylePackage;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
+
+/**
+ * Represents the observable value of a diagram's owner in the case where the diagram does not yet have the viewpoints-compatible style for holding the value itself
+ * @author Laurent Wouters
+ */
+public class LegacyOwnerObservable extends AbstractObservableValue {
+
+ private EditingDomain domain;
+ private Diagram diagram;
+ private EReference reference;
+ private IChangeListener styleListener;
+ private IChangeListener valueListener;
+ private PapyrusObservableValue styleObservable;
+ private PapyrusObservableValue valueObservable;
+
+ /**
+ * Initializes the observables
+ * @param diagram The diagram to be observed
+ * @param domain The editing domain
+ */
+ public LegacyOwnerObservable(Diagram diagram, EReference feature, EditingDomain domain) {
+ super(Realm.getDefault());
+ this.domain = domain;
+ this.diagram = diagram;
+ this.reference = feature;
+ buildStyleListener();
+ this.styleObservable = new PapyrusObservableValue(diagram, NotationPackage.Literals.VIEW__STYLES, domain);
+ this.styleObservable.addChangeListener(styleListener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#isStale()
+ */
+ public boolean isStale() {
+ return (valueListener != null);
+ }
+
+ /**
+ * Builds the listener for the styles property of the diagram
+ */
+ private void buildStyleListener() {
+ this.styleListener = new IChangeListener() {
+ public void handleChange(ChangeEvent event) {
+ if (valueListener != null)
+ return;
+ Style style = LegacyOwnerObservable.this.diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ buildValueListener(style);
+ }
+ };
+ }
+
+ /**
+ * Builds the listener for the EObjectValue property of the style
+ * @param style The style to be observed
+ */
+ private void buildValueListener(Style style) {
+ this.valueListener = new IChangeListener() {
+ public void handleChange(ChangeEvent event) {
+ fireValueChange(new ValueDiff() {
+ public Object getOldValue() { return null; }
+ public Object getNewValue() { return DiagramUtils.getOwner(diagram); }
+ });
+ }
+ };
+ valueObservable = new PapyrusObservableValue(style, reference, domain);
+ valueObservable.addChangeListener(valueListener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
+ */
+ public Object getValueType() {
+ return EcorePackage.Literals.EOBJECT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
+ */
+ protected Object doGetValue() {
+ return DiagramUtils.getOwner(diagram);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
+ */
+ protected void doSetValue(Object value) {
+ Command emfCommand = getCommand((EObject) value);
+ domain.getCommandStack().execute(emfCommand);
+ }
+
+ private Command getCommand(final EObject newValue) {
+ final EObject oldValue = DiagramUtils.getOwner(diagram);
+
+ return new AbstractCommand("Change diagram's owner") {
+ private boolean createStyle = true;
+
+ public void execute() {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ createStyle = (style == null);
+ DiagramUtils.setOwner(diagram, newValue);
+ }
+
+ public void redo() {
+ DiagramUtils.setOwner(diagram, newValue);
+ }
+
+ @Override
+ public void undo() {
+ if (createStyle) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ diagram.getStyles().remove(style);
+ } else {
+ DiagramUtils.setOwner(diagram, oldValue);
+ }
+ }
+
+ @Override
+ public boolean prepare() {
+ return true;
+ }
+ };
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
index c3685758a62..272941560fd 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
@@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.core.contexts,
org.eclipse.core.expressions,
- org.eclipse.emf.edit.ui
+ org.eclipse.emf.edit.ui,
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.infra.nattable.common,
org.eclipse.papyrus.infra.nattable.common.editor,
org.eclipse.papyrus.infra.nattable.common.factory,
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
index a6220b4d8d6..93fcd4b7399 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
@@ -8,16 +8,24 @@
</extension>
<extension id="papyrus.table.menuspapyrus.table.menu" name="Papyrus Table Menus" point="org.eclipse.ui.menus">
<menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
- <menu icon="icons/table.gif" id="org.eclipse.papyrus.infra.nattable.popupmenu.createnattable" label="New Table (New version)" mnemonic="&amp;T" tooltip="The Papyrus Table Menu">
+ <menu icon="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewTable.gif" id="org.eclipse.papyrus.infra.nattable.popupmenu.createnattable" label="New Table" mnemonic="&amp;T" tooltip="The Papyrus Table Menu">
+ <dynamic
+ class="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution"
+ id="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution">
+ </dynamic>
</menu>
</menuContribution>
<menuContribution allPopups="false" locationURI="menu:org.eclipse.papyrus.ui.menu?after=org.eclipse.papyrus.uml.diagram.ui.menu.diagrams">
<menu
- icon="icons/table.gif"
+ icon="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewTable.gif"
id="org.eclipse.papyrus.infra.nattable.menu.createnattable"
- label="New Table (New version)"
+ label="New Table"
mnemonic="&amp;T"
tooltip="The Papyrus Table Menu">
+ <dynamic
+ class="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution"
+ id="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution">
+ </dynamic>
</menu>
</menuContribution>
@@ -161,5 +169,61 @@
type="org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable">
</adapter>
</factory>
+</extension>
+<extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar">
+ <command
+ commandId="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.tables.command"
+ icon="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/NewTable.gif"
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.tables.command"
+ label="Create a new table ..."
+ style="pulldown"
+ tooltip="Create a new table ...">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </toolbar>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:org.eclipse.papyrus.infra.viewpoints.policy.toolbar.tables.command">
+ <dynamic
+ class="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution"
+ id="org.eclipse.papyrus.infra.nattable.common.handlers.DynamicTablesMenuContribution">
+ </dynamic>
+ </menuContribution>
+</extension>
+<extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.infra.viewpoints.policy.commands"
+ defaultHandler="org.eclipse.papyrus.infra.viewpoints.policy.DynamicCommandHandler"
+ id="org.eclipse.papyrus.infra.viewpoints.policy.toolbar.tables.command"
+ name="Create Dynamic Table Command">
+ </command>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.viewpoints.policy.viewType">
+ <helper
+ class="org.eclipse.papyrus.infra.nattable.common.helper.TableCommandHelper">
+ </helper>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.viewpoints.policy.viewType">
+ <helper
+ class="org.eclipse.papyrus.infra.nattable.common.helper.SyncTableCommandHelper">
+ </helper>
</extension>
</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/AbstractCreateNattableEditorHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/AbstractCreateNattableEditorHandler.java
index 75b61a09193..f7f18c4dede 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/AbstractCreateNattableEditorHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/AbstractCreateNattableEditorHandler.java
@@ -83,27 +83,34 @@ public abstract class AbstractCreateNattableEditorHandler extends AbstractHandle
}
/**
- * Run the command as a transaction. Create a Transaction and delegate the
- * command to {@link #doExecute(ServicesRegistry)}.
- *
- * @throws ServiceException
- *
+ * Prompts the user the future table's name
+ * @return The name, or <code>null</code> if the user cancelled the creation
*/
- public void runAsTransaction(final ExecutionEvent event) throws ServiceException {
+ public String askName() {
//we create a new resourceSet to avoid to load unused config in the resourceset in case of Cancel
ResourceSet set = new ResourceSetImpl();
Resource res = set.getResource(getTableEditorConfigurationURI(), true);
TableConfiguration conf = (TableConfiguration)res.getContents().get(0);
String defaultName = conf.getName();
// default Value
- final String name;
final String nameWithIncrement = EditorNameInitializer.getNameWithIncrement(NattablePackage.eINSTANCE.getTable(), NattableconfigurationPackage.eINSTANCE.getTableNamedElement_Name(), defaultName, getTableContext());
final InputDialog dialog = new InputDialog(Display.getDefault().getActiveShell(), Messages.AbstractCreateNattableEditorHandler_PapyrusTableCreation, Messages.AbstractCreateNattableEditorHandler_EnterTheNameForTheNewTable, nameWithIncrement, null);
- if(dialog.open() == Dialog.OK) {
- name = dialog.getValue();
+ if(dialog.open() == Dialog.OK)
+ return dialog.getValue();
+ return null;
+ }
+
+ /**
+ * Run the command as a transaction. Create a Transaction and delegate the
+ * command to {@link #doExecute(ServicesRegistry)}.
+ *
+ * @throws ServiceException
+ *
+ */
+ public void runAsTransaction(final ExecutionEvent event) throws ServiceException {
+ String name = askName();
+ if (name != null)
runAsTransaction(event, name);
- }
-
}
/**
@@ -158,14 +165,13 @@ public abstract class AbstractCreateNattableEditorHandler extends AbstractHandle
* @throws ServiceException
* @throws NotFoundException
*/
- public void doExecute(final ServicesRegistry serviceRegistry, String name, String description) throws ServiceException, NotFoundException {
-
- final Object editorModel = createEditorModel(serviceRegistry, name, description);
+ public Table doExecute(final ServicesRegistry serviceRegistry, String name, String description) throws ServiceException, NotFoundException {
+ final Table editorModel = createEditorModel(serviceRegistry, name, description);
// Get the mngr allowing to add/open new editor.
final IPageManager pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry);
// add the new editor model to the sash.
pageMngr.openPage(editorModel);
-
+ return editorModel;
}
/**
@@ -177,7 +183,7 @@ public abstract class AbstractCreateNattableEditorHandler extends AbstractHandle
* @throws NotFoundException
* The model where to save the TableInstance is not found.
*/
- protected Object createEditorModel(final ServicesRegistry serviceRegistry, String name, String description) throws ServiceException, NotFoundException {
+ protected Table createEditorModel(final ServicesRegistry serviceRegistry, String name, String description) throws ServiceException, NotFoundException {
final TableConfiguration configuration = getDefaultTableEditorConfiguration();
assert configuration != null;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java
new file mode 100755
index 00000000000..687e6050a82
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java
@@ -0,0 +1,102 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.handlers;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+import org.eclipse.papyrus.infra.viewpoints.policy.DynamicContribution;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the dynamic contribution of a policy to menus
+ * @author Laurent Wouters
+ */
+public class DynamicTablesMenuContribution extends DynamicContribution {
+ /**
+ * Constructor.
+ */
+ public DynamicTablesMenuContribution() { }
+
+ /**
+ * Constructor.
+ * @param id
+ */
+ public DynamicTablesMenuContribution(String id) {
+ super(id);
+ }
+
+ /**
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ final EObject selection = getSelection();
+ if (selection == null)
+ return new IContributionItem[0];
+
+ // build a list of all the available prototypes
+ List<ViewPrototype> data = new ArrayList<ViewPrototype>();
+ for (final ViewPrototype proto : PolicyChecker.getCurrent().getPrototypesFor(selection)) {
+ if (!(proto.getConfiguration() instanceof PapyrusTable || proto.getConfiguration() instanceof PapyrusSyncTable))
+ continue;
+ data.add(proto);
+ }
+
+ // sort them
+ Collections.sort(data, new ViewPrototype.Comp());
+
+ // build the full labels
+ List<String> labels = new ArrayList<String>(data.size());
+ String last = null;
+ boolean first = true;
+ for (ViewPrototype item : data) {
+ String label = item.getLabel();
+ if (last != null && last.equals(label)) {
+ // name collision
+ if (first) {
+ labels.set(labels.size() - 1, data.get(labels.size() - 1).getFullLabel());
+ first = false;
+ }
+ labels.add(item.getFullLabel());
+ } else {
+ labels.add(label);
+ last = label;
+ first = true;
+ }
+ }
+
+ // build the menu
+ List<IContributionItem> items = new ArrayList<IContributionItem>(data.size());
+ for (int i = 0; i != data.size(); i++) {
+ final ViewPrototype proto = data.get(i);
+ String label = labels.get(i);
+ items.add(new ActionContributionItem(new Action(CREATE_MESSAGE + label, proto.getIconDescriptor()) {
+ @Override
+ public void run() {
+ proto.instantiateOn(selection);
+ }
+ }));
+ }
+ return items.toArray(new IContributionItem[items.size()]);
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
new file mode 100755
index 00000000000..850517b770e
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.handlers;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.nattable.Activator;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+
+/**
+ * Represents the handler for the creation of table defined in a viewpoint
+ * @author Laurent Wouters
+ */
+public class PolicyDefinedTableHandler extends CreateNatTableEditorHandler {
+ private URI configuration;
+ private EObject context;
+ private String name;
+
+ public PolicyDefinedTableHandler(URI config, EObject context, String name) {
+ this.configuration = config;
+ this.context = context;
+ this.name = name;
+ }
+
+ @Override
+ protected EObject getTableContext() {
+ return context;
+ }
+
+ @Override
+ protected URI getTableEditorConfigurationURI() {
+ return configuration;
+ }
+
+ public boolean execute(final ViewPrototype prototype) {
+ final String name = this.name != null ? this.name : askName();
+ if (name == null)
+ return false;
+ try {
+ final ServicesRegistry serviceRegistry = ServiceUtilsForEObject.getInstance().getServiceRegistry(context);
+ final TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ try {
+ Table table = PolicyDefinedTableHandler.this.doExecute(serviceRegistry, name, this.description);
+ table.setOwner(context);
+ table.setPrototype(prototype.getConfiguration());
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ }
+ }
+ });
+ return true;
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ return false;
+ }
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java
new file mode 100755
index 00000000000..6993609538c
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java
@@ -0,0 +1,112 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the command helper for the viewpoints application to synchronized tables
+ * @author Laurent Wouters
+ */
+public class SyncTableCommandHelper implements IViewTypeHelper {
+ /**
+ * ID of the extension point for Papyrus diagrams
+ */
+ private static final String EXTENSION_PAPYRUS_SYNC_TABLE = "org.eclipse.papyrus.infra.nattable.configuration";
+
+ /**
+ * The cache of implementations
+ */
+ private Map<String, String> implementations;
+
+ /**
+ * The cache of prototypes
+ */
+ private Map<PapyrusView, TableViewPrototype> cache;
+
+
+
+ @Override
+ public ViewPrototype getPrototypeFor(PapyrusView configuration) {
+ if (!(configuration instanceof PapyrusSyncTable))
+ return null;
+ if (implementations == null)
+ buildImplementationCache();
+ if (cache == null)
+ cache = new HashMap<PapyrusView, TableViewPrototype>();
+ if (cache.containsKey(configuration))
+ return cache.get(configuration);
+ if (!implementations.containsKey(configuration.getImplementationID()))
+ return null;
+ TableViewPrototype proto = new TableViewPrototype((PapyrusSyncTable)configuration, implementations.get(configuration.getImplementationID()));
+ cache.put(configuration, proto);
+ return proto;
+ }
+
+ @Override
+ public boolean isSupported(EClass type) {
+ return (type == ConfigurationPackage.eINSTANCE.getPapyrusSyncTable());
+ }
+
+ @Override
+ public boolean isSupported(EObject view) {
+ if (!(view instanceof Table))
+ return false;
+ Table table = (Table)view;
+ return (table.getPrototype() instanceof PapyrusSyncTable);
+ }
+
+ @Override
+ public ViewPrototype getPrototypeOf(EObject view) {
+ return getPrototypeFor((PapyrusView)((Table)view).getPrototype());
+ }
+
+ /**
+ * Builds the cache of sync table implementations
+ */
+ private void buildImplementationCache() {
+ implementations = new HashMap<String, String>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint point = registry.getExtensionPoint(EXTENSION_PAPYRUS_SYNC_TABLE);
+ IExtension[] extensions = point.getExtensions();
+ for (int i=0; i!=extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i].getConfigurationElements();
+ for (int j=0; j!=elements.length; j++) {
+ if (elements[j].getName().equals("configuration")) {
+ String type = elements[j].getAttribute("type");
+ String file = elements[j].getAttribute("file");
+ if (!file.startsWith("platform:/"))
+ file = "platform:/plugin/" + extensions[i].getContributor().getName() + "/" + file;
+ if (!implementations.containsKey(type))
+ implementations.put(type, file);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
new file mode 100755
index 00000000000..29fdab48711
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the command helper for viewpoints-based generic tables
+ * @author Laurent Wouters
+ */
+public class TableCommandHelper implements IViewTypeHelper {
+
+ /**
+ * The cache of prototypes
+ */
+ private Map<PapyrusView, TableViewPrototype> cache;
+
+ @Override
+ public ViewPrototype getPrototypeFor(PapyrusView configuration) {
+ if (!(configuration instanceof PapyrusTable))
+ return null;
+ if (cache == null)
+ cache = new HashMap<PapyrusView, TableViewPrototype>();
+ if (cache.containsKey(configuration))
+ return cache.get(configuration);
+ TableViewPrototype proto = new TableViewPrototype((PapyrusTable)configuration);
+ cache.put(configuration, proto);
+ return proto;
+ }
+
+ @Override
+ public boolean isSupported(EClass type) {
+ return (type == ConfigurationPackage.eINSTANCE.getPapyrusTable());
+ }
+
+ @Override
+ public boolean isSupported(EObject view) {
+ if (!(view instanceof Table))
+ return false;
+ Table table = (Table)view;
+ return (table.getPrototype() instanceof PapyrusTable);
+ }
+
+ @Override
+ public ViewPrototype getPrototypeOf(EObject view) {
+ return getPrototypeFor((PapyrusView)((Table)view).getPrototype());
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java
new file mode 100755
index 00000000000..739ed4b040c
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.nattable.common.handlers.PolicyDefinedTableHandler;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+
+/**
+ * Represents the prototype of a table defined in a viewpoint
+ * @author Laurent Wouters
+ */
+public class TableViewPrototype extends ViewPrototype {
+ private URI configFile;
+
+ public TableViewPrototype(PapyrusTable configuration) {
+ super(configuration);
+ configFile = URI.createURI(configuration.getConfiguration());
+ }
+
+ public TableViewPrototype(PapyrusSyncTable configuration, String file) {
+ super(configuration);
+ configFile = URI.createURI(file);
+ }
+
+ @Override
+ public boolean isOwnerReassignable() {
+ return true;
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner) {
+ return instantiateOn(owner, null);
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner, String name) {
+ if (configFile == null)
+ return false;
+ PolicyDefinedTableHandler handler = new PolicyDefinedTableHandler(configFile, owner, name);
+ return handler.execute(this);
+ }
+
+ @Override
+ public Command getCommandChangeOwner(EObject view, final EObject target) {
+ final Table table = (Table)view;
+ final EObject previous = table.getOwner();
+ return new AbstractCommand("Change table owner") {
+ @Override
+ public void execute() {
+ table.setOwner(target);
+ }
+ @Override
+ public void redo() {
+ table.setOwner(previous);
+ }
+ @Override
+ protected boolean prepare() { return true; }
+ };
+ }
+
+ @Override
+ public Command getCommandChangeRoot(EObject view, final EObject target) {
+ final Table table = (Table)view;
+ final EObject previous = table.getContext();
+ return new AbstractCommand("Change table root element") {
+ @Override
+ public void execute() {
+ table.setContext(target);
+ }
+ @Override
+ public void redo() {
+ table.setContext(previous);
+ }
+ @Override
+ protected boolean prepare() { return true; }
+ };
+ }
+
+ @Override
+ public EObject getOwnerOf(EObject view) {
+ return ((Table)view).getOwner();
+ }
+
+ @Override
+ public EObject getRootOf(EObject view) {
+ return ((Table)view).getContext();
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore
index 3ae73ec801c..0157539f8c1 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore
@@ -28,6 +28,9 @@
<details key="documentation" value="The context is used for two things : &#xD;&#xA;&lt;ul> &lt;li>&quot;virtual&quot; parent to display the table in the Papyrus Model Explorer &lt;/li>&#xD;&#xA;&lt;li>container of the objects created in the table&lt;/li>&#xD;&#xA;&lt;/ul> &#xD;&#xA;The context can't be null;"/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="owner" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="prototype" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="tableConfiguration" lowerBound="1"
eType="#//nattableconfiguration/TableConfiguration">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/NattablePackage.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/NattablePackage.java
index b5cdff2b4d7..deb5ac39691 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/NattablePackage.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/NattablePackage.java
@@ -129,6 +129,24 @@ public interface NattablePackage extends EPackage {
int TABLE__CONTEXT = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Owner</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__OWNER = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Prototype</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__PROTOTYPE = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 2;
+
+ /**
* The feature id for the '<em><b>Table Configuration</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -136,7 +154,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__TABLE_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 1;
+ int TABLE__TABLE_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Invert Axis</b></em>' attribute.
@@ -146,7 +164,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__INVERT_AXIS = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 2;
+ int TABLE__INVERT_AXIS = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>Column Axis Providers History</b></em>' containment reference list.
@@ -156,7 +174,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__COLUMN_AXIS_PROVIDERS_HISTORY = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 3;
+ int TABLE__COLUMN_AXIS_PROVIDERS_HISTORY = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Row Axis Providers History</b></em>' containment reference list.
@@ -166,7 +184,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__ROW_AXIS_PROVIDERS_HISTORY = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 4;
+ int TABLE__ROW_AXIS_PROVIDERS_HISTORY = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>Local Row Header Axis Configuration</b></em>' containment reference.
@@ -176,7 +194,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 5;
+ int TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>Local Column Header Axis Configuration</b></em>' containment reference.
@@ -186,7 +204,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 6;
+ int TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 8;
/**
* The feature id for the '<em><b>Current Row Axis Provider</b></em>' reference.
@@ -196,7 +214,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__CURRENT_ROW_AXIS_PROVIDER = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 7;
+ int TABLE__CURRENT_ROW_AXIS_PROVIDER = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 9;
/**
* The feature id for the '<em><b>Current Column Axis Provider</b></em>' reference.
@@ -206,7 +224,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__CURRENT_COLUMN_AXIS_PROVIDER = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 8;
+ int TABLE__CURRENT_COLUMN_AXIS_PROVIDER = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 10;
/**
* The feature id for the '<em><b>Cells</b></em>' containment reference list.
@@ -216,7 +234,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE__CELLS = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 9;
+ int TABLE__CELLS = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 11;
/**
* The number of structural features of the '<em>Table</em>' class.
@@ -226,7 +244,7 @@ public interface NattablePackage extends EPackage {
* @generated
* @ordered
*/
- int TABLE_FEATURE_COUNT = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 10;
+ int TABLE_FEATURE_COUNT = NattableconfigurationPackage.TABLE_NAMED_ELEMENT_FEATURE_COUNT + 12;
/**
* The operation id for the '<em>Get EAnnotation</em>' operation.
@@ -273,8 +291,29 @@ public interface NattablePackage extends EPackage {
EReference getTable_Context();
/**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getTableConfiguration
- * <em>Table Configuration</em>}'.
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getOwner <em>Owner</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Owner</em>'.
+ * @see org.eclipse.papyrus.infra.nattable.model.nattable.Table#getOwner()
+ * @see #getTable()
+ * @generated
+ */
+ EReference getTable_Owner();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getPrototype <em>Prototype</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Prototype</em>'.
+ * @see org.eclipse.papyrus.infra.nattable.model.nattable.Table#getPrototype()
+ * @see #getTable()
+ * @generated
+ */
+ EReference getTable_Prototype();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getTableConfiguration <em>Table Configuration</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
@@ -437,6 +476,22 @@ public interface NattablePackage extends EPackage {
EReference TABLE__CONTEXT = eINSTANCE.getTable_Context();
/**
+ * The meta object literal for the '<em><b>Owner</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference TABLE__OWNER = eINSTANCE.getTable_Owner();
+
+ /**
+ * The meta object literal for the '<em><b>Prototype</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference TABLE__PROTOTYPE = eINSTANCE.getTable_Prototype();
+
+ /**
* The meta object literal for the '<em><b>Table Configuration</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/Table.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/Table.java
index 0694ecb41f1..fca2385350f 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/Table.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/Table.java
@@ -38,18 +38,18 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.T
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getContext <em>Context</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getTableConfiguration <em>Table Configuration</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#isInvertAxis <em>Invert Axis</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getColumnAxisProvidersHistory <em>Column Axis Providers History</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getRowAxisProvidersHistory <em>Row Axis Providers History</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getLocalRowHeaderAxisConfiguration <em>Local Row Header Axis Configuration</em>}
- * </li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getLocalColumnHeaderAxisConfiguration <em>Local Column Header Axis Configuration
- * </em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCurrentRowAxisProvider <em>Current Row Axis Provider</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCurrentColumnAxisProvider <em>Current Column Axis Provider</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCells <em>Cells</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getContext <em>Context</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getOwner <em>Owner</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getPrototype <em>Prototype</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getTableConfiguration <em>Table Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#isInvertAxis <em>Invert Axis</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getColumnAxisProvidersHistory <em>Column Axis Providers History</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getRowAxisProvidersHistory <em>Row Axis Providers History</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getLocalRowHeaderAxisConfiguration <em>Local Row Header Axis Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getLocalColumnHeaderAxisConfiguration <em>Local Column Header Axis Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCurrentRowAxisProvider <em>Current Row Axis Provider</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCurrentColumnAxisProvider <em>Current Column Axis Provider</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getCells <em>Cells</em>}</li>
* </ul>
* </p>
*
@@ -95,6 +95,58 @@ public interface Table extends TableNamedElement {
void setContext(EObject value);
/**
+ * Returns the value of the '<em><b>Owner</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Owner</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Owner</em>' reference.
+ * @see #setOwner(EObject)
+ * @see org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage#getTable_Owner()
+ * @model required="true"
+ * @generated
+ */
+ EObject getOwner();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getOwner <em>Owner</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Owner</em>' reference.
+ * @see #getOwner()
+ * @generated
+ */
+ void setOwner(EObject value);
+
+ /**
+ * Returns the value of the '<em><b>Prototype</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Prototype</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Prototype</em>' reference.
+ * @see #setPrototype(EObject)
+ * @see org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage#getTable_Prototype()
+ * @model required="true"
+ * @generated
+ */
+ EObject getPrototype();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.nattable.model.nattable.Table#getPrototype <em>Prototype</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Prototype</em>' reference.
+ * @see #getPrototype()
+ * @generated
+ */
+ void setPrototype(EObject value);
+
+ /**
* Returns the value of the '<em><b>Table Configuration</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/NattablePackageImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/NattablePackageImpl.java
index ebd416ddfe4..637253097f6 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/NattablePackageImpl.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/NattablePackageImpl.java
@@ -196,18 +196,35 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
*
* @generated
*/
- public EReference getTable_TableConfiguration() {
+ public EReference getTable_Owner() {
return (EReference)tableEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @generated
+ */
+ public EReference getTable_Prototype() {
+ return (EReference)tableEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getTable_TableConfiguration() {
+ return (EReference)tableEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EAttribute getTable_InvertAxis() {
- return (EAttribute)tableEClass.getEStructuralFeatures().get(2);
+ return (EAttribute)tableEClass.getEStructuralFeatures().get(4);
}
/**
@@ -217,7 +234,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_ColumnAxisProvidersHistory() {
- return (EReference)tableEClass.getEStructuralFeatures().get(3);
+ return (EReference)tableEClass.getEStructuralFeatures().get(5);
}
/**
@@ -227,7 +244,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_RowAxisProvidersHistory() {
- return (EReference)tableEClass.getEStructuralFeatures().get(4);
+ return (EReference)tableEClass.getEStructuralFeatures().get(6);
}
/**
@@ -237,7 +254,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_LocalRowHeaderAxisConfiguration() {
- return (EReference)tableEClass.getEStructuralFeatures().get(5);
+ return (EReference)tableEClass.getEStructuralFeatures().get(7);
}
/**
@@ -247,7 +264,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_LocalColumnHeaderAxisConfiguration() {
- return (EReference)tableEClass.getEStructuralFeatures().get(6);
+ return (EReference)tableEClass.getEStructuralFeatures().get(8);
}
/**
@@ -257,7 +274,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_CurrentRowAxisProvider() {
- return (EReference)tableEClass.getEStructuralFeatures().get(7);
+ return (EReference)tableEClass.getEStructuralFeatures().get(9);
}
/**
@@ -267,7 +284,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_CurrentColumnAxisProvider() {
- return (EReference)tableEClass.getEStructuralFeatures().get(8);
+ return (EReference)tableEClass.getEStructuralFeatures().get(10);
}
/**
@@ -277,7 +294,7 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
* @generated
*/
public EReference getTable_Cells() {
- return (EReference)tableEClass.getEStructuralFeatures().get(9);
+ return (EReference)tableEClass.getEStructuralFeatures().get(11);
}
/**
@@ -314,6 +331,8 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
// Create classes and their features
tableEClass = createEClass(TABLE);
createEReference(tableEClass, TABLE__CONTEXT);
+ createEReference(tableEClass, TABLE__OWNER);
+ createEReference(tableEClass, TABLE__PROTOTYPE);
createEReference(tableEClass, TABLE__TABLE_CONFIGURATION);
createEAttribute(tableEClass, TABLE__INVERT_AXIS);
createEReference(tableEClass, TABLE__COLUMN_AXIS_PROVIDERS_HISTORY);
@@ -381,6 +400,8 @@ public class NattablePackageImpl extends EPackageImpl implements NattablePackage
// Initialize classes, features, and operations; add parameters
initEClass(tableEClass, Table.class, "Table", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
initEReference(getTable_Context(), ecorePackage.getEObject(), null, "context", null, 1, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getTable_Owner(), ecorePackage.getEObject(), null, "owner", null, 1, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getTable_Prototype(), ecorePackage.getEObject(), null, "prototype", null, 1, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(getTable_TableConfiguration(), theNattableconfigurationPackage.getTableConfiguration(), null, "tableConfiguration", null, 1, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEAttribute(getTable_InvertAxis(), ecorePackage.getEBoolean(), "invertAxis", "false", 1, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$
initEReference(getTable_ColumnAxisProvidersHistory(), theNattableaxisproviderPackage.getAbstractAxisProvider(), null, "columnAxisProvidersHistory", null, 1, -1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/TableImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/TableImpl.java
index 91e14488181..30e3f6f3b03 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/TableImpl.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/impl/TableImpl.java
@@ -47,18 +47,18 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.i
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getContext <em>Context</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getTableConfiguration <em>Table Configuration</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#isInvertAxis <em>Invert Axis</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getColumnAxisProvidersHistory <em>Column Axis Providers History</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getRowAxisProvidersHistory <em>Row Axis Providers History</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getLocalRowHeaderAxisConfiguration <em>Local Row Header Axis
- * Configuration</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getLocalColumnHeaderAxisConfiguration <em>Local Column Header Axis
- * Configuration</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCurrentRowAxisProvider <em>Current Row Axis Provider</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCurrentColumnAxisProvider <em>Current Column Axis Provider</em>}</li>
- * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCells <em>Cells</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getContext <em>Context</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getOwner <em>Owner</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getPrototype <em>Prototype</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getTableConfiguration <em>Table Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#isInvertAxis <em>Invert Axis</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getColumnAxisProvidersHistory <em>Column Axis Providers History</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getRowAxisProvidersHistory <em>Row Axis Providers History</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getLocalRowHeaderAxisConfiguration <em>Local Row Header Axis Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getLocalColumnHeaderAxisConfiguration <em>Local Column Header Axis Configuration</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCurrentRowAxisProvider <em>Current Row Axis Provider</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCurrentColumnAxisProvider <em>Current Column Axis Provider</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.model.nattable.impl.TableImpl#getCells <em>Cells</em>}</li>
* </ul>
* </p>
*
@@ -78,6 +78,26 @@ public class TableImpl extends TableNamedElementImpl implements Table {
protected EObject context;
/**
+ * The cached value of the '{@link #getOwner() <em>Owner</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOwner()
+ * @generated
+ * @ordered
+ */
+ protected EObject owner;
+
+ /**
+ * The cached value of the '{@link #getPrototype() <em>Prototype</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrototype()
+ * @generated
+ * @ordered
+ */
+ protected EObject prototype;
+
+ /**
* The cached value of the '{@link #getTableConfiguration() <em>Table Configuration</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -253,7 +273,82 @@ public class TableImpl extends TableNamedElementImpl implements Table {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @generated
+ */
+ public EObject getOwner() {
+ if (owner != null && owner.eIsProxy()) {
+ InternalEObject oldOwner = (InternalEObject)owner;
+ owner = eResolveProxy(oldOwner);
+ if (owner != oldOwner) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NattablePackage.TABLE__OWNER, oldOwner, owner));
+ }
+ }
+ return owner;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject basicGetOwner() {
+ return owner;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOwner(EObject newOwner) {
+ EObject oldOwner = owner;
+ owner = newOwner;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NattablePackage.TABLE__OWNER, oldOwner, owner));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getPrototype() {
+ if (prototype != null && prototype.eIsProxy()) {
+ InternalEObject oldPrototype = (InternalEObject)prototype;
+ prototype = eResolveProxy(oldPrototype);
+ if (prototype != oldPrototype) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, NattablePackage.TABLE__PROTOTYPE, oldPrototype, prototype));
+ }
+ }
+ return prototype;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject basicGetPrototype() {
+ return prototype;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrototype(EObject newPrototype) {
+ EObject oldPrototype = prototype;
+ prototype = newPrototype;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, NattablePackage.TABLE__PROTOTYPE, oldPrototype, prototype));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public TableConfiguration getTableConfiguration() {
@@ -564,35 +659,37 @@ public class TableImpl extends TableNamedElementImpl implements Table {
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch(featureID) {
- case NattablePackage.TABLE__CONTEXT:
- if(resolve)
- return getContext();
- return basicGetContext();
- case NattablePackage.TABLE__TABLE_CONFIGURATION:
- if(resolve)
- return getTableConfiguration();
- return basicGetTableConfiguration();
- case NattablePackage.TABLE__INVERT_AXIS:
- return isInvertAxis();
- case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
- return getColumnAxisProvidersHistory();
- case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
- return getRowAxisProvidersHistory();
- case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
- return getLocalRowHeaderAxisConfiguration();
- case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
- return getLocalColumnHeaderAxisConfiguration();
- case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
- if(resolve)
- return getCurrentRowAxisProvider();
- return basicGetCurrentRowAxisProvider();
- case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
- if(resolve)
- return getCurrentColumnAxisProvider();
- return basicGetCurrentColumnAxisProvider();
- case NattablePackage.TABLE__CELLS:
- return getCells();
+ switch (featureID) {
+ case NattablePackage.TABLE__CONTEXT:
+ if (resolve) return getContext();
+ return basicGetContext();
+ case NattablePackage.TABLE__OWNER:
+ if (resolve) return getOwner();
+ return basicGetOwner();
+ case NattablePackage.TABLE__PROTOTYPE:
+ if (resolve) return getPrototype();
+ return basicGetPrototype();
+ case NattablePackage.TABLE__TABLE_CONFIGURATION:
+ if (resolve) return getTableConfiguration();
+ return basicGetTableConfiguration();
+ case NattablePackage.TABLE__INVERT_AXIS:
+ return isInvertAxis();
+ case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
+ return getColumnAxisProvidersHistory();
+ case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
+ return getRowAxisProvidersHistory();
+ case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
+ return getLocalRowHeaderAxisConfiguration();
+ case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
+ return getLocalColumnHeaderAxisConfiguration();
+ case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
+ if (resolve) return getCurrentRowAxisProvider();
+ return basicGetCurrentRowAxisProvider();
+ case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
+ if (resolve) return getCurrentColumnAxisProvider();
+ return basicGetCurrentColumnAxisProvider();
+ case NattablePackage.TABLE__CELLS:
+ return getCells();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -606,40 +703,46 @@ public class TableImpl extends TableNamedElementImpl implements Table {
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
- switch(featureID) {
- case NattablePackage.TABLE__CONTEXT:
- setContext((EObject)newValue);
- return;
- case NattablePackage.TABLE__TABLE_CONFIGURATION:
- setTableConfiguration((TableConfiguration)newValue);
- return;
- case NattablePackage.TABLE__INVERT_AXIS:
- setInvertAxis((Boolean)newValue);
- return;
- case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
- getColumnAxisProvidersHistory().clear();
- getColumnAxisProvidersHistory().addAll((Collection<? extends AbstractAxisProvider>)newValue);
- return;
- case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
- getRowAxisProvidersHistory().clear();
- getRowAxisProvidersHistory().addAll((Collection<? extends AbstractAxisProvider>)newValue);
- return;
- case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
- setLocalRowHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)newValue);
- return;
- case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
- setLocalColumnHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)newValue);
- return;
- case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
- setCurrentRowAxisProvider((AbstractAxisProvider)newValue);
- return;
- case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
- setCurrentColumnAxisProvider((AbstractAxisProvider)newValue);
- return;
- case NattablePackage.TABLE__CELLS:
- getCells().clear();
- getCells().addAll((Collection<? extends Cell>)newValue);
- return;
+ switch (featureID) {
+ case NattablePackage.TABLE__CONTEXT:
+ setContext((EObject)newValue);
+ return;
+ case NattablePackage.TABLE__OWNER:
+ setOwner((EObject)newValue);
+ return;
+ case NattablePackage.TABLE__PROTOTYPE:
+ setPrototype((EObject)newValue);
+ return;
+ case NattablePackage.TABLE__TABLE_CONFIGURATION:
+ setTableConfiguration((TableConfiguration)newValue);
+ return;
+ case NattablePackage.TABLE__INVERT_AXIS:
+ setInvertAxis((Boolean)newValue);
+ return;
+ case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
+ getColumnAxisProvidersHistory().clear();
+ getColumnAxisProvidersHistory().addAll((Collection<? extends AbstractAxisProvider>)newValue);
+ return;
+ case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
+ getRowAxisProvidersHistory().clear();
+ getRowAxisProvidersHistory().addAll((Collection<? extends AbstractAxisProvider>)newValue);
+ return;
+ case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
+ setLocalRowHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)newValue);
+ return;
+ case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
+ setLocalColumnHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)newValue);
+ return;
+ case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
+ setCurrentRowAxisProvider((AbstractAxisProvider)newValue);
+ return;
+ case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
+ setCurrentColumnAxisProvider((AbstractAxisProvider)newValue);
+ return;
+ case NattablePackage.TABLE__CELLS:
+ getCells().clear();
+ getCells().addAll((Collection<? extends Cell>)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -652,37 +755,43 @@ public class TableImpl extends TableNamedElementImpl implements Table {
*/
@Override
public void eUnset(int featureID) {
- switch(featureID) {
- case NattablePackage.TABLE__CONTEXT:
- setContext((EObject)null);
- return;
- case NattablePackage.TABLE__TABLE_CONFIGURATION:
- setTableConfiguration((TableConfiguration)null);
- return;
- case NattablePackage.TABLE__INVERT_AXIS:
- setInvertAxis(INVERT_AXIS_EDEFAULT);
- return;
- case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
- getColumnAxisProvidersHistory().clear();
- return;
- case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
- getRowAxisProvidersHistory().clear();
- return;
- case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
- setLocalRowHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)null);
- return;
- case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
- setLocalColumnHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)null);
- return;
- case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
- setCurrentRowAxisProvider((AbstractAxisProvider)null);
- return;
- case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
- setCurrentColumnAxisProvider((AbstractAxisProvider)null);
- return;
- case NattablePackage.TABLE__CELLS:
- getCells().clear();
- return;
+ switch (featureID) {
+ case NattablePackage.TABLE__CONTEXT:
+ setContext((EObject)null);
+ return;
+ case NattablePackage.TABLE__OWNER:
+ setOwner((EObject)null);
+ return;
+ case NattablePackage.TABLE__PROTOTYPE:
+ setPrototype((EObject)null);
+ return;
+ case NattablePackage.TABLE__TABLE_CONFIGURATION:
+ setTableConfiguration((TableConfiguration)null);
+ return;
+ case NattablePackage.TABLE__INVERT_AXIS:
+ setInvertAxis(INVERT_AXIS_EDEFAULT);
+ return;
+ case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
+ getColumnAxisProvidersHistory().clear();
+ return;
+ case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
+ getRowAxisProvidersHistory().clear();
+ return;
+ case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
+ setLocalRowHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)null);
+ return;
+ case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
+ setLocalColumnHeaderAxisConfiguration((LocalTableHeaderAxisConfiguration)null);
+ return;
+ case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
+ setCurrentRowAxisProvider((AbstractAxisProvider)null);
+ return;
+ case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
+ setCurrentColumnAxisProvider((AbstractAxisProvider)null);
+ return;
+ case NattablePackage.TABLE__CELLS:
+ getCells().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -695,27 +804,31 @@ public class TableImpl extends TableNamedElementImpl implements Table {
*/
@Override
public boolean eIsSet(int featureID) {
- switch(featureID) {
- case NattablePackage.TABLE__CONTEXT:
- return context != null;
- case NattablePackage.TABLE__TABLE_CONFIGURATION:
- return tableConfiguration != null;
- case NattablePackage.TABLE__INVERT_AXIS:
- return invertAxis != INVERT_AXIS_EDEFAULT;
- case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
- return columnAxisProvidersHistory != null && !columnAxisProvidersHistory.isEmpty();
- case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
- return rowAxisProvidersHistory != null && !rowAxisProvidersHistory.isEmpty();
- case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
- return localRowHeaderAxisConfiguration != null;
- case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
- return localColumnHeaderAxisConfiguration != null;
- case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
- return currentRowAxisProvider != null;
- case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
- return currentColumnAxisProvider != null;
- case NattablePackage.TABLE__CELLS:
- return cells != null && !cells.isEmpty();
+ switch (featureID) {
+ case NattablePackage.TABLE__CONTEXT:
+ return context != null;
+ case NattablePackage.TABLE__OWNER:
+ return owner != null;
+ case NattablePackage.TABLE__PROTOTYPE:
+ return prototype != null;
+ case NattablePackage.TABLE__TABLE_CONFIGURATION:
+ return tableConfiguration != null;
+ case NattablePackage.TABLE__INVERT_AXIS:
+ return invertAxis != INVERT_AXIS_EDEFAULT;
+ case NattablePackage.TABLE__COLUMN_AXIS_PROVIDERS_HISTORY:
+ return columnAxisProvidersHistory != null && !columnAxisProvidersHistory.isEmpty();
+ case NattablePackage.TABLE__ROW_AXIS_PROVIDERS_HISTORY:
+ return rowAxisProvidersHistory != null && !rowAxisProvidersHistory.isEmpty();
+ case NattablePackage.TABLE__LOCAL_ROW_HEADER_AXIS_CONFIGURATION:
+ return localRowHeaderAxisConfiguration != null;
+ case NattablePackage.TABLE__LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION:
+ return localColumnHeaderAxisConfiguration != null;
+ case NattablePackage.TABLE__CURRENT_ROW_AXIS_PROVIDER:
+ return currentRowAxisProvider != null;
+ case NattablePackage.TABLE__CURRENT_COLUMN_AXIS_PROVIDER:
+ return currentColumnAxisProvider != null;
+ case NattablePackage.TABLE__CELLS:
+ return cells != null && !cells.isEmpty();
}
return super.eIsSet(featureID);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
index e5016117c69..40fa0e961b7 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
@@ -12,7 +12,14 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.gmf.runtime.emf.type.core,
- org.eclipse.core.expressions
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.query.java.core,
+ org.eclipse.papyrus.emf.facet.efacet,
+ org.eclipse.papyrus.emf.facet.efacet.metamodel,
+ org.eclipse.papyrus.emf.facet.custom.metamodel,
+ org.eclipse.papyrus.emf.facet.util.emf.ui,
+ org.eclipse.papyrus.emf.facet.custom.ui
Export-Package: org.eclipse.papyrus.infra.nattable.modelexplorer,
org.eclipse.papyrus.infra.nattable.modelexplorer.handlers,
org.eclipse.papyrus.infra.nattable.modelexplorer.messages,
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
index 67dca5e4697..917ae285f4c 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
@@ -1,21 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <!-- TODO: EMF-FACET update uicustom and queries
- <extension point="org.eclipse.papyrus.emf.facet.infra.query.registration">
- <modelqueryset file="resources/PapyrusTablesFacet.querySet">
- </modelqueryset>
+ <extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration file="resources/PapyrusTable.custom"/>
</extension>
- <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization file="resources/PapyrusTables.uiCustom" loadByDefault="true"/>
- </extension>
- <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization file="resources/PapyrusTablesFacet.uiCustom" loadByDefault="true"/>
- </extension>
- <extension point="org.eclipse.papyrus.emf.facet.infra.facet.registration">
- <facetset file="resources/PapyrusTablesFacet.facetSet">
- </facetset>
- </extension-->
<extension point="org.eclipse.ui.handlers">
<handler class="org.eclipse.papyrus.infra.nattable.modelexplorer.handlers.RenameTableHandler" commandId="org.eclipse.ui.edit.rename">
<activeWhen>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom
new file mode 100755
index 00000000000..591f2c9a5c1
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<custom:Customization xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:custom="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="PapyrusTable" documentation="Display contained table and their icons" mustBeLoadedByDefault="true">
+ <eClassifiers xsi:type="custom:EClassCustomization" name="Table" documentation="Representation of table in model explorer">
+ <extendedMetaclass href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <facetOperations name="GetTableIcon" documentation="Return the path to the icon of the corresponding table">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
+ <eParameters name="eObject">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetTableIcon"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
+ </facetOperations>
+ <facetOperations name="NotVisibleStructuralFeature">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.NotVisibleStructuralFeatureQuery"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="EObject" documentation="representation around EObject displayed in model explorer">
+ <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetElements xsi:type="efacet:FacetReference" name="tables" upperBound="-1" defaultValueLiteral="" derived="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <query xsi:type="query:OperationCallQuery" operation="//EObject/TablesRefContent"/>
+ </facetElements>
+ <facetOperations name="TablesRefVisibility" documentation="Return true if the element contains tables">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.IsTableContainer"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ </facetOperations>
+ <facetOperations name="TablesRefContent" upperBound="-1" documentation="Get the collection of all contained tables">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetContainedTables"/>
+ </facetOperations>
+ <facetOperations name="TablesRefCollapse">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.TablesRefCollapseQuery"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ </facetOperations>
+ </eClassifiers>
+</custom:Customization>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom
deleted file mode 100644
index 06f1cb76e98..00000000000
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8"
- metamodelURI="http://www.eclipse.org/papyrus/nattable/model">
- <types metaclassName="nattable.Table">
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="eAnnotations">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="tableConfiguration">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="columnAxisProvidersHistory">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="rowAxisProvidersHistory">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="localRowHeaderAxisConfiguration">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="localColumnHeaderAxisConfiguration">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="currentColumnAxisProvider">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="currentRowAxisProvider">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- <references referenceName="cells">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue"
- value="false" />
- </customizedFeatures>
- </references>
- </types>
-</uicustom:MetamodelView>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet
deleted file mode 100644
index bbca3816dbc..00000000000
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<facet:FacetSet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:facet="http://www.eclipse.org/EmfFacet/infra/facet/0.8.incubation" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusTablesFacet" nsURI="http://org.eclipse.org/papyrus/tables/modelExplorer/Facet" nsPrefix="PapyrusTablesFacet">
- <eClassifiers xsi:type="facet:Facet" name="TableContainer" abstract="true">
- <eSuperTypes href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- <eStructuralFeatures xsi:type="facet:FacetReference" name="tables" upperBound="-1" volatile="true" unsettable="true">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
- <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#GetContainedTables"></valueQuery>
- </eStructuralFeatures>
- <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#IsTableContainer"/>
- </eClassifiers>
- <extendedPackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
-</facet:FacetSet>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet
deleted file mode 100644
index 2b220c97629..00000000000
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusTablesFacet" description="A set of queries to manage the tables in the ModelExplorer">
- <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
- <associatedMetamodels href="http://www.eclipse.org/papyrus/nattable/model#/"/>
- <queries xsi:type="query:JavaModelQuery" name="IsTableContainer" description="Return true if the element contains tables" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.IsTableContainer">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="GetContainedTables" description="Get the collection of all contained tables" upperBound="-1" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetContainedTables">
- <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
- <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </queries>
-</query:ModelQuerySet>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom
deleted file mode 100644
index 4149fcb9fe5..00000000000
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://org.eclipse.org/papyrus/tables/modelExplorer/Facet">
- <types metaclassName="PapyrusTablesFacet.TableContainer">
- <references referenceName="tables">
- <customizedFeatures>
- <valueCases>
- <value xsi:type="uicustom:StaticFeatureValue" value="false"/>
- <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#IsTableContainer"/>
- </valueCases>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- <customizedFeatures customizedFeature="collapseLink">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- </references>
- </types>
-</uicustom:MetamodelView>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
index b493d924f04..23bef143690 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
@@ -11,28 +11,39 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
-//TODO: EMF-FACET update query
-/** Get the collection of all contained tables */
-public class GetContainedTables {/*
- extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<Table>> {
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+/** Get the collection of all contained tables */
+public class GetContainedTables extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Collection<Table>> {
- @Override
- public Collection<Table> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ public Collection<Table> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
List<Table> result = new ArrayList<Table>();
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
if(roots == null) {
return result;
}
while(roots.hasNext()) {
EObject root = roots.next();
- if(root instanceof Table) {
- if(EcoreUtil.equals(((Table)root).getContext(), context)) {
- result.add((Table)root);
+ if (root instanceof Table) {
+ if (EcoreUtil.equals(((Table) root).getOwner(), source)) {
+ result.add((Table) root);
}
}
}
return result;
- }**/
-}
+ }
+} \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
new file mode 100755
index 00000000000..56ebeb5a228
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
+
+import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
+import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
+
+/** Return the path to the icon of the corresponding table */
+public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaQuery2<Table, IImage> {
+
+ public IImage evaluate(Table source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ ViewPrototype prototype = ViewPrototype.get((PapyrusView) source.getPrototype());
+ return ImageUtils.wrap(prototype.getIconURI());
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
index 25b549ed7ca..f878ddf7ba4 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
@@ -1,42 +1,58 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+/**
+ * Copyright (c) 2011 Atos.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
*
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
- *****************************************************************************/
+ */
package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
-//TODO: EMF-FACET update query
-public class IsTableContainer {/*extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
-*/
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+public class IsTableContainer extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
+
/**
- * Return true if the element is a Diagram Container
+ * Return true if the element is a Table Container
*/
- /*@Override
- public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
- if(roots == null) {
- return false;
- }
- while(roots.hasNext()) {
- EObject root = roots.next();
- if(root instanceof Table) {
- if(EcoreUtil.equals(((Table)root).getContext(), context)) {
- return true;
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ ParameterValue parameterValue = (ParameterValue) parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature = (EStructuralFeature) parameterValue.getValue();
+ if ((eStructuralFeature instanceof FacetReference) && ("diagrams".equals((eStructuralFeature).getName()))) {
+
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
+ if (roots == null) {
+ return false;
+ }
+
+ while (roots.hasNext()) {
+ EObject root = roots.next();
+ if (root instanceof Table) {
+ if (EcoreUtil.equals(((Table) root).getOwner(), source)) {
+ return true;
+ }
}
}
+ return false;
}
- return false;
- }*/
-}
+ return true;
+ }
+} \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java
new file mode 100755
index 00000000000..bcc10cbf657
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+
+public class NotVisibleStructuralFeatureQuery implements IJavaQuery2<Table, Boolean> {
+ public Boolean evaluate(final Table context,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+ //if eStructural feature ==null this is root model explorer.
+ //border effect of this kind of queries
+ if (eStructuralFeature==null){
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java
new file mode 100755
index 00000000000..6560c8c3a64
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+
+public class TablesRefCollapseQuery implements IJavaQuery2<EObject, Boolean> {
+ public Boolean evaluate(final EObject context,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+ if((eStructuralFeature instanceof FacetReference)&&("diagrams".equals((eStructuralFeature).getName()))){
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/META-INF/MANIFEST.MF
index d81c9ac5b1d..0915962a3f9 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/META-INF/MANIFEST.MF
@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
org.eclipse.nebula.widgets.nattable.core;bundle-version="1.0.0",
org.eclipse.emf.databinding,
- org.eclipse.core.databinding.property;bundle-version="1.4.200"
+ org.eclipse.core.databinding.property;bundle-version="1.4.200",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.infra.nattable.properties.constrai
nts
Bundle-Vendor: %Bundle-Vendor
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
index 59f4909fe18..a992fe52044 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
@@ -12,12 +12,10 @@
</Composite.layout>
<ppe:StringEditor input="{Binding}"
property="nattable:nattableconfiguration:TableNamedElement:name"></ppe:StringEditor>
- <ppe:ReferenceLabel input="{Binding}" property="nattable:Table:context"
- readOnly="true"></ppe:ReferenceLabel>
+ <ppe:ReferenceLabel input="{Binding}" property="nattable:Table:prototype" readOnly="true" customLabel="View Type"></ppe:ReferenceLabel>
+ <ppe:ReferenceLabel input="{Binding}" property="nattable:Table:owner" readOnly="true" customLabel="Owner"></ppe:ReferenceLabel>
+ <ppe:ReferenceDialog input="{Binding}" property="nattable:Table:context" customLabel="Root element"></ppe:ReferenceDialog>
<ppe:BooleanRadio input="{Binding}" property="nattable:Table:invertAxis"></ppe:BooleanRadio>
- <ppe:StringEditor input="{Binding}"
- property="nattable:Table:tableConfiguration.type" readOnly="true"
- customLabel="Type"></ppe:StringEditor>
</Composite>
<Composite>
<Composite.layout>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
index 65c431481cb..00ec6b126ea 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
@@ -23,8 +23,11 @@ import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage;
@@ -67,13 +70,17 @@ import org.eclipse.papyrus.infra.nattable.properties.observable.RowPasteObjectPo
import org.eclipse.papyrus.infra.nattable.properties.provider.ColumnContainmentFeatureContentProvider;
import org.eclipse.papyrus.infra.nattable.properties.provider.ColumnElementTypeIdContentProvider;
import org.eclipse.papyrus.infra.nattable.properties.provider.ColumnPostActionIdsProvider;
+import org.eclipse.papyrus.infra.nattable.properties.provider.ContextFeatureContentProvider;
import org.eclipse.papyrus.infra.nattable.properties.provider.RowContainmentFeatureContentProvider;
import org.eclipse.papyrus.infra.nattable.properties.provider.RowElementTypeIdContentProvider;
import org.eclipse.papyrus.infra.nattable.properties.provider.RowPostActionIdsProvider;
import org.eclipse.papyrus.infra.nattable.properties.utils.Constants;
import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
@@ -143,6 +150,9 @@ public class NatTableModelElement extends EMFModelElement {
tableModelManager = new NattableModelManager(getEditedTable());
this.observableValues = new HashMap<String, IObservable>();
this.interestingFeatures = new ArrayList<EStructuralFeature>();
+ interestingFeatures.add(NattablePackage.eINSTANCE.getTable_Prototype());
+ interestingFeatures.add(NattablePackage.eINSTANCE.getTable_Owner());
+ interestingFeatures.add(NattablePackage.eINSTANCE.getTable_Context());
interestingFeatures.add(NattablePackage.eINSTANCE.getTable_InvertAxis());
interestingFeatures.add(NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration());
interestingFeatures.add(NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration());
@@ -505,7 +515,10 @@ public class NatTableModelElement extends EMFModelElement {
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
IStaticContentProvider provider = null;
- if(Constants.ROW_PASTED_EOBJECT_CONTAINMENT_FEATURE.equals(propertyPath)) {
+ if(Constants.TABLE_CONTEXT.equals(propertyPath)) {
+ Table table = getEditedTable();
+ provider = new ContextFeatureContentProvider(table, getRoot(table.getContext()));
+ } else if(Constants.ROW_PASTED_EOBJECT_CONTAINMENT_FEATURE.equals(propertyPath)) {
provider = new RowContainmentFeatureContentProvider(getEditedTable());
} else if(Constants.COLUMN_PASTED_EOBJECT_CONTAINMENT_FEATURE.equals(propertyPath)) {
provider = new ColumnContainmentFeatureContentProvider(getEditedTable());
@@ -558,4 +571,39 @@ public class NatTableModelElement extends EMFModelElement {
return super.isOrdered(propertyPath);
}
+ @Override
+ public ILabelProvider getLabelProvider(String propertyPath) {
+ if (propertyPath.endsWith("prototype")) {
+ return new ILabelProvider() {
+ public void addListener(ILabelProviderListener listener) { }
+ public void removeListener(ILabelProviderListener listener) { }
+ public void dispose() { }
+ public boolean isLabelProperty(Object element, String property) { return false; }
+ public Image getImage(Object element) {
+ ViewPrototype proto = ViewPrototype.get((PapyrusView)element);
+ return proto.getIcon();
+ }
+ public String getText(Object element) {
+ ViewPrototype proto = ViewPrototype.get((PapyrusView)element);
+ return proto.getQualifiedName();
+ }
+ };
+ }
+ return super.getLabelProvider(propertyPath);
+ }
+
+ /**
+ * Gets the root EObject from the given one
+ * @param obj An object
+ * @return The root object which is an ancestor of the given one
+ */
+ private EObject getRoot(EObject obj) {
+ EObject current = obj;
+ EObject parent = obj.eContainer();
+ while (parent != null) {
+ current = parent;
+ parent = parent.eContainer();
+ }
+ return current;
+ }
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/provider/ContextFeatureContentProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/provider/ContextFeatureContentProvider.java
new file mode 100755
index 00000000000..52b64030bb6
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/provider/ContextFeatureContentProvider.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.properties.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ui.ECoreModelContentProvider;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+/**
+ * Represents a simple ECore model content provider for the selection of a table's root model element
+ * @author Laurent Wouters
+ */
+public class ContextFeatureContentProvider extends ECoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider {
+ /**
+ * The diagram
+ */
+ private Table table;
+
+ /**
+ * Initializes the provider with the given root
+ * @param diagram The diagram for which a root model element is to be provided
+ * @param root The root object
+ */
+ public ContextFeatureContentProvider(Table table, EObject root) {
+ super(root);
+ this.table = table;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider#getElements()
+ */
+ public Object[] getElements() {
+ return getElements(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(java.lang.Object)
+ */
+ public boolean isValidValue(Object element) {
+ if (element == null)
+ return false;
+ if (!(element instanceof EObject))
+ return false;
+ ViewPrototype prototype = ViewPrototype.get((PapyrusView)table.getPrototype());
+ if (prototype == null)
+ return false;
+ return PolicyChecker.getCurrent().canHaveNewView((EObject)element, table.getOwner(), prototype);
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/utils/Constants.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/utils/Constants.java
index 8d2e7a4e390..a8ebc6dcc30 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/utils/Constants.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/utils/Constants.java
@@ -25,6 +25,8 @@ public class Constants {
//to prevent instanciation
}
+
+ public static final String TABLE_CONTEXT = "context"; //$NON-NLS-1$
public static final String LOCAL_COLUMN_HEADER_AXIS_CONFIGURATION_DISPLAY_LABEL = "localColumnHeaderAxisConfiguration.displayLabel"; //$NON-NLS-1$
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
index e6fc4ce7a79..27149ed7454 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
@@ -50,7 +50,8 @@
<extension
point="org.eclipse.papyrus.infra.nattable.configuration">
<configuration
- file="resources/viewpage.nattableconfiguration">
+ file="resources/viewpage.nattableconfiguration"
+ type="PapyrusViewsTable">
</configuration>
</extension>
</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
index 452a5493cef..64e206fa600 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
@@ -60,59 +60,6 @@
</handler>
</extension>
<extension
- id="create.table.menus"
- name="Create Table Menus"
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.infra.nattable.popupmenu.createnattable">
- <command
- commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- style="push">
- <visibleWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- allPopups="false"
- locationURI="menu:org.eclipse.papyrus.infra.nattable.menu.createnattable">
- <command
- commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- style="push">
- <visibleWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- allPopups="false"
- locationURI="toolbar:org.eclipse.papyrus.infra.nattable.toolbar.createnattable">
- <command
- commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- style="push">
- <visibleWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
- <extension
point="org.eclipse.ui.commandImages">
<image
commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd
index 6aa249e6641..e2551c85634 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd
@@ -64,6 +64,13 @@
</appinfo>
</annotation>
</attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique type identifier of the table as a string
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
index f0b94ae6f9f..f82fa9011f4 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.emf.transaction,
org.eclipse.gef,
+ org.eclipse.gmf.runtime.notation.edit,
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.eclipse.ui,
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.classpath b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.classpath
new file mode 100755
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.project b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.project
new file mode 100755
index 00000000000..0e3aaf843fb
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.viewpoints.configuration.edit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/META-INF/MANIFEST.MF b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/META-INF/MANIFEST.MF
new file mode 100755
index 00000000000..29a1b9941f0
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.viewpoints.configuration.edit;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.viewpoints.configuration.provider.ConfigurationEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.viewpoints.configuration.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.edit,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.edit,
+ org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.iso42010;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.iso42010.edit;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/about.html b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/about.html
new file mode 100755
index 00000000000..dd02e0be168
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/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>December 2, 2009</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/build.properties b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/build.properties
new file mode 100755
index 00000000000..9811208ae02
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/build.properties
@@ -0,0 +1,12 @@
+#
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreateChildRule_insertionPath_PathElement.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreateChildRule_insertionPath_PathElement.png
new file mode 100755
index 00000000000..298c65024cb
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreateChildRule_insertionPath_PathElement.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_childRules_ChildRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_childRules_ChildRule.png
new file mode 100755
index 00000000000..8e4881ab36f
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_childRules_ChildRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_paletteRules_PaletteRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_paletteRules_PaletteRule.png
new file mode 100755
index 00000000000..9cbe852aee8
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusDiagram_paletteRules_PaletteRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_modelRules_ModelRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_modelRules_ModelRule.png
new file mode 100755
index 00000000000..3be5941ebc8
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_modelRules_ModelRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_owningRules_OwningRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_owningRules_OwningRule.png
new file mode 100755
index 00000000000..f8826cd1b04
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/ctool16/CreatePapyrusView_owningRules_OwningRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ChildRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ChildRule.png
new file mode 100755
index 00000000000..f521e24194f
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ChildRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ElementImport.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ElementImport.png
new file mode 100755
index 00000000000..4874c9a4bda
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ElementImport.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.png
new file mode 100755
index 00000000000..b2ed7ef1f5c
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.png
new file mode 100755
index 00000000000..b24525e0564
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PaletteRule.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PaletteRule.png
new file mode 100755
index 00000000000..702ce3268db
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PaletteRule.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusConfiguration.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusConfiguration.png
new file mode 100755
index 00000000000..3b2678c6fc5
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusConfiguration.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusDiagram.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusDiagram.png
new file mode 100755
index 00000000000..84904512460
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusDiagram.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusSyncTable.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusSyncTable.png
new file mode 100755
index 00000000000..e8e0a707a3c
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusSyncTable.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusTable.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusTable.png
new file mode 100755
index 00000000000..0130d061f42
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusTable.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.png
new file mode 100755
index 00000000000..6a02a48333d
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.png
new file mode 100755
index 00000000000..a4674477cc9
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PathElement.png b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PathElement.png
new file mode 100755
index 00000000000..fbf0306e6f0
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PathElement.png
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.properties b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.properties
new file mode 100755
index 00000000000..6c33b907a74
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.properties
@@ -0,0 +1,91 @@
+##########################################################################################
+# Copyright (c) 2013 CEA LIST.
+#
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation
+#
+########################################################################################
+
+pluginName = Papyrus Viewpoints Configuration - Edit (Incubation)
+providerName = Eclipse Modeling Project
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_PapyrusConfiguration_type = Papyrus Configuration
+_UI_PapyrusViewpoint_type = Papyrus Viewpoint
+_UI_PapyrusView_type = Papyrus View
+_UI_PapyrusDiagram_type = Papyrus Diagram
+_UI_DiagramCreationRule_type = Diagram Creation Rule
+_UI_ModelRule_type = Model Rule
+_UI_PaletteRule_type = Palette Rule
+_UI_Rule_type = Rule
+_UI_PathElement_type = Path Element
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_PapyrusConfiguration_defaultStakeholder_feature = Default Stakeholder
+_UI_PapyrusConfiguration_metamodel_feature = Metamodel
+_UI_PapyrusViewpoint_parent_feature = Parent
+_UI_PapyrusDiagram_creationRules_feature = Creation Rules
+_UI_PapyrusDiagram_modelRules_feature = Model Rules
+_UI_PapyrusDiagram_paletteRules_feature = Palette Rules
+_UI_DiagramCreationRule_element_feature = Element
+_UI_DiagramCreationRule_multiplicity_feature = Multiplicity
+_UI_ModelRule_element_feature = Element
+_UI_ModelRule_origin_feature = Origin
+_UI_ModelRule_insertionPath_feature = Insertion Path
+_UI_PaletteRule_element_feature = Element
+_UI_Rule_permit_feature = Permit
+_UI_PathElement_feature_feature = Feature
+_UI_PathElement_origin_feature = Origin
+_UI_PathElement_target_feature = Target
+_UI_Unknown_feature = Unspecified
+
+_UI_OwningRule_type = Owning Rule
+_UI_ChildRule_type = Child Rule
+_UI_PapyrusView_modelRules_feature = Model Rules
+_UI_PapyrusView_owningRules_feature = Owning Rules
+_UI_PapyrusDiagram_childRules_feature = Child Rules
+_UI_ModelRule_multiplicity_feature = Multiplicity
+_UI_OwningRule_element_feature = Element
+_UI_OwningRule_multiplicity_feature = Multiplicity
+_UI_ChildRule_element_feature = Element
+_UI_ChildRule_origin_feature = Origin
+_UI_ChildRule_insertionPath_feature = Insertion Path
+_UI_PapyrusView_implementationID_feature = Implementation ID
+_UI_PapyrusView_parent_feature = Parent
+_UI_PapyrusConfiguration_profiles_feature = Profiles
+_UI_PapyrusView_icon_feature = Icon
+_UI_ModelRule_stereotypes_feature = Stereotypes
+_UI_OwningRule_stereotypes_feature = Stereotypes
+_UI_ChildRule_stereotypes_feature = Stereotypes
+_UI_PapyrusView_profiles_feature = Profiles
+_UI_PapyrusSyncTable_type = Papyrus Sync Table
+_UI_PapyrusTable_type = Papyrus Table
+_UI_PapyrusTable_configuration_feature = Configuration
+_UI_PapyrusDiagram_customPalette_feature = Custom Palette
+_UI_PapyrusDiagram_customStyle_feature = Custom Style
+_UI_PapyrusView_category_feature = Category
+_UI_Category_type = View Category
+_UI_PapyrusView_categories_feature = Categories
+_UI_Category_name_feature = Name
+_UI_PapyrusConfiguration_categories_feature = View Categories
+_UI_ElementImport_type = Element Import
+_UI_PapyrusDiagram_imports_feature = Imports
+_UI_ElementImport_from_feature = From
+_UI_ElementImport_element_feature = Element
+_UI_ModelRule_autoSelectPath_feature = Auto Select Path
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.xml b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.xml
new file mode 100755
index 00000000000..17fa9cd3c33
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/plugin.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated configuration -->
+ <factory
+ uri="http://www.eclipse.org/papyrus/infra/viewpoints/configuration"
+ class="org.eclipse.papyrus.infra.viewpoints.configuration.provider.ConfigurationItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/CategoryItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/CategoryItemProvider.java
new file mode 100755
index 00000000000..7a43e8a0bbc
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/CategoryItemProvider.java
@@ -0,0 +1,169 @@
+/**
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.papyrus.infra.viewpoints.configuration.Category;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.Category} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CategoryItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CategoryItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Category_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Category_name_feature", "_UI_Category_type"),
+ ConfigurationPackage.Literals.CATEGORY__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Category.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusView.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Category)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Category_type") :
+ getString("_UI_Category_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Category.class)) {
+ case ConfigurationPackage.CATEGORY__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ChildRuleItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ChildRuleItemProvider.java
new file mode 100755
index 00000000000..503a4ab8c83
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ChildRuleItemProvider.java
@@ -0,0 +1,248 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ChildRule;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EClassPropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.StereotypePropertyDescriptor;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ChildRule} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ChildRuleItemProvider
+ extends RuleItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChildRuleItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addElementPropertyDescriptor(object);
+ addStereotypesPropertyDescriptor(object);
+ addOriginPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EClassPropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ChildRule_element_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ChildRule_element_feature", "_UI_ChildRule_type"),
+ ConfigurationPackage.Literals.CHILD_RULE__ELEMENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Stereotypes feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addStereotypesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new StereotypePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ChildRule_stereotypes_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ChildRule_stereotypes_feature", "_UI_ChildRule_type"),
+ ConfigurationPackage.Literals.CHILD_RULE__STEREOTYPES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Origin feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOriginPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EClassPropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ChildRule_origin_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ChildRule_origin_feature", "_UI_ChildRule_type"),
+ ConfigurationPackage.Literals.CHILD_RULE__ORIGIN,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(ConfigurationPackage.Literals.CHILD_RULE__INSERTION_PATH);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns ChildRule.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ChildRule.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ ChildRule rule = (ChildRule) object;
+ StringBuilder builder = new StringBuilder("[");
+ builder.append(rule.getOrigin() != null ? rule.getOrigin().getName() : "#");
+ builder.append("] add: ");
+ if (!rule.getStereotypes().isEmpty()) {
+ builder.append("<<");
+ for (int i = 0; i != rule.getStereotypes().size(); i++) {
+ if (i != 0)
+ builder.append(",");
+ builder.append(rule.getStereotypes().get(i).getName());
+ }
+ builder.append(">> ");
+ }
+ builder.append(rule.getElement() != null ? rule.getElement().getName() : "#");
+ builder.append(" => ");
+ builder.append(rule.isPermit() ? "allow" : "deny");
+ return builder.toString();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ChildRule.class)) {
+ case ConfigurationPackage.CHILD_RULE__INSERTION_PATH:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.CHILD_RULE__INSERTION_PATH,
+ ConfigurationFactory.eINSTANCE.createPathElement()));
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationEditPlugin.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationEditPlugin.java
new file mode 100755
index 00000000000..94da80deb98
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationEditPlugin.java
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+
+import org.eclipse.papyrus.infra.viewpoints.iso42010.provider.Iso42010EditPlugin;
+
+/**
+ * This is the central singleton for the Configuration edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class ConfigurationEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final ConfigurationEditPlugin INSTANCE = new ConfigurationEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ConfigurationEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ EcoreEditPlugin.INSTANCE,
+ Iso42010EditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationItemProviderAdapterFactory.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationItemProviderAdapterFactory.java
new file mode 100755
index 00000000000..3414bf305eb
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ConfigurationItemProviderAdapterFactory.java
@@ -0,0 +1,498 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.eclipse.papyrus.infra.viewpoints.configuration.util.ConfigurationAdapterFactory;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ConfigurationItemProviderAdapterFactory extends ConfigurationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ConfigurationItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusConfigurationItemProvider papyrusConfigurationItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusConfigurationAdapter() {
+ if (papyrusConfigurationItemProvider == null) {
+ papyrusConfigurationItemProvider = new PapyrusConfigurationItemProvider(this);
+ }
+
+ return papyrusConfigurationItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusViewpoint} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusViewpointItemProvider papyrusViewpointItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusViewpoint}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusViewpointAdapter() {
+ if (papyrusViewpointItemProvider == null) {
+ papyrusViewpointItemProvider = new PapyrusViewpointItemProvider(this);
+ }
+
+ return papyrusViewpointItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusViewItemProvider papyrusViewItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusViewAdapter() {
+ if (papyrusViewItemProvider == null) {
+ papyrusViewItemProvider = new PapyrusViewItemProvider(this);
+ }
+
+ return papyrusViewItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusDiagramItemProvider papyrusDiagramItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusDiagramAdapter() {
+ if (papyrusDiagramItemProvider == null) {
+ papyrusDiagramItemProvider = new PapyrusDiagramItemProvider(this);
+ }
+
+ return papyrusDiagramItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusSyncTableItemProvider papyrusSyncTableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusSyncTableAdapter() {
+ if (papyrusSyncTableItemProvider == null) {
+ papyrusSyncTableItemProvider = new PapyrusSyncTableItemProvider(this);
+ }
+
+ return papyrusSyncTableItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableItemProvider papyrusTableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusTableAdapter() {
+ if (papyrusTableItemProvider == null) {
+ papyrusTableItemProvider = new PapyrusTableItemProvider(this);
+ }
+
+ return papyrusTableItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModelRuleItemProvider modelRuleItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createModelRuleAdapter() {
+ if (modelRuleItemProvider == null) {
+ modelRuleItemProvider = new ModelRuleItemProvider(this);
+ }
+
+ return modelRuleItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.OwningRule} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected OwningRuleItemProvider owningRuleItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.OwningRule}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createOwningRuleAdapter() {
+ if (owningRuleItemProvider == null) {
+ owningRuleItemProvider = new OwningRuleItemProvider(this);
+ }
+
+ return owningRuleItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.ChildRule} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ChildRuleItemProvider childRuleItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ChildRule}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createChildRuleAdapter() {
+ if (childRuleItemProvider == null) {
+ childRuleItemProvider = new ChildRuleItemProvider(this);
+ }
+
+ return childRuleItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PaletteRule} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PaletteRuleItemProvider paletteRuleItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PaletteRule}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPaletteRuleAdapter() {
+ if (paletteRuleItemProvider == null) {
+ paletteRuleItemProvider = new PaletteRuleItemProvider(this);
+ }
+
+ return paletteRuleItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.PathElement} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PathElementItemProvider pathElementItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PathElement}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPathElementAdapter() {
+ if (pathElementItemProvider == null) {
+ pathElementItemProvider = new PathElementItemProvider(this);
+ }
+
+ return pathElementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.Category} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CategoryItemProvider categoryItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.Category}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createCategoryAdapter() {
+ if (categoryItemProvider == null) {
+ categoryItemProvider = new CategoryItemProvider(this);
+ }
+
+ return categoryItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.viewpoints.configuration.ElementImport} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ElementImportItemProvider elementImportItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ElementImport}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createElementImportAdapter() {
+ if (elementImportItemProvider == null) {
+ elementImportItemProvider = new ElementImportItemProvider(this);
+ }
+
+ return elementImportItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (papyrusConfigurationItemProvider != null) papyrusConfigurationItemProvider.dispose();
+ if (papyrusViewpointItemProvider != null) papyrusViewpointItemProvider.dispose();
+ if (papyrusViewItemProvider != null) papyrusViewItemProvider.dispose();
+ if (papyrusDiagramItemProvider != null) papyrusDiagramItemProvider.dispose();
+ if (papyrusSyncTableItemProvider != null) papyrusSyncTableItemProvider.dispose();
+ if (papyrusTableItemProvider != null) papyrusTableItemProvider.dispose();
+ if (modelRuleItemProvider != null) modelRuleItemProvider.dispose();
+ if (owningRuleItemProvider != null) owningRuleItemProvider.dispose();
+ if (childRuleItemProvider != null) childRuleItemProvider.dispose();
+ if (paletteRuleItemProvider != null) paletteRuleItemProvider.dispose();
+ if (pathElementItemProvider != null) pathElementItemProvider.dispose();
+ if (categoryItemProvider != null) categoryItemProvider.dispose();
+ if (elementImportItemProvider != null) elementImportItemProvider.dispose();
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ElementImportItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ElementImportItemProvider.java
new file mode 100755
index 00000000000..9592e8606c7
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ElementImportItemProvider.java
@@ -0,0 +1,182 @@
+/**
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ElementImport;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ElementImport} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ElementImportItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ElementImportItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFromPropertyDescriptor(object);
+ addElementPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the From feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addFromPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ElementImport_from_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ElementImport_from_feature", "_UI_ElementImport_type"),
+ ConfigurationPackage.Literals.ELEMENT_IMPORT__FROM,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ElementImport_element_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ElementImport_element_feature", "_UI_ElementImport_type"),
+ ConfigurationPackage.Literals.ELEMENT_IMPORT__ELEMENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns ElementImport.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ElementImport.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ ElementImport ei = (ElementImport) object;
+ StringBuilder builder = new StringBuilder("[");
+ builder.append(ei.getElement() != null ? ei.getElement().getName() : "?");
+ builder.append("] from ");
+ builder.append(ei.getFrom() != null ? PapyrusViewItemProvider.getTextFor(ei.getFrom()) : "?");
+ return builder.toString();
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ModelRuleItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ModelRuleItemProvider.java
new file mode 100755
index 00000000000..450094af358
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/ModelRuleItemProvider.java
@@ -0,0 +1,251 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EClassPropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule;
+import org.eclipse.papyrus.infra.viewpoints.configuration.StereotypePropertyDescriptor;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelRuleItemProvider
+ extends RuleItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelRuleItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addElementPropertyDescriptor(object);
+ addStereotypesPropertyDescriptor(object);
+ addMultiplicityPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EClassPropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ModelRule_element_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_element_feature", "_UI_ModelRule_type"),
+ ConfigurationPackage.Literals.MODEL_RULE__ELEMENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Stereotypes feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addStereotypesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new StereotypePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ModelRule_stereotypes_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_stereotypes_feature", "_UI_ModelRule_type"),
+ ConfigurationPackage.Literals.MODEL_RULE__STEREOTYPES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Multiplicity feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addMultiplicityPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ModelRule_multiplicity_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_multiplicity_feature", "_UI_ModelRule_type"),
+ ConfigurationPackage.Literals.MODEL_RULE__MULTIPLICITY,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(ConfigurationPackage.Literals.MODEL_RULE__AUTO_SELECT_PATH);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns ModelRule.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ModelRule.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ ModelRule rule = (ModelRule) object;
+ StringBuilder builder = new StringBuilder("Root: ");
+ if (!rule.getStereotypes().isEmpty()) {
+ builder.append("<<");
+ for (int i = 0; i != rule.getStereotypes().size(); i++) {
+ if (i != 0)
+ builder.append(",");
+ builder.append(rule.getStereotypes().get(i).getName());
+ }
+ builder.append(">> ");
+ }
+ builder.append(rule.getElement() != null ? rule.getElement().getName() : "#");
+ builder.append("[");
+ builder.append(rule.getMultiplicity() == -1 ? "*" : rule.getMultiplicity());
+ builder.append("] => ");
+ builder.append(rule.isPermit() ? "allow" : "deny");
+ return builder.toString();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ModelRule.class)) {
+ case ConfigurationPackage.MODEL_RULE__MULTIPLICITY:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case ConfigurationPackage.MODEL_RULE__AUTO_SELECT_PATH:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.MODEL_RULE__AUTO_SELECT_PATH,
+ ConfigurationFactory.eINSTANCE.createPathElement()));
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/OwningRuleItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/OwningRuleItemProvider.java
new file mode 100755
index 00000000000..1748a6c4dd0
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/OwningRuleItemProvider.java
@@ -0,0 +1,210 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EClassPropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.OwningRule;
+import org.eclipse.papyrus.infra.viewpoints.configuration.StereotypePropertyDescriptor;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.OwningRule} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class OwningRuleItemProvider
+ extends RuleItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OwningRuleItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addElementPropertyDescriptor(object);
+ addStereotypesPropertyDescriptor(object);
+ addMultiplicityPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EClassPropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_OwningRule_element_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_element_feature", "_UI_OwningRule_type"),
+ ConfigurationPackage.Literals.OWNING_RULE__ELEMENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Stereotypes feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addStereotypesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new StereotypePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_OwningRule_stereotypes_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_stereotypes_feature", "_UI_OwningRule_type"),
+ ConfigurationPackage.Literals.OWNING_RULE__STEREOTYPES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Multiplicity feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addMultiplicityPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_OwningRule_multiplicity_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_multiplicity_feature", "_UI_OwningRule_type"),
+ ConfigurationPackage.Literals.OWNING_RULE__MULTIPLICITY,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns OwningRule.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/OwningRule.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ OwningRule rule = (OwningRule) object;
+ StringBuilder builder = new StringBuilder("Owner: ");
+ if (!rule.getStereotypes().isEmpty()) {
+ builder.append("<<");
+ for (int i = 0; i != rule.getStereotypes().size(); i++) {
+ if (i != 0)
+ builder.append(",");
+ builder.append(rule.getStereotypes().get(i).getName());
+ }
+ builder.append(">> ");
+ }
+ builder.append(rule.getElement() != null ? rule.getElement().getName() : "#");
+ builder.append("[");
+ builder.append(rule.getMultiplicity() == -1 ? "*" : rule.getMultiplicity());
+ builder.append("] => ");
+ builder.append(rule.isPermit() ? "allow" : "deny");
+ return builder.toString();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(OwningRule.class)) {
+ case ConfigurationPackage.OWNING_RULE__MULTIPLICITY:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PaletteRuleItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PaletteRuleItemProvider.java
new file mode 100755
index 00000000000..4d0cacbccbe
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PaletteRuleItemProvider.java
@@ -0,0 +1,152 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PaletteRule;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PaletteRule} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PaletteRuleItemProvider
+ extends RuleItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PaletteRuleItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addElementPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PaletteRule_element_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PaletteRule_element_feature", "_UI_PaletteRule_type"),
+ ConfigurationPackage.Literals.PALETTE_RULE__ELEMENT,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns PaletteRule.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PaletteRule.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ PaletteRule rule = (PaletteRule) object;
+ String data = "*";
+ if (rule.getElement() != null && !rule.getElement().isEmpty())
+ data = rule.getElement();
+ return "Palette: " + data + " => " + (rule.isPermit() ? "allow" : "deny");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PaletteRule.class)) {
+ case ConfigurationPackage.PALETTE_RULE__ELEMENT:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java
new file mode 100755
index 00000000000..699f0766555
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java
@@ -0,0 +1,255 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EPackagePropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.Iso42010Factory;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.Iso42010Package;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.provider.ArchitectureFrameworkItemProvider;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusConfigurationItemProvider
+ extends ArchitectureFrameworkItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusConfigurationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addDefaultStakeholderPropertyDescriptor(object);
+ addMetamodelPropertyDescriptor(object);
+ addCategoriesPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Default Stakeholder feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addDefaultStakeholderPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_defaultStakeholder_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_defaultStakeholder_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__DEFAULT_STAKEHOLDER,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Metamodel feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addMetamodelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EPackagePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_metamodel_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_metamodel_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__METAMODEL,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Categories feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addCategoriesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_categories_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_categories_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PapyrusConfiguration.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusConfiguration.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ PapyrusConfiguration config = (PapyrusConfiguration) object;
+ if (config.getMetamodel() != null)
+ return "Papyrus Configuration (" + config.getMetamodel().getNsURI() + ")";
+ return "Papyrus Configuration (?)";
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PapyrusConfiguration.class)) {
+ case ConfigurationPackage.PAPYRUS_CONFIGURATION__CATEGORIES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_FRAMEWORK__VIEWPOINTS,
+ ConfigurationFactory.eINSTANCE.createPapyrusViewpoint()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_FRAMEWORK__STAKEHOLDERS,
+ Iso42010Factory.eINSTANCE.createStakeholder()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES,
+ ConfigurationFactory.eINSTANCE.createCategory()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusDiagramItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusDiagramItemProvider.java
new file mode 100755
index 00000000000..8263e4d0dd1
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusDiagramItemProvider.java
@@ -0,0 +1,226 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusDiagram} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusDiagramItemProvider
+ extends PapyrusViewItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusDiagramItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addCustomPalettePropertyDescriptor(object);
+ addCustomStylePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Custom Palette feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addCustomPalettePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusDiagram_customPalette_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusDiagram_customPalette_feature", "_UI_PapyrusDiagram_type"),
+ ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__CUSTOM_PALETTE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Custom Style feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addCustomStylePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusDiagram_customStyle_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusDiagram_customStyle_feature", "_UI_PapyrusDiagram_type"),
+ ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__CUSTOM_STYLE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__CHILD_RULES);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__PALETTE_RULES);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__IMPORTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PapyrusDiagram.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusDiagram.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusDiagram) object);
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PapyrusDiagram.class)) {
+ case ConfigurationPackage.PAPYRUS_DIAGRAM__CUSTOM_PALETTE:
+ case ConfigurationPackage.PAPYRUS_DIAGRAM__CUSTOM_STYLE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case ConfigurationPackage.PAPYRUS_DIAGRAM__CHILD_RULES:
+ case ConfigurationPackage.PAPYRUS_DIAGRAM__PALETTE_RULES:
+ case ConfigurationPackage.PAPYRUS_DIAGRAM__IMPORTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__CHILD_RULES,
+ ConfigurationFactory.eINSTANCE.createChildRule()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__PALETTE_RULES,
+ ConfigurationFactory.eINSTANCE.createPaletteRule()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_DIAGRAM__IMPORTS,
+ ConfigurationFactory.eINSTANCE.createElementImport()));
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusSyncTableItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusSyncTableItemProvider.java
new file mode 100755
index 00000000000..0c28697c661
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusSyncTableItemProvider.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusSyncTableItemProvider
+ extends PapyrusViewItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusSyncTableItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns PapyrusSyncTable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusSyncTable.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusSyncTable) object);
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusTableItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusTableItemProvider.java
new file mode 100755
index 00000000000..ccef2d388ba
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusTableItemProvider.java
@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusTableItemProvider
+ extends PapyrusViewItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTableItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_configuration_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_configuration_feature", "_UI_PapyrusTable_type"),
+ ConfigurationPackage.Literals.PAPYRUS_TABLE__CONFIGURATION,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns PapyrusTable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusTable.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusTable) object);
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PapyrusTable.class)) {
+ case ConfigurationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewItemProvider.java
new file mode 100755
index 00000000000..36462a2ff4b
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewItemProvider.java
@@ -0,0 +1,316 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusViewpoint;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ProfilePropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.provider.ModelKindItemProvider;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusViewItemProvider
+ extends ModelKindItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusViewItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIconPropertyDescriptor(object);
+ addParentPropertyDescriptor(object);
+ addProfilesPropertyDescriptor(object);
+ addImplementationIDPropertyDescriptor(object);
+ addCategoriesPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Icon feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIconPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusView_icon_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusView_icon_feature", "_UI_PapyrusView_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEW__ICON,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Parent feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addParentPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusView_parent_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusView_parent_feature", "_UI_PapyrusView_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEW__PARENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Profiles feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addProfilesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new ProfilePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusView_profiles_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusView_profiles_feature", "_UI_PapyrusView_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEW__PROFILES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Implementation ID feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addImplementationIDPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusView_implementationID_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusView_implementationID_feature", "_UI_PapyrusView_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEW__IMPLEMENTATION_ID,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Categories feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addCategoriesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusView_categories_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusView_categories_feature", "_UI_PapyrusView_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEW__CATEGORIES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_VIEW__MODEL_RULES);
+ childrenFeatures.add(ConfigurationPackage.Literals.PAPYRUS_VIEW__OWNING_RULES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PapyrusView.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusView.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusView) object);
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected static String getTextFor(PapyrusView view) {
+ PapyrusViewpoint vp = (PapyrusViewpoint) view.eContainer();
+ if (view.getName() == null)
+ return (vp.getName() + " :: <natural> [" + view.getImplementationID() + "]");
+ return (vp.getName() + " :: " + view.getName());
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PapyrusView.class)) {
+ case ConfigurationPackage.PAPYRUS_VIEW__ICON:
+ case ConfigurationPackage.PAPYRUS_VIEW__IMPLEMENTATION_ID:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case ConfigurationPackage.PAPYRUS_VIEW__MODEL_RULES:
+ case ConfigurationPackage.PAPYRUS_VIEW__OWNING_RULES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_VIEW__MODEL_RULES,
+ ConfigurationFactory.eINSTANCE.createModelRule()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_VIEW__OWNING_RULES,
+ ConfigurationFactory.eINSTANCE.createOwningRule()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewpointItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewpointItemProvider.java
new file mode 100755
index 00000000000..af4d56f7cb4
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusViewpointItemProvider.java
@@ -0,0 +1,166 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusViewpoint;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.Iso42010Package;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.provider.ArchitectureViewpointItemProvider;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusViewpoint} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusViewpointItemProvider
+ extends ArchitectureViewpointItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusViewpointItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addParentPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Parent feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addParentPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusViewpoint_parent_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusViewpoint_parent_feature", "_UI_PapyrusViewpoint_type"),
+ ConfigurationPackage.Literals.PAPYRUS_VIEWPOINT__PARENT,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns PapyrusViewpoint.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusViewpoint.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((PapyrusViewpoint)object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_PapyrusViewpoint_type") : label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_VIEWPOINT__MODEL_KINDS,
+ ConfigurationFactory.eINSTANCE.createPapyrusDiagram()));
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_VIEWPOINT__MODEL_KINDS,
+ ConfigurationFactory.eINSTANCE.createPapyrusTable()));
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_VIEWPOINT__MODEL_KINDS,
+ ConfigurationFactory.eINSTANCE.createPapyrusSyncTable()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PathElementItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PathElementItemProvider.java
new file mode 100755
index 00000000000..4dafa8baee5
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PathElementItemProvider.java
@@ -0,0 +1,202 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EReferencePropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PathElement;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PathElement} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PathElementItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PathElementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFeaturePropertyDescriptor(object);
+ addOriginPropertyDescriptor(object);
+ addTargetPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Feature feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addFeaturePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EReferencePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PathElement_feature_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PathElement_feature_feature", "_UI_PathElement_type"),
+ ConfigurationPackage.Literals.PATH_ELEMENT__FEATURE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Origin feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addOriginPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PathElement_origin_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PathElement_origin_feature", "_UI_PathElement_type"),
+ ConfigurationPackage.Literals.PATH_ELEMENT__ORIGIN,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Target feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTargetPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PathElement_target_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PathElement_target_feature", "_UI_PathElement_type"),
+ ConfigurationPackage.Literals.PATH_ELEMENT__TARGET,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns PathElement.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PathElement.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ PathElement path = (PathElement) object;
+ String data = "<undefined>";
+ if (path.getFeature() != null && path.getOrigin() != null)
+ data = path.getOrigin().getName() + "." + path.getFeature().getName() + " => " + path.getTarget().getName();
+ return data;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RuleItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RuleItemProvider.java
new file mode 100755
index 00000000000..6883828ee78
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/RuleItemProvider.java
@@ -0,0 +1,155 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.Rule;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.Rule} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class RuleItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RuleItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addPermitPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Permit feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addPermitPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Rule_permit_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Rule_permit_feature", "_UI_Rule_type"),
+ ConfigurationPackage.Literals.RULE__PERMIT,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ Rule rule = (Rule)object;
+ return getString("_UI_Rule_type") + " " + rule.isPermit();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Rule.class)) {
+ case ConfigurationPackage.RULE__PERMIT:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.classpath b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.classpath
new file mode 100755
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.project b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.project
new file mode 100755
index 00000000000..bcf711a4642
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.viewpoints.configuration.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/META-INF/MANIFEST.MF b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/META-INF/MANIFEST.MF
new file mode 100755
index 00000000000..296c54dd063
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.viewpoints.configuration.editor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.viewpoints.configuration.presentation.ConfigurationEditorPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.viewpoints.configuration.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.emf.ecore.edit,
+ org.eclipse.papyrus.infra.viewpoints.iso42010.edit;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.configuration.edit;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/about.html b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/about.html
new file mode 100755
index 00000000000..dd02e0be168
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.editor/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>December 2, 2009</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