Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-11 20:54:48 +0000
committerChristian W. Damus2014-03-11 20:54:48 +0000
commite20612278b0b49dadd45e5421c103a42c365abd0 (patch)
tree21247ff4f8e9efef301f53f83b22262b307ca202 /plugins/uml
parent6c21353faf0dbb249e8c42d0ef3a6c23ff1120ef (diff)
parent12834c9a2f7df6408821bad466425b0ce12f520a (diff)
downloadorg.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.tar.gz
org.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.tar.xz
org.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.zip
Merge branch 'refs/heads/master' into bugs/429826-ro-axes
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/DropTargetListener.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java6
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java1
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java12
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/CommentBodyEditor.java29
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contentassist/UmlPropertyProposalProvider.java9
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java2
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/UMLPropertyEditorPropertyUtil.java1
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/src/org/eclipse/papyrus/uml/textedit/property/xtext/scoping/UmlPropertyScopeProvider.java3
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/contributions/TransitionEditorConfigurationContribution.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/PackageUtil.java18
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/CompletionProposalUtils.java1
29 files changed, 217 insertions, 28 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
index 65e3857eca6..a14c08e0133 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityEdgeFigure.java
@@ -62,6 +62,12 @@ public class ActivityEdgeFigure extends UMLEdgeFigure {
super.createContents();
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* Scale changed from default 7:3 to 5:2 to make a
* smaller arrow
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
index 71ec746e363..b5e26ceab10 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ExceptionHandlerFigure.java
@@ -18,9 +18,9 @@ import org.eclipse.draw2d.PolylineDecoration;
import org.eclipse.draw2d.RotatableDecoration;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
import org.eclipse.gmf.runtime.notation.MeasurementUnit;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
import org.eclipse.swt.graphics.LineAttributes;
import org.eclipse.uml2.uml.ExceptionHandler;
@@ -30,7 +30,7 @@ import org.eclipse.uml2.uml.ExceptionHandler;
* @author arthur daussy
*
*/
-public class ExceptionHandlerFigure extends PolylineConnectionEx {
+public class ExceptionHandlerFigure extends PapyrusEdgeFigure {
/**
* Since the Activity diagram is using Pixel unit we can use this as constant
@@ -45,6 +45,12 @@ public class ExceptionHandlerFigure extends PolylineConnectionEx {
setLineAttributes(new LineAttributes(2));
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
index 9722e84749a..041f46b225e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ControlFlowEditPart.java
@@ -140,6 +140,12 @@ public class ControlFlowEditPart extends UMLConnectionNodeEditPart implements IT
//this.add(fAppliedStereotypeLabel);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
index 823a5baa9d3..5db996afee0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ObjectFlowEditPart.java
@@ -140,6 +140,12 @@ public class ObjectFlowEditPart extends UMLConnectionNodeEditPart implements ITr
//this.add(fAppliedStereotypeLabel);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated NOT scale changed from default 7:3 to 5:2 to make a smaller arrow
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
index 9aa4a5e1372..67c420facbc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/AssociationFigure.java
@@ -54,6 +54,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
/**
* Instantiates a new association figure.
*/
@@ -536,7 +542,16 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
index c00703b98f9..923d2ca431e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/figure/TemplateBindingFigure.java
@@ -50,6 +50,16 @@ public class TemplateBindingFigure extends UMLEdgeFigure {
this.add(bindingSubstitutionFigure);
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
+
/**
*
* @return the label multiline
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
index ad794e547e3..81e30e888e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
@@ -37,4 +37,14 @@ public class GeneralizationFigure extends UMLEdgeFigure {
setForegroundColor(ColorConstants.black);
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(10, 8);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
index 491ce224ef2..58afa4fc074 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
@@ -34,4 +34,14 @@ public class InterfaceRealizationFigure extends DashedEdgeFigure {
this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/DropTargetListener.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/DropTargetListener.java
index eea5043e77d..e10ff7cea22 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/DropTargetListener.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/DropTargetListener.java
@@ -24,7 +24,9 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.Request;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramDropTargetListener;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.services.localizer.IObjectLocalizer;
import org.eclipse.papyrus.infra.services.localizer.util.LocalizerUtil;
import org.eclipse.swt.dnd.Transfer;
@@ -49,6 +51,10 @@ public abstract class DropTargetListener extends DiagramDropTargetListener {
Request r = super.createTargetRequest();
if(r != null && r.getExtendedData() != null) {
r.getExtendedData().put(EVENT_DETAIL, getCurrentEvent().detail);
+ //430099: [Diagram] Snap to Grid for elements dropped from the ModelExplorer is ignored
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=430099
+ boolean isSnapping = ((DiagramGraphicalViewer)getViewer()).getWorkspaceViewerPreferenceStore().getBoolean(PreferencesConstantsHelper.SNAP_TO_GRID_CONSTANT);
+ r.getExtendedData().put(PreferencesConstantsHelper.SNAP_TO_GRID_CONSTANT, isSnapping);
}
return r;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
index 77665e0767c..cfc744c2497 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/figure/edges/UsageDecoration.java
@@ -12,12 +12,14 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.component.custom.figure.edges;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
+
// TODO: Auto-generated Javadoc
/**
* The Class UsageDecoration.
*/
-public class UsageDecoration extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {
+public class UsageDecoration extends PapyrusEdgeFigure {
/**
@@ -28,6 +30,11 @@ public class UsageDecoration extends org.eclipse.gmf.runtime.draw2d.ui.figures.P
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
/**
* Creates the target decoration.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
index 35f64a81e14..cdc42f88bbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/AssociationFigure.java
@@ -55,6 +55,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
/**
* Instantiates a new association figure.
*/
@@ -562,8 +568,16 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
-
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
index bdba98c7cc1..5237e61bba5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/figure/ExtensionFigure.java
@@ -41,4 +41,14 @@ public class ExtensionFigure extends UMLEdgeFigure {
setForegroundColor(ColorConstants.black);
}
+
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.black);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
index 10318a2c2e7..b9d2066c1e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/MessageFigure.java
@@ -55,6 +55,12 @@ public abstract class MessageFigure extends UMLEdgeFigure {
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
public void setLineWidth(int w) {
super.setLineWidth(w);
if(getSourceDecoration() instanceof Shape) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
index f1766c30fbd..9566ef67dbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingEditPart.java
@@ -10,9 +10,9 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.GeneralOrderingItemSemanticEditPolicy;
@@ -105,7 +105,7 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
/**
* @generated
*/
- public class GeneralOrderingDescriptor extends PolylineConnectionEx {
+ public class GeneralOrderingDescriptor extends PapyrusEdgeFigure {
/**
* @generated
@@ -121,6 +121,12 @@ public class GeneralOrderingEditPart extends ConnectionNodeEditPart implements I
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
index ef5c18bc1f7..5d3b80c5f40 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/custom-src/org/eclipse/papyrus/uml/diagram/timing/custom/figures/AbstractMessageFigure.java
@@ -88,6 +88,13 @@ public abstract class AbstractMessageFigure extends UMLEdgeFigure {
}
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(createSourceDecoration());
+ setTargetDecoration(createTargetDecoration());
+ }
+
protected static IMapMode getMapMode() {
return MapModeTypes.IDENTITY_MM;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
index 1dd83aa5efa..536dd69eacd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/custom-src/org/eclipse/papyrus/uml/diagram/usecase/figure/AssociationFigure.java
@@ -47,6 +47,12 @@ public class AssociationFigure extends UMLEdgeFigure {
/** The f role target label. */
private WrappingLabel fRoleTargetLabel;
+ /** Source decoration type */
+ private int sourceType;
+
+ /** Target decoration type */
+ private int targetType;
+
public AssociationFigure() {
super();
setAntialias(SWT.ON);
@@ -135,10 +141,19 @@ public class AssociationFigure extends UMLEdgeFigure {
* the type of end of the association {@link AssociationFigure#navigable}
*/
public void setEnd(int sourceType, int targetType) {
+ this.sourceType = sourceType;
+ this.targetType = targetType;
this.setSourceDecoration(getDecoration(sourceType));
this.setTargetDecoration(getDecoration(targetType));
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setSourceDecoration(getDecoration(sourceType));
+ setTargetDecoration(getDecoration(targetType));
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
index 43985c67c93..178d06fdc72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ExtendEditPart.java
@@ -129,6 +129,12 @@ public class ExtendEditPart extends UMLConnectionNodeEditPart implements ITreeBr
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
index 79129b8cca2..70e17e1438c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/IncludeEditPart.java
@@ -129,6 +129,12 @@ public class IncludeEditPart extends UMLConnectionNodeEditPart implements ITreeB
setTargetDecoration(createTargetDecoration());
}
+ @Override
+ public void resetStyle() {
+ super.resetStyle();
+ setTargetDecoration(createTargetDecoration());
+ }
+
/**
* @generated
*/
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
index b3f878687fc..f67c4a0f95e 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
@@ -106,6 +106,7 @@ public class AdvancedEditingPropertySection extends
@Override
public void dispose() {
super.dispose();
+ ModelListener.currentEditor = null;
if (toolkit != null)
toolkit.dispose();
}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java
index 8e07a4391c7..db8d01c282b 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java
@@ -19,18 +19,16 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
/**
- * Main listener for model changes (registered via plugin.xml). It will delegate
- * to the sub-listeners for specific sub-elements (type, operation, port, ...) that
- * can be found in this package
- *
- * @author ansgar
- *
+ * Main listener for model changes (registered via plugin.xml). It will listen to
+ * change events. If an element that is a child of the element in use by the current editor
+ * changes, it will refresh
*/
public class ModelListener implements IPapyrusListener {
public void notifyChanged(Notification notification) {
Object notifier = notification.getNotifier();
- if (notifier instanceof EObject && currentEditor != null) {
+ if ((!notification.isTouch()) &&
+ (notifier instanceof EObject) && (currentEditor != null)) {
EObject notifierEObj = (EObject) notifier;
while (notifierEObj != null) {
if (notifierEObj == currentEditor.currentEObj) {
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/CommentBodyEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/CommentBodyEditor.java
index 59a7a4e8f0d..732ae2c9e6d 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/CommentBodyEditor.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/CommentBodyEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 430077
*
*****************************************************************************/
package org.eclipse.papyrus.uml.properties.widgets;
@@ -17,10 +18,13 @@ import java.util.Collections;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.papyrus.infra.emf.providers.EMFGraphicalContentProvider;
import org.eclipse.papyrus.uml.tools.namereferences.NameReferencesHelper;
import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
import org.eclipse.papyrus.uml.tools.util.UMLProviderHelper;
+import org.eclipse.papyrus.views.properties.creation.CreationContext;
+import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
import org.eclipse.papyrus.views.properties.modelelement.ModelElement;
import org.eclipse.papyrus.views.properties.widgets.StringMultilineWithReferences;
@@ -44,18 +48,27 @@ public class CommentBodyEditor extends StringMultilineWithReferences {
super.doBinding();
ModelElement element = getInput().getModelElement(getProperty());
+ ResourceSet resourceSet = null;
Resource baseResource = null;
if(element instanceof EMFModelElement) {
- EObject editedElement = ((EMFModelElement)element).getSource();
- if(editedElement != null) {
- baseResource = editedElement.eResource();
+ EMFModelElement emfElement = (EMFModelElement)element;
+ EObject editedElement = emfElement.getSource();
+ resourceSet = (emfElement.getDomain() == null) ? null : emfElement.getDomain().getResourceSet();
+ baseResource = editedElement.eResource();
+
+ if(baseResource == null) {
+ // Editing an object that is not yet added to the model? Try to locate the creation context
+ CreationContext creationContext = EcorePropertyEditorFactory.getCreationContext(editedElement, false);
+ if(creationContext != null) {
+ baseResource = ((EObject)creationContext.getCreationContextElement()).eResource();
+ }
}
-
- if(baseResource != null) {
- SemanticUMLContentProvider semanticProvider = new SemanticUMLContentProvider(editedElement, UMLPackage.eINSTANCE.getComment_Body());
+
+ if(resourceSet != null) {
+ SemanticUMLContentProvider semanticProvider = new SemanticUMLContentProvider(editedElement, UMLPackage.eINSTANCE.getComment_Body(), resourceSet);
semanticProvider.setWantedMetaclasses(Collections.singletonList(UMLPackage.eINSTANCE.getNamedElement()));
- EMFGraphicalContentProvider provider = UMLProviderHelper.encapsulateProvider(semanticProvider, editedElement, UMLPackage.eINSTANCE.getComment_Body(), baseResource.getResourceSet());
+ EMFGraphicalContentProvider provider = UMLProviderHelper.encapsulateProvider(semanticProvider, editedElement, UMLPackage.eINSTANCE.getComment_Body(), resourceSet);
setContentProvider(provider);
setLabelProvider(element.getLabelProvider(propertyPath));
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contentassist/UmlPropertyProposalProvider.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contentassist/UmlPropertyProposalProvider.java
index a8b0fc909e8..cb97ac01a50 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contentassist/UmlPropertyProposalProvider.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contentassist/UmlPropertyProposalProvider.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.MultiplicityR
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.PropertyRule;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.QualifiedName;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.TypeRule;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.papyrus.uml.xtext.integration.CompletionProposalUtils;
import org.eclipse.papyrus.uml.xtext.integration.CustomCompletionProposal;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementUtil;
@@ -50,7 +51,7 @@ import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
* http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on
* how to customize content assistant
*/
-
+@SuppressWarnings("nls")
public class UmlPropertyProposalProvider extends AbstractUmlPropertyProposalProvider {
/**
@@ -96,9 +97,9 @@ public class UmlPropertyProposalProvider extends AbstractUmlPropertyProposalProv
CustomCompletionProposal completionProposal = CompletionProposalUtils.createCompletionProposalWithReplacementOfPrefix(root, completionString, displayString, context);
acceptor.accept(completionProposal);
- // then accepts all packages imported by Model
- List<Package> importedPackages = root.getImportedPackages();
- for(Package p : importedPackages) {
+ // then accept all packages imported by Model
+ List<Package> topLevelPackages = PackageUtil.getTopLevelPackages(root);
+ for(Package p : topLevelPackages) {
if(p.getName().toLowerCase().contains(context.getPrefix().toLowerCase())) {
completionString = p.getName() + "::";
displayString = p.getName() + "::";
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java
index 98860acb908..65776cadde7 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java
@@ -201,7 +201,7 @@ public class PropertyXtextDirectEditorConfiguration extends DefaultXtextDirectEd
DestroyElementRequest destroyDefaultValueRequest = new DestroyElementRequest(property.getDefaultValue(), false);
ICommand destroyDefaultValueCommand = provider.getEditCommand(destroyDefaultValueRequest);
updateCommand.add(destroyDefaultValueCommand);
- } else {
+ } else if (newDefault != null) {
SetRequest setDefaultValueRequest = new SetRequest(property, UMLPackage.eINSTANCE.getProperty_Default(), newDefault);
ICommand setDefaultValueCommand = provider.getEditCommand(setDefaultValueRequest);
updateCommand.add(setDefaultValueCommand);
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/UMLPropertyEditorPropertyUtil.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/UMLPropertyEditorPropertyUtil.java
index 4db9abc488e..726b7618a16 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/UMLPropertyEditorPropertyUtil.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/UMLPropertyEditorPropertyUtil.java
@@ -23,6 +23,7 @@ import org.eclipse.uml2.uml.Property;
public class UMLPropertyEditorPropertyUtil extends PropertyUtil {
+ @SuppressWarnings("nls")
public static String getLabel(Property property) {
StringBuffer buffer = new StringBuffer();
// visibility
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/META-INF/MANIFEST.MF b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/META-INF/MANIFEST.MF
index 5ee10ddbae6..91d4f82ed9c 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/META-INF/MANIFEST.MF
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/META-INF/MANIFEST.MF
@@ -27,7 +27,8 @@ Require-Bundle: org.eclipse.xtext,
org.eclipse.papyrus.infra.gmfdiag.xtext.glue;bundle-version="1.0.0",
org.apache.log4j;bundle-version="1.2.15",
org.eclipse.papyrus.uml.alf.common;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.xtext.integration.core;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.xtext.integration.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/src/org/eclipse/papyrus/uml/textedit/property/xtext/scoping/UmlPropertyScopeProvider.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/src/org/eclipse/papyrus/uml/textedit/property/xtext/scoping/UmlPropertyScopeProvider.java
index e210aaef8ab..e5b3447bdd8 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/src/org/eclipse/papyrus/uml/textedit/property/xtext/scoping/UmlPropertyScopeProvider.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext/src/org/eclipse/papyrus/uml/textedit/property/xtext/scoping/UmlPropertyScopeProvider.java
@@ -25,6 +25,7 @@ import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.QualifiedName
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.RedefinesRule;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.SubsetsRule;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.TypeRule;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementUtil;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Element;
@@ -140,6 +141,8 @@ public class UmlPropertyScopeProvider extends AbstractDeclarativeScopeProvider {
namespaces.add((Namespace)eImport.getImportedElement());
}
}
+ // get top-level packages (imported or not)
+ namespaces.addAll(PackageUtil.getTopLevelPackages(visited));
return namespaces;
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/contributions/TransitionEditorConfigurationContribution.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/contributions/TransitionEditorConfigurationContribution.java
index 9c5d08258fa..a93cac1795f 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/contributions/TransitionEditorConfigurationContribution.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/contributions/TransitionEditorConfigurationContribution.java
@@ -82,7 +82,7 @@ public class TransitionEditorConfigurationContribution extends DefaultXtextDirec
*/
@Override
public int getStyle() {
- return SWT.MULTI;
+ return SWT.MULTI | SWT.WRAP;
}
/*
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/PackageUtil.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/PackageUtil.java
index f8f000c683d..03bc22422d8 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/PackageUtil.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/PackageUtil.java
@@ -27,6 +27,7 @@ import java.util.TreeSet;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
@@ -422,6 +423,23 @@ public class PackageUtil {
}
/**
+ * Return all top-level packages within a resource set.
+ * @param element an element
+ * @return the list of top-level packages
+ */
+ public static List<Package> getTopLevelPackages(Element element) {
+ List<Package> topLevelPackages = new BasicEList<Package>();
+ if (element.eResource() != null) {
+ for (Resource resource : element.eResource().getResourceSet().getResources()) {
+ if ((resource.getContents().size() > 0) && (resource.getContents().get(0) instanceof Package)) {
+ topLevelPackages.add((Package) resource.getContents().get(0));
+ }
+ }
+ }
+ return topLevelPackages;
+ }
+
+ /**
* Returns all accessible Collaboration in the model
*
* @param element
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/CompletionProposalUtils.java b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/CompletionProposalUtils.java
index a701f5c3e31..2c7678d5f2c 100644
--- a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/CompletionProposalUtils.java
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/CompletionProposalUtils.java
@@ -28,6 +28,7 @@ import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
/**
* @author CEA LIST - Initial contribution and API
*/
+@SuppressWarnings("nls")
public class CompletionProposalUtils {
protected final static ILabelProvider labelProvider = DisplayUtils.getLabelProvider() ;

Back to the top