Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-11-06 12:07:50 +0000
committerCamille Letavernier2014-11-06 12:16:11 +0000
commit52cfc35efacca1a3fdafce159d6720b04f59fe9e (patch)
tree68983927f8177cb92bffa3051e44748ad285eb28 /plugins/customization
parent8527559c5c24f20096123c9402855083a775b4f5 (diff)
downloadorg.eclipse.papyrus-52cfc35efacca1a3fdafce159d6720b04f59fe9e.tar.gz
org.eclipse.papyrus-52cfc35efacca1a3fdafce159d6720b04f59fe9e.tar.xz
org.eclipse.papyrus-52cfc35efacca1a3fdafce159d6720b04f59fe9e.zip
450280: [Properties View] Papyrus shall provide a helper to easily embed
a properties view in a Composite https://bugs.eclipse.org/bugs/show_bug.cgi?id=450280
Diffstat (limited to 'plugins/customization')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java38
1 files changed, 17 insertions, 21 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java b/plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java
index 9f29e7369a5..243339fcabc 100644
--- a/plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java
@@ -11,22 +11,14 @@
*****************************************************************************/
package org.eclipse.papyrus.customization.wizard;
-import java.util.Set;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.papyrus.customization.display.DisplayManager;
import org.eclipse.papyrus.customization.messages.Messages;
import org.eclipse.papyrus.customization.model.customizationplugin.CustomizationConfiguration;
import org.eclipse.papyrus.customization.model.customizationplugin.CustomizationPluginFactory;
-import org.eclipse.papyrus.views.properties.contexts.View;
-import org.eclipse.papyrus.views.properties.runtime.EmbeddedDisplayEngine;
-import org.eclipse.papyrus.views.properties.runtime.ViewConstraintEngine;
+import org.eclipse.papyrus.views.properties.runtime.DisplayEngine;
+import org.eclipse.papyrus.views.properties.util.PropertiesDisplayHelper;
import org.eclipse.papyrus.views.properties.widgets.layout.PropertiesLayout;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -34,6 +26,8 @@ public class CustomizationPage extends WizardPage {
private CustomizationConfiguration configuration;
+ private DisplayEngine displayEngine;
+
protected CustomizationPage() {
this(null);
}
@@ -57,17 +51,7 @@ public class CustomizationPage extends WizardPage {
this.configuration = CustomizationPluginFactory.eINSTANCE.createCustomizationConfiguration();
}
- IStructuredSelection selection = new StructuredSelection(configuration);
-
- ViewConstraintEngine constraintEngine = DisplayManager.instance.constraintEngine;
- Set<View> views = constraintEngine.getViews(selection);
-
- Composite self = new Composite(container, SWT.BORDER);
- self.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
- self.setLayout(new FillLayout());
-
- EmbeddedDisplayEngine display = new EmbeddedDisplayEngine();
- display.display(views, self, selection, SWT.NONE);
+ displayEngine = PropertiesDisplayHelper.display(this.configuration, container);
setControl(container);
}
@@ -89,4 +73,16 @@ public class CustomizationPage extends WizardPage {
return configuration;
}
+ /**
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ *
+ */
+ @Override
+ public void dispose() {
+ if (displayEngine != null) {
+ displayEngine.dispose();
+ }
+ super.dispose();
+ }
+
}

Back to the top