Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java14
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml2
-rw-r--r--plugins/infra/types/org.eclipse.papyrus.infra.types.ui/plugin.xml2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java6
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCombo.java2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanRadio.java10
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java4
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumRadio.java6
-rw-r--r--plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF2
-rw-r--r--plugins/sdk/org.eclipse.papyrus.sdk/pom.xml2
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.ui/plugin.xml4
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui/plugin.xml2
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator.ui/plugin.xml8
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.assistants.codegen/plugin.xml2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.types/META-INF/MANIFEST.MF2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.types/plugin.xml6
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.types/pom.xml2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.ui/META-INF/MANIFEST.MF2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.ui/plugin.xml10
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.dev.ui/pom.xml2
-rwxr-xr-xplugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.palette/plugin.xml2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/META-INF/MANIFEST.MF2
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml33
-rw-r--r--plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java17
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/pom.xml2
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/PropertiesEditorWidget.java335
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialog.java153
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialogOld.java145
35 files changed, 445 insertions, 348 deletions
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
index e8c19ec5089..fecbb0e0435 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.papyrus.infra.textedit.xtext;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
Bundle-Activator: org.eclipse.papyrus.infra.textedit.xtext.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui;bundle-version="[3.119.0,4.0.0)",
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
index 7cdf4ae4fae..bb7e40a132d 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.textedit.xtext.nested.editor.PapyrusXTextEditor
/**
* This class allows to get error markers in the {@link PapyrusXTextEditor}.
- * Strangely it seems work find doing nothing
+ * Strangely it seems work fine doing nothing
*/
public class PapyrusXTextMarker extends org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel {
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
index 6d6c13d441c..220c1299274 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
@@ -10,7 +10,8 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 578648, 579033, 580115
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 578648, 579033, 580115, 580042
+ * Jeremie Tatibouet (CEA LIST) <jeremie.tatibouet@cea.fr> - Bug 580336
*****************************************************************************/
package org.eclipse.papyrus.infra.textedit.xtext.nested.editor;
@@ -54,6 +55,8 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+import org.eclipse.xtext.ui.editor.model.XtextDocument;
+
/**
* This Customization of the {@link XtextEditor} allows us to open an XtextEditor in the Papyrus sash editor
@@ -339,6 +342,15 @@ public class PapyrusXTextEditor extends XtextEditor {
*/
@Override
public void setFocus() {
+ final PapyrusXTextDocumentProvider provider = getDocumentProvider();
+ if (provider != null) {
+ final IXtextDocument document = provider.getDocument(getEditorInput());
+ if (document instanceof XtextDocument) {
+ // here to create and display validation markers after getting the focus
+ // bugs 580042 and 580336
+ ((XtextDocument) document).checkAndUpdateAnnotations();
+ }
+ }
registerSashWindowsContainerListener();
super.setFocus();
}
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
index 49e3b773d1b..e825ece7693 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.textedit.xtext</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/types/org.eclipse.papyrus.infra.types.ui/plugin.xml b/plugins/infra/types/org.eclipse.papyrus.infra.types.ui/plugin.xml
index fa1d4c578bb..3008991046e 100644
--- a/plugins/infra/types/org.eclipse.papyrus.infra.types.ui/plugin.xml
+++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.ui/plugin.xml
@@ -20,7 +20,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ locationURI="popup:org.eclipse.papyrus.dev.ui.framework">
<command
commandId="org.eclipse.papyrus.infra.types.ui.deploy"
icon="icons/configuration.gif"
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
index 4ac02b669ec..23c40174547 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
@@ -33,7 +33,7 @@ Export-Package: org.eclipse.papyrus.infra.widgets,
org.eclipse.papyrus.infra.widgets.wizard.pages
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 4.1.0.qualifier
+Bundle-Version: 4.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
index 5d25a653cfc..652e0371805 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.widgets</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
index 39adad24442..997e67f7e53 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
@@ -15,7 +15,7 @@
package org.eclipse.papyrus.infra.widgets.editors;
import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.papyrus.infra.tools.databinding.AggregatedObservable;
import org.eclipse.papyrus.infra.widgets.databinding.GrayedCheckboxObservableValue;
@@ -67,7 +67,7 @@ public class BooleanCheckbox extends AbstractValueEditor {
super(parent);
checkbox = factory.createButton(this, label, SWT.CHECK | style);
- IObservableValue widgetObservable = WidgetProperties.selection().observe(checkbox);
+ IObservableValue widgetObservable = WidgetProperties.widgetSelection().observe(checkbox);
setWidgetObservable(widgetObservable, true);
GridData gridData = getDefaultLayoutData();
checkbox.setLayoutData(gridData);
@@ -88,7 +88,7 @@ public class BooleanCheckbox extends AbstractValueEditor {
this.aggregated = (AggregatedObservable) modelProperty;
newWidgetObservable = new GrayedCheckboxObservableValue(checkbox, aggregated);
} else {
- newWidgetObservable = WidgetProperties.selection().observe(checkbox);
+ newWidgetObservable = WidgetProperties.widgetSelection().observe(checkbox);
}
setWidgetObservable(newWidgetObservable, true);
super.setModelObservable(modelProperty);
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCombo.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCombo.java
index 30b26007a31..c4fcc4e747d 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCombo.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCombo.java
@@ -14,7 +14,7 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
-import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.databinding.viewers.typed.ViewerProperties;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanRadio.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanRadio.java
index bed5f18645b..aa7e8228f40 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanRadio.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanRadio.java
@@ -12,13 +12,13 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add binding implementation
* Sebastien Gabel (Esterel Technologies SAS) - Bug 497361
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.SelectObservableValue;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.swt.SWT;
@@ -88,7 +88,7 @@ public class BooleanRadio extends AbstractValueEditor {
setWidgetObservable(getObservable(), true);
controlDecoration = new ControlDecoration(trueRadio, SWT.TOP | SWT.LEFT);
-
+
// Use a dedicated grid data for each radio, otherwise one of the two labels may be truncated.
GridData trueGd = new GridData();
trueGd.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
@@ -106,8 +106,8 @@ public class BooleanRadio extends AbstractValueEditor {
* @return The encapsulating observable value
*/
private IObservableValue getObservable() {
- IObservableValue trueObservable = WidgetProperties.selection().observe(trueRadio);
- IObservableValue falseObservable = WidgetProperties.selection().observe(falseRadio);
+ IObservableValue trueObservable = WidgetProperties.widgetSelection().observe(trueRadio);
+ IObservableValue falseObservable = WidgetProperties.widgetSelection().observe(falseRadio);
SelectObservableValue observable = new SelectObservableValue();
observable.addOption(true, trueObservable);
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
index 1d099906faf..b3616becc6b 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
@@ -15,7 +15,7 @@
package org.eclipse.papyrus.infra.widgets.editors;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
@@ -43,7 +43,7 @@ public class BooleanToggle extends AbstractValueEditor {
super(parent, SWT.NONE, label);
toggleButton = factory.createButton(this, null, style | SWT.TOGGLE);
- setWidgetObservable(WidgetProperties.selection().observe(toggleButton));
+ setWidgetObservable(WidgetProperties.widgetSelection().observe(toggleButton));
setCommitOnFocusLost(toggleButton);
GridData gridData = new GridData();
toggleButton.setLayoutData(gridData);
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumRadio.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumRadio.java
index dfa0d101358..29d9451b7da 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumRadio.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/EnumRadio.java
@@ -20,7 +20,7 @@ import java.util.Map;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.SelectObservableValue;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
@@ -56,7 +56,7 @@ public class EnumRadio extends AbstractValueEditor {
protected ILabelProvider labelProvider = new LabelProvider();
- protected final Map<Button, Object> values = new HashMap<Button, Object>();
+ protected final Map<Button, Object> values = new HashMap<>();
protected int numColumns = -1;
@@ -109,7 +109,7 @@ public class EnumRadio extends AbstractValueEditor {
button.setBackground(buttonsArea.getBackground()); // For Radio buttons, we need to force the color
button.setData(value);
button.setToolTipText(toolTipText);
- IObservableValue buttonObservable = WidgetProperties.selection().observe(button);
+ IObservableValue buttonObservable = WidgetProperties.widgetSelection().observe(button);
observable.addOption(value, buttonObservable);
values.put(button, value);
diff --git a/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF b/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
index 51b1fda3d04..1d9e881c354 100644
--- a/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
+++ b/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 6.2.0.qualifier
+Bundle-Version: 6.3.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml b/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
index 48013784f50..381e945e51c 100644
--- a/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
+++ b/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.sdk</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.ui/plugin.xml b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.ui/plugin.xml
index 958c626bc31..c49f0460e69 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.ui/plugin.xml
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.ui/plugin.xml
@@ -5,11 +5,11 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.uml.profile.types.generator.ui.generateMenu?after=additions">
+ locationURI="popup:org.eclipse.papyrus.custo.editors">
<command
commandId="org.eclipse.papyrus.uml.profile.assistants.generator.ui.generateModelAssistants"
id="org.eclipse.papyrus.uml.profile.assistants.generator.ui.generateModelAssistants"
- label="Diagram Assistants..."
+ label="Generate Diagram Assistants..."
style="push">
<visibleWhen
checkEnabled="false">
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui/plugin.xml b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui/plugin.xml
index b996bf535e8..c22ac3f18ce 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui/plugin.xml
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ locationURI="popup:org.eclipse.papyrus.custo.modelexplorer">
<command
commandId="org.eclipse.papyrus.uml.profile.newchildmenu.generator.ui.command"
style="push">
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator.ui/plugin.xml b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator.ui/plugin.xml
index 9953366b8ba..4abea148e06 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator.ui/plugin.xml
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator.ui/plugin.xml
@@ -5,14 +5,11 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
- <menu
- label="Generate Tooling Model"
- id="org.eclipse.papyrus.uml.profile.types.generator.ui.generateMenu">
+ locationURI="popup:org.eclipse.papyrus.custo.framework">
<command
commandId="org.eclipse.papyrus.uml.profile.types.generator.ui.generateElementTypes"
id="org.eclipse.papyrus.uml.profile.types.generator.ui.generateElementTypes"
- label="Element Types..."
+ label="Generate Element Types..."
style="push">
<visibleWhen
checkEnabled="false">
@@ -36,7 +33,6 @@
name="additions"
visible="false">
</separator>
- </menu>
</menuContribution>
</extension>
<extension
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.assistants.codegen/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.dev.assistants.codegen/plugin.xml
index 6a31924d162..c3cf33144da 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.assistants.codegen/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.assistants.codegen/plugin.xml
@@ -20,7 +20,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.ui.popup.any">
+ locationURI="popup:org.eclipse.papyrus.custo.editors">
<command
commandId="org.eclipse.papyrus.dev.assistants.codegen.generateAssistantsFromElementTypes"
id="org.eclipse.papyrus.dev.assistants.codegen.menus.generateAssistantsFromElementTypes"
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/META-INF/MANIFEST.MF b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/META-INF/MANIFEST.MF
index 3969868ada7..be9ce2ee899 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.core.filesystem;bundle-version="[1.7.0,2.0.0)",
org.eclipse.xtend.lib;bundle-version="[2.22.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 4.0.0.qualifier
+Bundle-Version: 4.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/plugin.xml
index 9d0f7c94998..ace6e97d911 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.dev.ui.menu">
+ locationURI="popup:org.eclipse.papyrus.custo.framework">
<command
commandId="org.eclipse.papyrus.infra.dev.types.commands.migrateTypesConfigurations"
id="org.eclipse.papyrus.infra.dev.types.menus.migrateTypesConfigurations"
@@ -29,7 +29,7 @@
</menuContribution>
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.dev.ui.menu">
+ locationURI="popup:org.eclipse.papyrus.custo.framework">
<command
commandId="org.eclipse.papyrus.infra.dev.types.commands.generateElementTypesRegistry"
id="org.eclipse.papyrus.infra.dev.types.menus.generateElementTypesRegistry"
@@ -53,7 +53,7 @@
</menuContribution>
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.dev.ui.menu">
+ locationURI="popup:org.eclipse.papyrus.custo.framework">
<command
commandId="org.eclipse.papyrus.infra.dev.types.commands.migrateSpecializations"
id="org.eclipse.papyrus.infra.dev.types.menus.migrateSpecializations"
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/pom.xml b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/pom.xml
index c8d06a6380d..31aca283712 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.types/pom.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.types/pom.xml
@@ -8,7 +8,7 @@
</parent>
<artifactId>org.eclipse.papyrus.dev.types</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/META-INF/MANIFEST.MF b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/META-INF/MANIFEST.MF
index 1d3f9ba399d..d48e3aed130 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)",
org.eclipse.papyrus.infra.core.log;bundle-version="[2.0.0,3.0.0)",
org.eclipse.ui;bundle-version="[3.117.0,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Eclipse-BuddyPolicy: dependent
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.dev.ui.Activator
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/plugin.xml
index 3f9ff2ba32a..8da0a3561b2 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/plugin.xml
@@ -27,6 +27,16 @@
visible="true"
id="org.eclipse.papyrus.dev.ui.menu.separator.after">
</separator>
+ <menu
+ id="org.eclipse.papyrus.dev.ui.framework"
+ label="Framework"
+ tooltip="Papyrus framework developer menu">
+ </menu>
+ <menu
+ id="org.eclipse.papyrus.dev.ui.editors"
+ label="Editors"
+ tooltip="Papyrus editors developer menu">
+ </menu>
</menu>
</menuContribution>
</extension>
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/pom.xml b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/pom.xml
index bd1a9957d79..470e35a5b3e 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/pom.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.dev.ui/pom.xml
@@ -12,7 +12,7 @@
<artifactId>org.eclipse.papyrus.dev.ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<description>A plugin to hold the menu for developer tools.</description>
</project>
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml
index e187ce1859b..4d77c81235e 100755
--- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml
@@ -14,7 +14,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.uml.profile.types.generator.ui.generateMenu?after=additions">
+ locationURI="popup:org.eclipse.papyrus.dev.ui.framework">
<command
commandId="org.eclipse.papyrus.toolsmiths.expressions.createExpressionsForUMLProfile"
icon="icons/ExpressionCatalog.gif"
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.palette/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.palette/plugin.xml
index a35158c6b63..2a8d36ddbad 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.palette/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.palette/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ locationURI="popup:org.eclipse.papyrus.custo.editors">
<command
commandId="org.eclipse.papyrus.customization.palette.extended.undeploy"
icon="icons/configuration.gif"
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/META-INF/MANIFEST.MF b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/META-INF/MANIFEST.MF
index bf770bee2ee..870b2b16cf3 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/META-INF/MANIFEST.MF
@@ -25,7 +25,7 @@ Export-Package: org.eclipse.papyrus.toolsmiths.factory,
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.toolsmiths.Activator
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml
index 6e4ac61cfb7..6654bf6fa0d 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml
@@ -71,6 +71,39 @@
factory="org.eclipse.papyrus.toolsmiths.factory.PropertyViewEnvironmentExtensionFactory">
</factory>
</extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ id="org.eclipse.papyrus.custo.menu"
+ label="Papyrus Customization"
+ icon="platform:/plugin/org.eclipse.papyrus.dev.ui/icons/papyrus/Papyrus_16x16.gif"
+ tooltip="Papyrus Customization Menu">
+ <menu
+ id="org.eclipse.papyrus.custo.framework"
+ label="Framework"
+ tooltip="Papyrus framework customization menu">
+ </menu>
+ <menu
+ id="org.eclipse.papyrus.custo.editors"
+ label="Editors"
+ tooltip="Papyrus editors customization menu">
+ </menu>
+ <menu
+ id="org.eclipse.papyrus.custo.modelexplorer"
+ label="Model Explorer"
+ tooltip="Papyrus model explorer customization menu">
+ </menu>
+ <menu
+ id="org.eclipse.papyrus.custo.propertiesview"
+ label="Properties view"
+ tooltip="Papyrus properties view customization menu">
+ </menu>
+ </menu>
+ </menuContribution>
+ </extension>
</plugin>
diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/pom.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/pom.xml
index e9ba325349d..5a44668f17e 100644
--- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/pom.xml
+++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.toolsmiths</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
index 3925902b504..085aca004af 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2017 CEA LIST.
+ * Copyright (c) 2011, 2017, 2022 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -11,8 +11,9 @@
*
* Contributors:
*
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
* Fanch Bonnabesse (ALL4TEC) fanch.bonnabesse@alltec.net - Bug 515122
+ * Ansgar Radermacher (CEA) - Bug 580557, InterfaceRealization element disappears
*
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.command;
@@ -78,6 +79,18 @@ public class InterfaceRealizationReorientCommand extends DependencyReorientComma
return (InterfaceRealization) getElementToEdit();
}
+ @Override
+ protected CommandResult reorientSource() throws ExecutionException {
+ if (getNewSource() instanceof BehavioredClassifier) {
+ // add interface-realization to new container (behaviored-classifier). If
+ // the old source is removed from the "client" list of the relationship, the
+ // interface realization is detached from its container otherwise (bug 580557).
+ BehavioredClassifier bClassifier = (BehavioredClassifier) getNewSource();
+ bClassifier.getInterfaceRealizations().add(getLink());
+ }
+ return super.reorientSource();
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/META-INF/MANIFEST.MF b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/META-INF/MANIFEST.MF
index 68bf443bc57..a087269c50d 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/META-INF/MANIFEST.MF
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/META-INF/MANIFEST.MF
@@ -26,7 +26,7 @@ Export-Package: org.eclipse.papyrus.uml.profile.drafter,
org.eclipse.papyrus.uml.profile.drafter.utils
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 2.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/pom.xml b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/pom.xml
index 20b0dd0c2e6..50f7bdbbdf4 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/pom.xml
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.profile.drafter</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/PropertiesEditorWidget.java b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/PropertiesEditorWidget.java
index e00745d3a8d..1e9d3da7cfa 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/PropertiesEditorWidget.java
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/PropertiesEditorWidget.java
@@ -18,19 +18,18 @@ package org.eclipse.papyrus.uml.profile.drafter.ui.dialog;
import java.util.List;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.beans.IBeanValueProperty;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.core.databinding.observable.map.IObservableMap;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.property.value.IValueProperty;
import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
import org.eclipse.jface.databinding.viewers.ObservableValueEditingSupport;
-import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.databinding.viewers.typed.ViewerProperties;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnLabelProvider;
@@ -72,6 +71,7 @@ import org.eclipse.uml2.uml.Type;
/**
* A widget used to edit a list of {@link PropertyModel}.
+ *
* @author dumoulin
*
*/
@@ -79,10 +79,10 @@ public class PropertiesEditorWidget {
private DataBindingContext m_bindingContext;
private Composite contentArea;
-// private List<PropertyModel> properties;
+ // private List<PropertyModel> properties;
private WritableList properties;
private NamedElement selectedElement;
-
+
private TableViewer treeViewer;
private TableViewerColumn nameViewerColumn;
private TableViewerColumn typeViewerColumn;
@@ -102,79 +102,82 @@ public class PropertiesEditorWidget {
* The catalog of type associated to this class. Lazy creation.
*/
private ITypeCatalog typeCatalog;
-
+
/**
* Library of UML Primitive types. Lazy loading.
*/
private UMLPrimitiveTypesModel umlPrimitiveTypesLibrary;
-
+
/**
* Create the composite.
+ *
* @param parent
- * @param stereotype The stereotype defining the taggedValues
- * @param selectedElement The uml {@link NamedElement} for which taggedValue are edited
- *
+ * @param stereotype
+ * The stereotype defining the taggedValues
+ * @param selectedElement
+ * The uml {@link NamedElement} for which taggedValue are edited
+ *
* @wbp.parser.entryPoint
*/
public PropertiesEditorWidget(Composite parent, List<PropertyModel> properties, NamedElement selectedElement) {
-// this.properties = Properties.selfList(PropertyModel.class).observe(properties);
- if( properties instanceof WritableList) {
- this.properties = (WritableList)properties;
- }
- else {
+ // this.properties = Properties.selfList(PropertyModel.class).observe(properties);
+ if (properties instanceof WritableList) {
+ this.properties = (WritableList) properties;
+ } else {
this.properties = new WritableList(properties, PropertyModel.class);
}
this.selectedElement = selectedElement;
createContent(parent);
}
-
+
/**
- * @param stereotype the stereotype to set
+ * @param stereotype
+ * the stereotype to set
*/
- public void setProperties( List<PropertyModel> properties) {
-// this.properties = Properties.selfList(PropertyModel.class).observe(properties);
- if( properties instanceof WritableList) {
- this.properties = (WritableList)properties;
- }
- else {
+ public void setProperties(List<PropertyModel> properties) {
+ // this.properties = Properties.selfList(PropertyModel.class).observe(properties);
+ if (properties instanceof WritableList) {
+ this.properties = (WritableList) properties;
+ } else {
this.properties = new WritableList(properties, PropertyModel.class);
}
-// treeViewer.setInput(properties);
+ // treeViewer.setInput(properties);
}
/**
* Create the overall component.
+ *
* @param parent
*/
protected void createContent(Composite parent) {
contentArea = createContentArea(parent);
-
+
// now lets bind the values
- // No extra label provider / content provider / setInput required
-// WritableList input;
-// if( properties instanceof WritableList ) {
-// input = (WritableList)properties;
-// }
-// else {
-// input = new WritableList(properties, PropertyModel.class);
-// }
-// ViewerSupport.bind(treeViewer,
-// input,
-// BeanProperties.values(new String[] { "proposedName", "type", "modelStatus", "value" }));
-
-
-// fillContentArea();
-// createDialogContents();
+ // No extra label provider / content provider / setInput required
+ // WritableList input;
+ // if( properties instanceof WritableList ) {
+ // input = (WritableList)properties;
+ // }
+ // else {
+ // input = new WritableList(properties, PropertyModel.class);
+ // }
+ // ViewerSupport.bind(treeViewer,
+ // input,
+ // BeanProperties.values(new String[] { "proposedName", "type", "modelStatus", "value" }));
+
+
+ // fillContentArea();
+ // createDialogContents();
}
-
+
/**
* Create the content area.
- *
+ *
* @param parent
* @return
*/
@@ -185,87 +188,88 @@ public class PropertiesEditorWidget {
layout.makeColumnsEqualWidth = true;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
+
Composite tableTitle = new Composite(composite, SWT.NONE);
tableTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
tableTitle.setLayout(new FillLayout(SWT.HORIZONTAL));
-
+
Label label = new Label(tableTitle, SWT.NONE);
label.setText("Properties");
-
+
Button addPropertyButton = new Button(tableTitle, SWT.NONE);
addPropertyButton.setText("+");
addPropertyButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addPropertyPressed(e);
- }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ addPropertyPressed(e);
+ }
+
+ });
+
- });
-
-
Button removePropertyButton = new Button(tableTitle, SWT.NONE);
removePropertyButton.setText("-");
removePropertyButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removePropertyPressed(e);
- }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ removePropertyPressed(e);
+ }
- });
-
- treeViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION );
+ });
+
+ treeViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
Table tree = treeViewer.getTable();
GridData gd_tree = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
gd_tree.minimumHeight = 100;
tree.setLayoutData(gd_tree);
-
+
nameViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn NameTableColumn = nameViewerColumn.getColumn();
NameTableColumn.setWidth(100);
NameTableColumn.setText("name");
-// treeViewerColumn.setLabelProvider( new TaggedValueNameColumnLabelProvider() );
+ // treeViewerColumn.setLabelProvider( new TaggedValueNameColumnLabelProvider() );
// Type column
typeViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn typeTableColumn = typeViewerColumn.getColumn();
typeTableColumn.setWidth(100);
typeTableColumn.setText("type");
-
+
statusViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn statusTableColumn = statusViewerColumn.getColumn();
statusTableColumn.setWidth(67);
statusTableColumn.setText("status");
-
+
memberViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn memberTableColumn = memberViewerColumn.getColumn();
memberTableColumn.setWidth(64);
memberTableColumn.setText("member");
-
+
deletedViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn deletedTableColumn = deletedViewerColumn.getColumn();
deletedTableColumn.setWidth(37);
deletedTableColumn.setText("deleted");
-// treeViewerColumn_1.setLabelProvider( new TaggedValueNameColumnLabelProvider() );
-
+ // treeViewerColumn_1.setLabelProvider( new TaggedValueNameColumnLabelProvider() );
+
valueViewerColumn = new TableViewerColumn(treeViewer, SWT.NONE);
TableColumn valueTableColumn = valueViewerColumn.getColumn();
valueTableColumn.setWidth(100);
valueTableColumn.setText("value");
-// treeViewerColumn_2.setLabelProvider( new TaggedValueValueColumnLabelProvider() );
+ // treeViewerColumn_2.setLabelProvider( new TaggedValueValueColumnLabelProvider() );
tree.setHeaderVisible(true);
m_bindingContext = initDataBindings();
-// initManualDataBindings(m_bindingContext);
-
+ // initManualDataBindings(m_bindingContext);
+
return composite;
- }
-
+ }
+
/**
* The add button has been pressed.
+ *
* @param e
*/
private void addPropertyPressed(SelectionEvent e) {
@@ -283,84 +287,85 @@ public class PropertiesEditorWidget {
/**
* The remove button has been pressed.
+ *
* @param e
*/
private void removePropertyPressed(SelectionEvent e) {
ISelection selection = treeViewer.getSelection();
- if( selection instanceof IStructuredSelection ) {
- IStructuredSelection structSelection = (IStructuredSelection)selection;
- removeProperty((PropertyModel)structSelection.getFirstElement());
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structSelection = (IStructuredSelection) selection;
+ removeProperty((PropertyModel) structSelection.getFirstElement());
}
}
/**
* remove the specified property from the property list.
- *
- * @param propertyModel model to remove. Can be null.
+ *
+ * @param propertyModel
+ * model to remove. Can be null.
*/
private void removeProperty(PropertyModel propertyModel) {
- if(propertyModel == null) {
+ if (propertyModel == null) {
return;
}
-
- if(propertyModel.getStateKind() == StateKind.created) {
+
+ if (propertyModel.getStateKind() == StateKind.created) {
// We just created it. So we can safely remove
properties.remove(propertyModel);
- }
- else if( propertyModel.getMemberKind() == MemberKind.owned) {
+ } else if (propertyModel.getMemberKind() == MemberKind.owned) {
// We just change the status of the model.
// This is done by sending the delete event
propertyModel.deleteModelEvent();
- }
- else {
+ } else {
// We do not allow removal of other MemberKind
}
-
+
}
private void createDialogContents() {
-
-
+
+
}
/**
* Fill the content area with values found in stereotype.
*/
private void fillContentArea() {
-
-
+
+
}
/**
* Get the name of the taggedValue
+ *
* @author dumoulin
*
*/
public class TaggedValueNameColumnLabelProvider extends ColumnLabelProvider {
-
+
@Override
public String getText(Object element) {
-
- Property property = (Property)element;
+
+ Property property = (Property) element;
return UMLLabelInternationalization.getInstance().getLabel(property);
}
}
-
+
/**
* Get the value of the taggedValue
*
*/
public class TaggedValueValueColumnLabelProvider extends ColumnLabelProvider {
-
+
@Override
public String getText(Object element) {
-
- Property property = (Property)element;
- Object value = selectedElement.getValue((Stereotype)property.getOwner(), property.getName());
-
- if(value instanceof NamedElement) {
- return UMLLabelInternationalization.getInstance().getLabel(((NamedElement)value));
+
+ Property property = (Property) element;
+ Object value = selectedElement.getValue((Stereotype) property.getOwner(), property.getName());
+
+ if (value instanceof NamedElement) {
+ return UMLLabelInternationalization.getInstance().getLabel(((NamedElement) value));
}
// TODO
// collections and arrays
@@ -368,29 +373,29 @@ public class PropertiesEditorWidget {
return value.toString();
}
}
-
+
/**
* Content Provider for TaggedValues hierarchy
*
*/
private class MyContentProvider implements ITreeContentProvider {
- private Object[] EMPTY_ARRAY = new Object[]{};
-
+ private Object[] EMPTY_ARRAY = new Object[] {};
+
@Override
public void dispose() {
-
-
+
+
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
-
+
+
}
/**
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
*
* @param inputElement
@@ -400,13 +405,13 @@ public class PropertiesEditorWidget {
public Object[] getElements(Object inputElement) {
- Stereotype stereotype = (Stereotype)inputElement;
+ Stereotype stereotype = (Stereotype) inputElement;
// Return the stereotype's Properties
return stereotype.getAllAttributes().toArray();
}
/**
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*
* @param parentElement
@@ -417,9 +422,9 @@ public class PropertiesEditorWidget {
return EMPTY_ARRAY;
}
-
+
/**
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*
* @param element
@@ -427,7 +432,7 @@ public class PropertiesEditorWidget {
*/
@Override
public Object getParent(Object element) {
- Property property = (Property)element;
+ Property property = (Property) element;
return property.getOwner();
}
@@ -435,13 +440,13 @@ public class PropertiesEditorWidget {
public boolean hasChildren(Object element) {
return false;
}
-
+
}
-
+
/**
* Returns an ObservableValueEditingSupport instance which binds the given
* cell editor property to the given element property.
- *
+ *
* @param viewer
* the column viewer
* @param dbc
@@ -455,31 +460,34 @@ public class PropertiesEditorWidget {
* the element property to be bound to the cell editor.
* @return an ObservableValueEditingSupport instance using the given
* arguments.
- * copied from org.eclipse.jface.databinding.viewers.ObservableValueEditingSupport.create(ColumnViewer, DataBindingContext, CellEditor, IValueProperty, IValueProperty)
+ * copied from org.eclipse.jface.databinding.viewers.ObservableValueEditingSupport.create(ColumnViewer, DataBindingContext, CellEditor, IValueProperty, IValueProperty)
*/
protected static EditingSupport create(ColumnViewer viewer, DataBindingContext dbc, final CellEditor cellEditor,
final IValueProperty cellEditorProperty,
final IValueProperty elementProperty) {
return new ObservableValueEditingSupport(viewer, dbc) {
- protected IObservableValue doCreateCellEditorObservable( CellEditor cellEditor) {
- //WidgetProperties.text(SWT.Modify).observe(cellEditor.getControl());
- if( cellEditor instanceof ComboBoxViewerCellEditor) {
- return cellEditorProperty.observe(((ComboBoxViewerCellEditor)cellEditor).getViewer() );
+ @Override
+ protected IObservableValue doCreateCellEditorObservable(CellEditor cellEditor) {
+ // WidgetProperties.text(SWT.Modify).observe(cellEditor.getControl());
+ if (cellEditor instanceof ComboBoxViewerCellEditor) {
+ return cellEditorProperty.observe(((ComboBoxViewerCellEditor) cellEditor).getViewer());
}
-
+
return cellEditorProperty.observe(cellEditor.getControl());
}
- protected IObservableValue doCreateElementObservable( Object element, ViewerCell cell) {
+ @Override
+ protected IObservableValue doCreateElementObservable(Object element, ViewerCell cell) {
return elementProperty.observe(element);
}
+ @Override
protected CellEditor getCellEditor(Object element) {
return cellEditor;
}
-
-
+
+
};
}
@@ -487,10 +495,16 @@ public class PropertiesEditorWidget {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
- IObservableMap[] observeMaps = BeansObservables.observeMaps(listContentProvider.getKnownElements(), PropertyModel.class, new String[]{"proposedName", "type", "stateKind", "memberKind", "lifeStatusKind", "value"});
+ String[] propertyNames = new String[] { "proposedName", "type", "stateKind", "memberKind", "lifeStatusKind", "value" };
+ IObservableMap[] observeMaps = new IObservableMap[propertyNames.length];
+ for (int i = 0; i < propertyNames.length; i++) {
+ observeMaps[i] = BeanProperties.value(PropertyModel.class, propertyNames[i]).observeDetail(listContentProvider.getKnownElements());
+ }
+
treeViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps) {
/**
* Handle Type
+ *
* @see org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider#getColumnText(java.lang.Object, int)
*
* @param element
@@ -499,10 +513,10 @@ public class PropertiesEditorWidget {
*/
@Override
public String getColumnText(Object element, int columnIndex) {
-
+
if (columnIndex < attributeMaps.length) {
Object result = attributeMaps[columnIndex].get(element);
- if(result instanceof Type) {
+ if (result instanceof Type) {
return getTypeLabelProvider().getText(result);
}
return result == null ? "" : result.toString(); //$NON-NLS-1$
@@ -510,16 +524,15 @@ public class PropertiesEditorWidget {
return null;
}
});
-
-
-
-
-
-
+
+
+
+
+
treeViewer.setContentProvider(listContentProvider);
//
treeViewer.setInput(properties);
-
+
// Set Cell Editors
//
CellEditor cellEditor_0 = new TextCellEditor(treeViewer.getTable());
@@ -528,57 +541,57 @@ public class PropertiesEditorWidget {
nameViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_0, cellEditorProperty_0, valueProperty_0));
//
// Type column
-// CellEditor cellEditor_1 = new TextCellEditor(treeViewer.getTable());
-// IValueProperty cellEditorProperty = WidgetProperties.text(SWT.Modify);
-// IBeanValueProperty valueProperty_1 = BeanProperties.value("type");
-// treeViewerColumn_1.setEditingSupport(create(treeViewer, bindingContext, cellEditor_1, cellEditorProperty, valueProperty_1));
+ // CellEditor cellEditor_1 = new TextCellEditor(treeViewer.getTable());
+ // IValueProperty cellEditorProperty = WidgetProperties.text(SWT.Modify);
+ // IBeanValueProperty valueProperty_1 = BeanProperties.value("type");
+ // treeViewerColumn_1.setEditingSupport(create(treeViewer, bindingContext, cellEditor_1, cellEditorProperty, valueProperty_1));
// Use a dedicated ComboBox CellEditor for type
ComboBoxViewerCellEditor typeCellEditor = new ComboBoxViewerCellEditor(treeViewer.getTable());
typeCellEditor.setContentProvider(ArrayContentProvider.getInstance());
typeCellEditor.setLabelProvider(getTypeLabelProvider());
typeCellEditor.setInput(getTypeCatalog().getTypes());
// Use a special label provider
-
- IValueProperty typeCellEditorBindAnchor = ViewerProperties.singleSelection();
+
+ IValueProperty typeCellEditorBindAnchor = ViewerProperties.singleSelection();
WidgetProperties.text(SWT.Modify);
IBeanValueProperty typeModelPropertyBindAnchor = BeanProperties.value("type");
typeViewerColumn.setEditingSupport(create(treeViewer, bindingContext, typeCellEditor, typeCellEditorBindAnchor, typeModelPropertyBindAnchor));
//
CellEditor cellEditor_2 = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorProperty_1 = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorProperty_1 = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valueProperty_2 = BeanProperties.value("stateKind");
statusViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_2, cellEditorProperty_1, valueProperty_2));
//
CellEditor cellEditor_3 = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorProperty_2 = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorProperty_2 = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valueProperty_3 = BeanProperties.value("value");
valueViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_3, cellEditorProperty_2, valueProperty_3));
//
//
CellEditor cellEditor_member = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorPropertyMember = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorPropertyMember = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valuePropertyMember = BeanProperties.value("memberKind");
memberViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_member, cellEditorPropertyMember, valuePropertyMember));
//
CellEditor cellEditor_del = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorPropertyDel = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorPropertyDel = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valuePropertyDel = BeanProperties.value("lifeStatusKind");
memberViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_del, cellEditorPropertyDel, valuePropertyDel));
-
-
-
+
+
+
return bindingContext;
}
-
+
/**
* Return the {@link TypeLabelProvider} associated to this class.
- *
+ *
* @return
*/
private ILabelProvider getTypeLabelProvider() {
- if( typeLabelProvider == null) {
+ if (typeLabelProvider == null) {
typeLabelProvider = new TypeLabelProvider();
}
return typeLabelProvider;
@@ -586,11 +599,11 @@ public class PropertiesEditorWidget {
/**
* Return the {@link ITypeCatalog} associated to this class.
- *
+ *
* @return
*/
private ITypeCatalog getTypeCatalog() {
- if( typeCatalog == null) {
+ if (typeCatalog == null) {
typeCatalog = new AccessibleTypeCatalog(selectedElement, getUMLPrimitiveTypeLibrary());
}
return typeCatalog;
@@ -598,13 +611,14 @@ public class PropertiesEditorWidget {
/**
* Get the Library of UML Primitive types. Lookup in the {@link ResourceSet} associated to the selected NamedElement.
- *
+ *
* @return the library found.
- *
- * @throws UnsupportedOperationException If the Library can't be found in the associated {@link ResourceSet}.
+ *
+ * @throws UnsupportedOperationException
+ * If the Library can't be found in the associated {@link ResourceSet}.
*/
private UMLPrimitiveTypesModel getUMLPrimitiveTypeLibrary() {
- if( umlPrimitiveTypesLibrary == null) {
+ if (umlPrimitiveTypesLibrary == null) {
// Create primitiveTypeModel from the ResourceSet associated to the element.
// It will be used to add such types.
try {
@@ -621,6 +635,7 @@ public class PropertiesEditorWidget {
/**
* Additional databinding done manually.
+ *
* @param bindingContext
* @return
*/
@@ -633,17 +648,17 @@ public class PropertiesEditorWidget {
nameViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_0, cellEditorProperty_0, valueProperty_0));
//
CellEditor cellEditor_1 = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorProperty = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorProperty = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valueProperty_1 = BeanProperties.value("type");
typeViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_1, cellEditorProperty, valueProperty_1));
//
CellEditor cellEditor_2 = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorProperty_1 = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorProperty_1 = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valueProperty_2 = BeanProperties.value("modelStatus");
statusViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_2, cellEditorProperty_1, valueProperty_2));
//
CellEditor cellEditor_3 = new TextCellEditor(treeViewer.getTable());
- IValueProperty cellEditorProperty_2 = WidgetProperties.text(SWT.Modify);
+ IValueProperty cellEditorProperty_2 = WidgetProperties.text(SWT.Modify);
IBeanValueProperty valueProperty_3 = BeanProperties.value("value");
valueViewerColumn.setEditingSupport(create(treeViewer, bindingContext, cellEditor_3, cellEditorProperty_2, valueProperty_3));
//
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialog.java b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialog.java
index 41f383934ef..eabd028ecfa 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialog.java
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialog.java
@@ -4,10 +4,10 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
@@ -39,7 +39,7 @@ import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
/**
- *
+ *
* @author cedric dumoulin
*
*/
@@ -52,28 +52,31 @@ public class StereotypeUpdateDialog extends Dialog {
private StereotypeUpdateArgs value;
private MultipleValueSelectorWidget extendedMetaclassSelector;
private PropertiesEditorWidget propertiesEditorWidget;
-
+
/**
* An UML Element used to get the associated Resource.
*/
private Element anyUmlElement;
private List<Class> selectedMetaclasses;
-
-// private StereotypeNameToProfileSynchronizer stereotypeNameToProfileSynchronizer;
+
+ // private StereotypeNameToProfileSynchronizer stereotypeNameToProfileSynchronizer;
private StereoptypeModel stereotypeModel;
private ProfileCatalog profileCatalog;
private Label quickSetLabel;
private Label profileNameLabel;
-
+
/**
* Create the dialog.
+ *
* @param parentShell
- * @param selectedElement Any UML element that can be used to discover the ResourceSet.
- * @param metaclassesToSelect Metaclasses that should be selected in the dialog.
- *
+ * @param selectedElement
+ * Any UML element that can be used to discover the ResourceSet.
+ * @param metaclassesToSelect
+ * Metaclasses that should be selected in the dialog.
+ *
*/
- public StereotypeUpdateDialog(Shell parentShell, String title, Element selectedElement, List<Class> metaclassesToSelect ) {
+ public StereotypeUpdateDialog(Shell parentShell, String title, Element selectedElement, List<Class> metaclassesToSelect) {
super(parentShell);
// Allows dialog resize
setShellStyle(getShellStyle() | SWT.RESIZE);
@@ -82,76 +85,79 @@ public class StereotypeUpdateDialog extends Dialog {
this.selectedMetaclasses = metaclassesToSelect;
this.profileCatalog = new ProfileCatalog(selectedElement);
stereotypeModel = new StereoptypeModel(profileCatalog, selectedElement);
-// stereotypeNameToProfileSynchronizer = new StereotypeNameToProfileSynchronizer(profileCatalog);
-
+ // stereotypeNameToProfileSynchronizer = new StereotypeNameToProfileSynchronizer(profileCatalog);
+
}
/**
* Create contents of the dialog.
+ *
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
-
+
Composite namesContainer = new Composite(container, SWT.NONE);
namesContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
namesContainer.setLayout(new GridLayout(2, false));
-
+
quickSetLabel = new Label(namesContainer, SWT.NONE);
quickSetLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
quickSetLabel.setText("Qualified Name");
-
+
quickSetText = new Text(namesContainer, SWT.BORDER);
quickSetText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
installContentAssistantProvider(quickSetText, new PossibleStereotypeContentProposalProvider(anyUmlElement));
-
+
profileNameLabel = new Label(namesContainer, SWT.NONE);
profileNameLabel.setSize(43, 20);
profileNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
profileNameLabel.setText("Profile");
-
+
profileText = new Text(namesContainer, SWT.BORDER);
profileText.setSize(201, 26);
profileText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
+
Label stereotypeNameLabel = new Label(namesContainer, SWT.NONE);
stereotypeNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
stereotypeNameLabel.setText("Stereotype");
-
+
stereotypeText = new Text(namesContainer, SWT.BORDER);
stereotypeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
installContentAssistantProvider(stereotypeText, new StereotypeContentProposalProvider(anyUmlElement.getApplicableStereotypes()));
-
-// Composite extendedMetaclassesContainer = new Composite(container, SWT.NONE);
-// extendedMetaclassesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-// extendedMetaclassesContainer.setLayout(new GridLayout(1, false));
+
+ // Composite extendedMetaclassesContainer = new Composite(container, SWT.NONE);
+ // extendedMetaclassesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ // extendedMetaclassesContainer.setLayout(new GridLayout(1, false));
createExtendedMetaclassArea(container);
-
+
Composite extendedStereotypeContainer = new Composite(container, SWT.NONE);
extendedStereotypeContainer.setLayout(new GridLayout(1, false));
extendedStereotypeContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
+
Composite taggedValuesContainer = new Composite(container, SWT.NONE);
taggedValuesContainer.setLayout(new GridLayout(1, false));
taggedValuesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
// Use the first applied stereotype for tests
- propertiesEditorWidget = new PropertiesEditorWidget(taggedValuesContainer, stereotypeModel.getProperties(), (NamedElement)anyUmlElement);
+ propertiesEditorWidget = new PropertiesEditorWidget(taggedValuesContainer, stereotypeModel.getProperties(), (NamedElement) anyUmlElement);
return container;
}
/**
* Install content assistant provider.
- *
- * @param control The control to which content assist is installed.
*
- * @param contentProposalProvider The associated {@link ContentProposalAdapter}.
+ * @param control
+ * The control to which content assist is installed.
+ *
+ * @param contentProposalProvider
+ * The associated {@link ContentProposalAdapter}.
*/
protected void installContentAssistantProvider(Text control, IContentProposalProvider contentProposalProvider) {
-// KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space");
+ // KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space");
KeyStroke keyStroke = null;
char[] autoActivationCharacters = null;
int autoActivationDelay = 500;
@@ -165,20 +171,20 @@ public class StereotypeUpdateDialog extends Dialog {
// replace all text
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- //this listener is activated when a stereotype item in popup menu is selected and
- //the popup menu is closed. It is used to add the selected stereotype in to the right hand side part
- //of the dialog, so that uers can economize one key hit.
- //cf. proposalAccepted() operation in KeyTextListener
-// adapter.addContentProposalListener(keyTextListener);
+ // this listener is activated when a stereotype item in popup menu is selected and
+ // the popup menu is closed. It is used to add the selected stereotype in to the right hand side part
+ // of the dialog, so that uers can economize one key hit.
+ // cf. proposalAccepted() operation in KeyTextListener
+ // adapter.addContentProposalListener(keyTextListener);
}
/**
- *
+ *
* @param parent
*/
private void createExtendedMetaclassArea(Composite parent) {
-
+
ReferenceSelector selector = new ReferenceSelector(true);
selector.setContentProvider(new UMLMetaclassContentProvider(anyUmlElement));
LabelProviderService serv = null;
@@ -190,26 +196,27 @@ public class StereotypeUpdateDialog extends Dialog {
ILabelProvider labelProvider = serv.getLabelProvider();
selector.setLabelProvider(labelProvider);
- // EList<PackageableElement> importedElement = profile.getImportedElements();
- //we don't set initial selection to allows to draw new instance of imported metaclass
-// final List<EObject> alreadyImportedElement = new ArrayList<EObject>();
-// for(final PackageableElement current : selectedMetaclasses){
-// if(current instanceof Class && ((Class)current).isMetaclass()){
-// alreadyImportedElement.add(current);
-// }
-// }
+ // EList<PackageableElement> importedElement = profile.getImportedElements();
+ // we don't set initial selection to allows to draw new instance of imported metaclass
+ // final List<EObject> alreadyImportedElement = new ArrayList<EObject>();
+ // for(final PackageableElement current : selectedMetaclasses){
+ // if(current instanceof Class && ((Class)current).isMetaclass()){
+ // alreadyImportedElement.add(current);
+ // }
+ // }
// Create the selector widget
extendedMetaclassSelector = new MultipleValueSelectorWidget(parent, selector);
-// final MultipleValueSelectorDialog dialog = new MultipleValueSelectorDialog(Display.getDefault().getActiveShell(), selector, Messages.CustomSemanticCreateCommand_SelectMetaclass, true, false, -1);
+ // final MultipleValueSelectorDialog dialog = new MultipleValueSelectorDialog(Display.getDefault().getActiveShell(), selector, Messages.CustomSemanticCreateCommand_SelectMetaclass, true, false, -1);
// Do not need a context element: no operations allowed.
-// extendedMetaclassSelector.setContextElement(profile);
+ // extendedMetaclassSelector.setContextElement(profile);
extendedMetaclassSelector.setLabelProvider(labelProvider);
extendedMetaclassSelector.setInitialElementSelections(selectedMetaclasses);
-
+
}
/**
* Create contents of the button bar.
+ *
* @param parent
*/
@Override
@@ -220,19 +227,19 @@ public class StereotypeUpdateDialog extends Dialog {
IDialogConstants.CANCEL_LABEL, false);
m_bindingContext = initDataBindings();
}
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- @Override
+
+ /**
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (title != null) {
+ super.configureShell(shell);
+ if (title != null) {
shell.setText(title);
}
- }
+ }
/**
@@ -240,13 +247,13 @@ public class StereotypeUpdateDialog extends Dialog {
*/
@Override
protected Point getInitialSize() {
-// return super.getInitialSize();
+ // return super.getInitialSize();
return new Point(900, 900);
}
/**
* Collect user data when the ok button is pressed.
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*
*/
@@ -255,41 +262,43 @@ public class StereotypeUpdateDialog extends Dialog {
collectInput();
super.okPressed();
}
-
+
/**
* Collect data from the dialog.
- *
+ *
*/
private void collectInput() {
-
+
// Old fashion
value = new StereotypeUpdateArgs();
value.setProfileName(profileText.getText());
value.setStereotypeName(stereotypeText.getText());
-
+
// Copy the result (to bypass cast pb)
- List<Class> result = new ArrayList<Class>();
- for(Object obj : extendedMetaclassSelector.getResult()) {
- result.add((Class)obj);
+ List<Class> result = new ArrayList<>();
+ for (Object obj : extendedMetaclassSelector.getResult()) {
+ result.add((Class) obj);
}
value.setExtendedMetaclasses(result);
-
+
// New fashion
// Stereotype and profile names are already set in model.
// Need to collect metaclasses
MetaclassesModel metaclassesModel = stereotypeModel.getMetaclassesCollection();
- for(Object obj : extendedMetaclassSelector.getResult()) {
- metaclassesModel.getSelectedMetaclasses().add((Class)obj);
+ for (Object obj : extendedMetaclassSelector.getResult()) {
+ metaclassesModel.getSelectedMetaclasses().add((Class) obj);
}
}
/**
* return the update args collected by the dialog.
+ *
* @return
*/
public IStereotypeUpdateArgs getUpdateArgs() {
return value;
}
+
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
@@ -308,7 +317,7 @@ public class StereotypeUpdateDialog extends Dialog {
return bindingContext;
}
-
+
/**
* @return the stereotypeModel
*/
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialogOld.java b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialogOld.java
index 4ceb6f75eac..86ac8ff0790 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialogOld.java
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/ui/dialog/StereotypeUpdateDialogOld.java
@@ -6,11 +6,11 @@ import java.util.List;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.beans.PojoProperties;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
+import org.eclipse.core.databinding.beans.typed.PojoProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
@@ -40,7 +40,7 @@ import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Stereotype;
/**
- *
+ *
* @author cedric dumoulin
*
*/
@@ -57,25 +57,28 @@ public class StereotypeUpdateDialogOld extends Dialog {
private StereotypeUpdateArgs value;
private MultipleValueSelectorWidget extendedMetaclassSelector;
private TaggedValuesEditorWidget taggedValuesEditorWidget;
-
+
/**
* An UML Element used to get the associated Resource.
*/
private Element anyUmlElement;
private List<Class> selectedMetaclasses;
-
+
private StereotypeNameToProfileSynchronizer stereotypeNameToProfileSynchronizer;
private ProfileCatalog profileCatalog;
-
+
/**
* Create the dialog.
+ *
* @param parentShell
- * @param selectedElement Any UML element that can be used to discover the ResourceSet.
- * @param metaclassesToSelect Metaclasses that should be selected in the dialog.
- *
+ * @param selectedElement
+ * Any UML element that can be used to discover the ResourceSet.
+ * @param metaclassesToSelect
+ * Metaclasses that should be selected in the dialog.
+ *
*/
- public StereotypeUpdateDialogOld(Shell parentShell, String title, Element selectedElement, List<Class> metaclassesToSelect ) {
+ public StereotypeUpdateDialogOld(Shell parentShell, String title, Element selectedElement, List<Class> metaclassesToSelect) {
super(parentShell);
// Allows dialog resize
setShellStyle(getShellStyle() | SWT.RESIZE);
@@ -84,11 +87,12 @@ public class StereotypeUpdateDialogOld extends Dialog {
this.selectedMetaclasses = metaclassesToSelect;
this.profileCatalog = new ProfileCatalog(selectedElement);
stereotypeNameToProfileSynchronizer = new StereotypeNameToProfileSynchronizer(profileCatalog);
-
+
}
/**
* Create contents of the dialog.
+ *
* @param parent
*/
@Override
@@ -96,64 +100,66 @@ public class StereotypeUpdateDialogOld extends Dialog {
List<Stereotype> appliedStereotypes = anyUmlElement.getAppliedStereotypes();
Composite container = (Composite) super.createDialogArea(parent);
-
+
Composite namesContainer = new Composite(container, SWT.NONE);
namesContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
namesContainer.setLayout(new GridLayout(2, false));
-
+
Label quickSetLabel = new Label(namesContainer, SWT.NONE);
quickSetLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
quickSetLabel.setText("Quick Set");
-
+
quickSetText = new Text(namesContainer, SWT.BORDER);
quickSetText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
+
Label profileNameLabel = new Label(namesContainer, SWT.NONE);
profileNameLabel.setSize(43, 20);
profileNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
profileNameLabel.setText("Profile");
-
+
profileText = new Text(namesContainer, SWT.BORDER);
profileText.setSize(201, 26);
profileText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
+
Label stereotypeNameLabel = new Label(namesContainer, SWT.NONE);
stereotypeNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
stereotypeNameLabel.setText("Stereotype");
-
+
stereotypeText = new Text(namesContainer, SWT.BORDER);
stereotypeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
installContentAssistantProvider(stereotypeText, new StereotypeContentProposalProvider(anyUmlElement.getApplicableStereotypes()));
-
-// Composite extendedMetaclassesContainer = new Composite(container, SWT.NONE);
-// extendedMetaclassesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-// extendedMetaclassesContainer.setLayout(new GridLayout(1, false));
+
+ // Composite extendedMetaclassesContainer = new Composite(container, SWT.NONE);
+ // extendedMetaclassesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ // extendedMetaclassesContainer.setLayout(new GridLayout(1, false));
createExtendedMetaclassArea(container);
-
+
Composite extendedStereotypeContainer = new Composite(container, SWT.NONE);
extendedStereotypeContainer.setLayout(new GridLayout(1, false));
extendedStereotypeContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
+
Composite taggedValuesContainer = new Composite(container, SWT.NONE);
taggedValuesContainer.setLayout(new GridLayout(1, false));
taggedValuesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
// Use the first applied stereotype for tests
- if( !appliedStereotypes.isEmpty()) {
- taggedValuesEditorWidget = new TaggedValuesEditorWidget(taggedValuesContainer, appliedStereotypes.get(0), (NamedElement)anyUmlElement);
+ if (!appliedStereotypes.isEmpty()) {
+ taggedValuesEditorWidget = new TaggedValuesEditorWidget(taggedValuesContainer, appliedStereotypes.get(0), (NamedElement) anyUmlElement);
}
return container;
}
/**
* Install content assistant provider.
- *
- * @param control The control to which content assist is installed.
*
- * @param contentProposalProvider The associated {@link ContentProposalAdapter}.
+ * @param control
+ * The control to which content assist is installed.
+ *
+ * @param contentProposalProvider
+ * The associated {@link ContentProposalAdapter}.
*/
protected void installContentAssistantProvider(Text control, IContentProposalProvider contentProposalProvider) {
-// KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space");
+ // KeyStroke keyStroke = KeyStroke.getInstance("Ctrl+Space");
KeyStroke keyStroke = null;
char[] autoActivationCharacters = null;
int autoActivationDelay = 500;
@@ -167,20 +173,20 @@ public class StereotypeUpdateDialogOld extends Dialog {
// replace all text
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- //this listener is activated when a stereotype item in popup menu is selected and
- //the popup menu is closed. It is used to add the selected stereotype in to the right hand side part
- //of the dialog, so that uers can economize one key hit.
- //cf. proposalAccepted() operation in KeyTextListener
-// adapter.addContentProposalListener(keyTextListener);
+ // this listener is activated when a stereotype item in popup menu is selected and
+ // the popup menu is closed. It is used to add the selected stereotype in to the right hand side part
+ // of the dialog, so that uers can economize one key hit.
+ // cf. proposalAccepted() operation in KeyTextListener
+ // adapter.addContentProposalListener(keyTextListener);
}
/**
- *
+ *
* @param parent
*/
private void createExtendedMetaclassArea(Composite parent) {
-
+
ReferenceSelector selector = new ReferenceSelector(true);
selector.setContentProvider(new UMLMetaclassContentProvider(anyUmlElement));
LabelProviderService serv = null;
@@ -192,26 +198,27 @@ public class StereotypeUpdateDialogOld extends Dialog {
ILabelProvider labelProvider = serv.getLabelProvider();
selector.setLabelProvider(labelProvider);
- // EList<PackageableElement> importedElement = profile.getImportedElements();
- //we don't set initial selection to allows to draw new instance of imported metaclass
-// final List<EObject> alreadyImportedElement = new ArrayList<EObject>();
-// for(final PackageableElement current : selectedMetaclasses){
-// if(current instanceof Class && ((Class)current).isMetaclass()){
-// alreadyImportedElement.add(current);
-// }
-// }
+ // EList<PackageableElement> importedElement = profile.getImportedElements();
+ // we don't set initial selection to allows to draw new instance of imported metaclass
+ // final List<EObject> alreadyImportedElement = new ArrayList<EObject>();
+ // for(final PackageableElement current : selectedMetaclasses){
+ // if(current instanceof Class && ((Class)current).isMetaclass()){
+ // alreadyImportedElement.add(current);
+ // }
+ // }
// Create the selector widget
extendedMetaclassSelector = new MultipleValueSelectorWidget(parent, selector);
-// final MultipleValueSelectorDialog dialog = new MultipleValueSelectorDialog(Display.getDefault().getActiveShell(), selector, Messages.CustomSemanticCreateCommand_SelectMetaclass, true, false, -1);
+ // final MultipleValueSelectorDialog dialog = new MultipleValueSelectorDialog(Display.getDefault().getActiveShell(), selector, Messages.CustomSemanticCreateCommand_SelectMetaclass, true, false, -1);
// Do not need a context element: no operations allowed.
-// extendedMetaclassSelector.setContextElement(profile);
+ // extendedMetaclassSelector.setContextElement(profile);
extendedMetaclassSelector.setLabelProvider(labelProvider);
extendedMetaclassSelector.setInitialElementSelections(selectedMetaclasses);
-
+
}
/**
* Create contents of the button bar.
+ *
* @param parent
*/
@Override
@@ -222,19 +229,19 @@ public class StereotypeUpdateDialogOld extends Dialog {
IDialogConstants.CANCEL_LABEL, false);
m_bindingContext = initDataBindings();
}
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- @Override
+
+ /**
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (title != null) {
+ super.configureShell(shell);
+ if (title != null) {
shell.setText(title);
}
- }
+ }
/**
@@ -242,13 +249,13 @@ public class StereotypeUpdateDialogOld extends Dialog {
*/
@Override
protected Point getInitialSize() {
-// return super.getInitialSize();
+ // return super.getInitialSize();
return new Point(900, 900);
}
/**
* Collect user data when the ok button is pressed.
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*
*/
@@ -257,32 +264,34 @@ public class StereotypeUpdateDialogOld extends Dialog {
collectInput();
super.okPressed();
}
-
+
/**
* Collect data from the dialog.
- *
+ *
*/
private void collectInput() {
value = new StereotypeUpdateArgs();
value.setProfileName(profileText.getText());
value.setStereotypeName(stereotypeText.getText());
-
+
// Copy the result (to bypass cast pb)
- List<Class> result = new ArrayList<Class>();
- for(Object obj : extendedMetaclassSelector.getResult()) {
- result.add((Class)obj);
+ List<Class> result = new ArrayList<>();
+ for (Object obj : extendedMetaclassSelector.getResult()) {
+ result.add((Class) obj);
}
value.setExtendedMetaclasses(result);
-
+
}
/**
* return the update args collected by the dialog.
+ *
* @return
*/
public IStereotypeUpdateArgs getUpdateArgs() {
return value;
}
+
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//

Back to the top