Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2016-02-01 10:55:53 +0000
committerPierre-Charles David2016-02-01 14:35:42 +0000
commitc647bff7256184a2b53bab3e1c0b248b24047518 (patch)
tree08d28118f218ca5c08b14b4dd161cc75c0d272ac
parent63a71600032b9a3e5a32656e1fa09f13e3658287 (diff)
downloadorg.eclipse.sirius-c647bff7256184a2b53bab3e1c0b248b24047518.tar.gz
org.eclipse.sirius-c647bff7256184a2b53bab3e1c0b248b24047518.tar.xz
org.eclipse.sirius-c647bff7256184a2b53bab3e1c0b248b24047518.zip
[482528] Replace dependency to oes.ui.properties by extension point
Remove the optional dependency from oes.diagram.ui to oes.ui.properties, which can cause build and deployment issues, and replace it by an indirection using the new extension point oes.ui.siriusPropertySheetPageProvider based on the new interface ISiriusPropertySheetPageProvider. Only the diagram dialect is currently aware of this extension point. Support for tables and trees will come in a second phase. Bug: 482528 Change-Id: If6cda35401f32585816427f2fa02b893c233ecbb Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--incubation/org.eclipse.sirius.ui.properties/META-INF/MANIFEST.MF3
-rw-r--r--incubation/org.eclipse.sirius.ui.properties/plugin.xml15
-rw-r--r--incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/EEFPropertySheetPageProvider.java27
-rw-r--r--packaging/org.eclipse.sirius.parent/pom.xml4
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditor.java16
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/ui/provider/DiagramUIPlugin.java19
-rw-r--r--plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.sirius.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.sirius.ui/plugin.xml1
-rw-r--r--plugins/org.eclipse.sirius.ui/schema/siriusPropertySheetPageProvider.exsd109
-rw-r--r--plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java48
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/properties/ISiriusPropertySheetPageProvider.java34
13 files changed, 248 insertions, 34 deletions
diff --git a/incubation/org.eclipse.sirius.ui.properties/META-INF/MANIFEST.MF b/incubation/org.eclipse.sirius.ui.properties/META-INF/MANIFEST.MF
index 2df8ad881f..59e3ba44e3 100644
--- a/incubation/org.eclipse.sirius.ui.properties/META-INF/MANIFEST.MF
+++ b/incubation/org.eclipse.sirius.ui.properties/META-INF/MANIFEST.MF
@@ -18,6 +18,7 @@ Require-Bundle: org.eclipse.eef;bundle-version="1.6.0",
org.eclipse.sirius.ext.base,
org.eclipse.sirius.common.interpreter;bundle-version="1.0.0",
org.eclipse.eef.properties.ui;bundle-version="1.6.0"
-Import-Package: com.ibm.icu.util
+Import-Package: com.ibm.icu.util,
+ org.eclipse.sirius.ui.tools.api.properties;version="2.1.0"
Bundle-Activator: org.eclipse.sirius.ui.properties.internal.Activator
Bundle-ActivationPolicy: lazy
diff --git a/incubation/org.eclipse.sirius.ui.properties/plugin.xml b/incubation/org.eclipse.sirius.ui.properties/plugin.xml
index 523de04e1d..36c8669794 100644
--- a/incubation/org.eclipse.sirius.ui.properties/plugin.xml
+++ b/incubation/org.eclipse.sirius.ui.properties/plugin.xml
@@ -27,4 +27,19 @@
label="Sirius EEF Tab Descriptor Provider">
</descriptor>
</extension>
+ <extension
+ point="org.eclipse.sirius.ui.siriusPropertySheetPageProvider">
+ <siriusPropertySheetPageProvider
+ class="org.eclipse.sirius.ui.properties.internal.EEFPropertySheetPageProvider"
+ contributorId="org.eclipse.sirius.diagram.ui">
+ </siriusPropertySheetPageProvider>
+ <siriusPropertySheetPageProvider
+ class="org.eclipse.sirius.ui.properties.internal.EEFPropertySheetPageProvider"
+ contributorId="org.eclipse.sirius.table.ui.EditorID">
+ </siriusPropertySheetPageProvider>
+ <siriusPropertySheetPageProvider
+ class="org.eclipse.sirius.ui.properties.internal.EEFPropertySheetPageProvider"
+ contributorId="org.eclipse.sirius.tree.ui.EditorID">
+ </siriusPropertySheetPageProvider>
+ </extension>
</plugin>
diff --git a/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/EEFPropertySheetPageProvider.java b/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/EEFPropertySheetPageProvider.java
new file mode 100644
index 0000000000..d0b894357b
--- /dev/null
+++ b/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/EEFPropertySheetPageProvider.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.ui.properties.internal;
+
+import org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage;
+import org.eclipse.sirius.ui.tools.api.properties.ISiriusPropertySheetPageProvider;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+
+/**
+ * Provides an EEFTabbedPropertySheetPage for a given source part.
+ *
+ * @author pcdavid
+ */
+public class EEFPropertySheetPageProvider implements ISiriusPropertySheetPageProvider {
+ @Override
+ public IPropertySheetPage getPropertySheetPage(Object source, String contributorId) {
+ return new EEFTabbedPropertySheetPage(source, contributorId);
+ }
+}
diff --git a/packaging/org.eclipse.sirius.parent/pom.xml b/packaging/org.eclipse.sirius.parent/pom.xml
index e0d76bf72a..219ded73da 100644
--- a/packaging/org.eclipse.sirius.parent/pom.xml
+++ b/packaging/org.eclipse.sirius.parent/pom.xml
@@ -64,9 +64,9 @@
<configuration>
<includePackedArtifacts>true</includePackedArtifacts>
<resolver>p2</resolver>
-<!-- <dependency-resolution>
+ <dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
- </dependency-resolution> -->
+ </dependency-resolution>
<target>
<artifact>
<groupId>org.eclipse.sirius</groupId>
diff --git a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
index 0d1f210a58..bdad7333b0 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
@@ -43,8 +43,7 @@ Require-Bundle: com.google.guava;bundle-version="[11.0.2,16.0)",
org.eclipse.ui.navigator;bundle-version="3.5.200",
org.eclipse.ui.navigator.resources;bundle-version="3.4.400",
org.w3c.dom.svg;bundle-version="1.1.0",
- org.apache.xerces;bundle-version="2.9.0",
- org.eclipse.eef.properties.ui;bundle-version="1.6.0";resolution:=optional
+ org.apache.xerces;bundle-version="2.9.0"
Eclipse-LazyStart: true
Export-Package: org.eclipse.sirius.diagram.description.concern.provider;version="2.0.4",
org.eclipse.sirius.diagram.description.filter.provider;version="2.0.4",
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditor.java
index 97dc07e90a..bbb23de0bc 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditor.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -36,12 +35,12 @@ import org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper;
import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin;
import org.eclipse.sirius.ui.business.api.session.SessionEditorInput;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.IModelExplorerView;
+import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
import org.eclipse.ui.ide.IGotoMarker;
import org.eclipse.ui.navigator.resources.ProjectExplorer;
import org.eclipse.ui.part.IShowInTargetList;
import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.osgi.framework.Bundle;
/**
* @not-generated
@@ -110,8 +109,11 @@ public class SiriusDiagramEditor extends DiagramDocumentEditor implements IGotoM
}
};
}
- if (type == IPropertySheetPage.class && useForkedPropertySheetFramework()) {
- return new EEFTabbedPropertySheetPage(this, this.getContributorId());
+ if (type == IPropertySheetPage.class) {
+ IPropertySheetPage contributedPage = SiriusEditPlugin.getPlugin().getPropertySheetPage(type, getContributorId());
+ if (contributedPage != null) {
+ return contributedPage;
+ }
}
if (type == AdapterFactory.class) {
return DiagramUIPlugin.getPlugin().getItemProvidersAdapterFactory();
@@ -119,10 +121,6 @@ public class SiriusDiagramEditor extends DiagramDocumentEditor implements IGotoM
return super.getAdapter(type);
}
- private boolean useForkedPropertySheetFramework() {
- return DiagramUIPlugin.getPlugin().isForkedPropertiesFrameworkAvailable();
- }
-
/**
* @was-generated
*/
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/ui/provider/DiagramUIPlugin.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/ui/provider/DiagramUIPlugin.java
index 3c72f2f920..79983548cc 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/ui/provider/DiagramUIPlugin.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/ui/provider/DiagramUIPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -145,8 +145,6 @@ public final class DiagramUIPlugin extends EMFPlugin {
private WorkspaceImageFigureRefresher workspaceImageFigureRefresher;
- private final boolean isForkedPropertiesFrameworkAvailable;
-
/**
* Creates an instance. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -154,26 +152,11 @@ public final class DiagramUIPlugin extends EMFPlugin {
*/
public Implementation() {
super();
-
- isForkedPropertiesFrameworkAvailable = isBundlePresent("org.eclipse.eef.properties.ui"); //$NON-NLS-1$
// Remember the static instance.
//
DiagramUIPlugin.plugin = this;
}
- public boolean isForkedPropertiesFrameworkAvailable() {
- return isForkedPropertiesFrameworkAvailable;
- }
-
- private boolean isBundlePresent(String bundleName) {
- for (Bundle bundle : getBundle().getBundleContext().getBundles()) {
- if (bundleName.equals(bundle.getSymbolicName())) {
- return true;
- }
- }
- return false;
- }
-
/**
* @not-generated create the image registry
*/
diff --git a/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
index dd01aca60f..a0d7400941 100644
--- a/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.ui/META-INF/MANIFEST.MF
@@ -45,7 +45,7 @@ Export-Package: org.eclipse.sirius.description.contribution.provider;version="2.
org.eclipse.sirius.ui.tools.api.perspectives;version="2.0.4",
org.eclipse.sirius.ui.tools.api.profiler;version="2.0.4",
org.eclipse.sirius.ui.tools.api.project;version="2.0.5",
- org.eclipse.sirius.ui.tools.api.properties;version="2.1.0",
+ org.eclipse.sirius.ui.tools.api.properties;version="2.2.0",
org.eclipse.sirius.ui.tools.api.provider;version="2.0.4",
org.eclipse.sirius.ui.tools.api.views;version="2.1.0",
org.eclipse.sirius.ui.tools.api.views.common.item;version="2.0.4",
diff --git a/plugins/org.eclipse.sirius.ui/plugin.properties b/plugins/org.eclipse.sirius.ui/plugin.properties
index 95f5fd8bc6..83d19830a2 100644
--- a/plugins/org.eclipse.sirius.ui/plugin.properties
+++ b/plugins/org.eclipse.sirius.ui/plugin.properties
@@ -375,6 +375,7 @@ extension-point.representationTemplateEdit.name = org.eclipse.sirius.ui.represen
extension-point.resourceLocator.name = org.eclipse.sirius.ui.resourcelocator
extension-point.siriusPropertiesCellEditor.name = org.eclipse.sirius.ui.siriuspropertiescelleditor
extension-point.uiSessionFactory.name = UI Session Factory
+extension-point.siriusPropertySheetPageProvider.name = Sirius Property-Sheet Page Provider
migrateODActionLabel=Migrate Description File
migrateODesignToODesignActionLabel=Migrate Description File
navigatorContent.siriusContent.name = Sirius Content Management
diff --git a/plugins/org.eclipse.sirius.ui/plugin.xml b/plugins/org.eclipse.sirius.ui/plugin.xml
index 0e88563dd3..1e51eafa45 100644
--- a/plugins/org.eclipse.sirius.ui/plugin.xml
+++ b/plugins/org.eclipse.sirius.ui/plugin.xml
@@ -23,6 +23,7 @@
<extension-point id="newmodeldependencywizard" name="%extension-point.newmodeldependencywizard.name" schema="schema/newmodeldependencywizard.exsd"/>
<extension-point id="modelingprojectresourcelistener" name="%extension-point.modelingProjectResourceListener.name" schema="schema/modelingprojectresourcelistener.exsd"/>
<extension-point id="siriuspropertiescelleditor" name="%extension-point.siriusPropertiesCellEditor.name" schema="schema/siriuspropertiescelleditor.exsd"/>
+ <extension-point id="siriusPropertySheetPageProvider" name="%extension-point.siriusPropertySheetPageProvider.name" schema="schema/siriusPropertySheetPageProvider.exsd"/>
<extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
diff --git a/plugins/org.eclipse.sirius.ui/schema/siriusPropertySheetPageProvider.exsd b/plugins/org.eclipse.sirius.ui/schema/siriusPropertySheetPageProvider.exsd
new file mode 100644
index 0000000000..1315427f36
--- /dev/null
+++ b/plugins/org.eclipse.sirius.ui/schema/siriusPropertySheetPageProvider.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.sirius.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.sirius.ui" id="siriusPropertySheetPageProvider" name="Sirius Property-Sheet Page Provider"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="siriusPropertySheetPageProvider" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="siriusPropertySheetPageProvider">
+ <complexType>
+ <attribute name="contributorId" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.sirius.ui.tools.api.properties.ISiriusPropertySheetPageProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
index b861672376..be6db6cce5 100644
--- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
+++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -51,6 +53,7 @@ import org.eclipse.sirius.ui.business.internal.session.GenericSWTCallBack;
import org.eclipse.sirius.ui.business.internal.session.factory.UISessionFactoryDescriptorRegistryListener;
import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager;
import org.eclipse.sirius.ui.tools.api.profiler.SiriusTasks;
+import org.eclipse.sirius.ui.tools.api.properties.ISiriusPropertySheetPageProvider;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.resourcelistener.IModelingProjectResourceListener;
import org.eclipse.sirius.ui.tools.internal.actions.analysis.IAddModelDependencyWizardRegistryListener;
import org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.resourcelistener.ModelingProjectResourceListenerRegistry;
@@ -63,8 +66,12 @@ import org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAd
import org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.osgi.framework.BundleContext;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+
/**
* This is the central singleton for the Viewpoint edit plugin. <!--
* begin-user-doc --> <!-- end-user-doc -->
@@ -148,6 +155,8 @@ public final class SiriusEditPlugin extends EMFPlugin {
private Map<ImageDescriptor, Image> descriptorsToImages;
private UICallBack uiCallback = new GenericSWTCallBack();
+
+ private Multimap<String, ISiriusPropertySheetPageProvider> propertySheetPageProviders = HashMultimap.create();
/**
* The registry listener that will be used to listen to extension
@@ -203,6 +212,8 @@ public final class SiriusEditPlugin extends EMFPlugin {
resourceWizardRegistryListener = new IAddModelDependencyWizardRegistryListener();
resourceWizardRegistryListener.init();
+
+ registerPropertySheetPageProviders();
try {
SiriusTasks.initSiriusTasks();
@@ -228,6 +239,20 @@ public final class SiriusEditPlugin extends EMFPlugin {
}
}
+ private void registerPropertySheetPageProviders() {
+ for (IConfigurationElement ce : EclipseUtil.getConfigurationElementsFor("org.eclipse.sirius.ui.siriusPropertySheetPageProvider")) { //$NON-NLS-1$
+ try {
+ String contribId = ce.getAttribute("contributorId"); //$NON-NLS-1$
+ if (contribId != null) {
+ ISiriusPropertySheetPageProvider provider = (ISiriusPropertySheetPageProvider) ce.createExecutableExtension("class"); //$NON-NLS-1$
+ this.propertySheetPageProviders.put(contribId, provider);
+ }
+ } catch (CoreException e) {
+ getLog().log(new Status(IStatus.ERROR, SiriusEditPlugin.ID, IStatus.OK, e.getMessage(), e));
+ }
+ }
+ }
+
/**
* Starts the management of the Preferences of the core of Designer.
*
@@ -421,6 +446,27 @@ public final class SiriusEditPlugin extends EMFPlugin {
}
/**
+ * Get the most specific IPropertySheetPage adapted for the specified
+ * source.
+ *
+ * @param source
+ * the source part.
+ * @param contributorId
+ * the contributor id.
+ * @return a IPropertySheetPage adapted for the specified source, or
+ * <code>null</code> if none was contributed.
+ */
+ public IPropertySheetPage getPropertySheetPage(Object source, String contributorId) {
+ for (ISiriusPropertySheetPageProvider provider : this.propertySheetPageProviders.get(contributorId)) {
+ IPropertySheetPage page = provider.getPropertySheetPage(source, contributorId);
+ if (page != null) {
+ return page;
+ }
+ }
+ return null;
+ }
+
+ /**
* Create the adapter factories.
*
* @return the created adapter factories
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/properties/ISiriusPropertySheetPageProvider.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/properties/ISiriusPropertySheetPageProvider.java
new file mode 100644
index 0000000000..5e880a5fb0
--- /dev/null
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/properties/ISiriusPropertySheetPageProvider.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.ui.tools.api.properties;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+
+/**
+ * Interface to provide an {@link IPropertySheetPage} for a Sirius editor or
+ * view.
+ *
+ * @author pcdavid
+ */
+public interface ISiriusPropertySheetPageProvider {
+ /**
+ * Provides a {@link IPropertySheetPage} for the specified source and
+ * contributorId. May return <code>null</code> if the given source is not
+ * handled by this provider.
+ *
+ * @param source
+ * the source editor or view.
+ * @param contributorId
+ * the contributor id.
+ * @return a IPropertySheetPage, or <code>null</code>
+ */
+ IPropertySheetPage getPropertySheetPage(Object source, String contributorId);
+}

Back to the top