Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tessier2013-10-04 08:41:11 +0000
committerPatrick Tessier2013-10-04 08:41:11 +0000
commitedf36ffe95e2e84a96202b75df85a8f53f00002d (patch)
tree14686131bd7bb319f9ab72127293b386efbe7eca /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz
parentf9b32bdb44861826562138aa315cc5062b0228a3 (diff)
downloadorg.eclipse.papyrus-edf36ffe95e2e84a96202b75df85a8f53f00002d.tar.gz
org.eclipse.papyrus-edf36ffe95e2e84a96202b75df85a8f53f00002d.tar.xz
org.eclipse.papyrus-edf36ffe95e2e84a96202b75df85a8f53f00002d.zip
Applied Patch for R. Chevrel for
Bug 413991 - [SysML Parametric Diagram] Pb with Show hide contents menu - Bug 413992 - [SysML Parametric Diagram] Drag&Drop problem - Bug 413996 - [SysML Parametric Diagram] Pb with Graphical representation of constraint property - Bug 413999 - [SysML Parametric Diagram] Problem with reference properties displayed as parameters - Bug 414005 - [SysML Parametric diagram]Pb with creating a constraint property from Palette - Bug 414013 - [SysML Parametric Diagram] Automatically stereotyping constraint properties - Problem 2 of Bug 415663 - [Parametric Diagrams] Problem with constraints Conflicts: plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/META-INF/MANIFEST.MF15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/commands/ContextLinkCreateCommand.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintLabelEditPart.java13
4 files changed, 29 insertions, 13 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/META-INF/MANIFEST.MF
index c85b5fa077d..e50906190dd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/META-INF/MANIFEST.MF
@@ -1,13 +1,28 @@
Manifest-Version: 1.0
Export-Package: org.eclipse.papyrus.uml.diagram.clazz,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.action,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.command,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.edit.actions,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.edit.commands,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part,
org.eclipse.papyrus.uml.diagram.clazz.custom.factory,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.figure,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.helper,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.helper.advice,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.locator,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.parsers,
org.eclipse.papyrus.uml.diagram.clazz.custom.policies,
org.eclipse.papyrus.uml.diagram.clazz.custom.policies.itemsemantic,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.preferences,
org.eclipse.papyrus.uml.diagram.clazz.custom.providers,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.ui,
+ org.eclipse.papyrus.uml.diagram.clazz.custom.utils,
org.eclipse.papyrus.uml.diagram.clazz.edit.commands,
org.eclipse.papyrus.uml.diagram.clazz.edit.helpers,
org.eclipse.papyrus.uml.diagram.clazz.edit.parts,
org.eclipse.papyrus.uml.diagram.clazz.edit.policies,
+ org.eclipse.papyrus.uml.diagram.clazz.expressions,
+ org.eclipse.papyrus.uml.diagram.clazz.navigator,
org.eclipse.papyrus.uml.diagram.clazz.parsers,
org.eclipse.papyrus.uml.diagram.clazz.part,
org.eclipse.papyrus.uml.diagram.clazz.providers
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
index 7a3d15fc6cc..0546ca454c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
@@ -60,14 +60,17 @@ public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
}
}
View viewSource = findView(source);
+
if(viewSource != null && source instanceof Constraint) {
View viewTarget = findView(target);
List sourceConnections = ViewUtil.getSourceConnections(viewSource);
+
for(Object connector : sourceConnections) {
if(!(connector instanceof Connector)) {
continue;
}
Edge edge = (Edge)connector;
+
if(("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType())) {
if(viewTarget == edge.getTarget()) {
// the context link is already
@@ -77,7 +80,8 @@ public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
}
}
}
- if(getTarget() != null && (getTarget().getOwnedRules().contains(getTarget()))) {
+ if(resolveTargetNamespace() != null && (resolveTargetNamespace().getOwnedRules().contains(resolveTargetNamespace()))) {
+
return false;
}
return true;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/commands/ContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/commands/ContextLinkCreateCommand.java
index e50bb3b50e0..0b1df614131 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/commands/ContextLinkCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/commands/ContextLinkCreateCommand.java
@@ -64,7 +64,7 @@ public class ContextLinkCreateCommand extends EditElementCommand {
return true; // link creation is in progress; source is not defined yet
}
// target may be null here but it's possible to check constraint
- return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintContext_8500(getSource(), getTarget());
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintContext_8500(getSource(), resolveTargetNamespace());
}
/**
@@ -74,8 +74,8 @@ public class ContextLinkCreateCommand extends EditElementCommand {
if(!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if(getSource() != null && getTarget() != null) {
- getSource().setContext(getTarget());
+ if(getSource() != null && resolveTargetNamespace() != null) {
+ getSource().setContext(resolveTargetNamespace());
}
return CommandResult.newOKCommandResult();
}
@@ -97,7 +97,7 @@ public class ContextLinkCreateCommand extends EditElementCommand {
/**
* @generated
*/
- protected Namespace getTarget() {
+ protected Namespace resolveTargetNamespace() {
return (Namespace)target;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintLabelEditPart.java
index 14dbf32d2b9..f99e36a3ab5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintLabelEditPart.java
@@ -103,11 +103,6 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
private List<?> parserElements;
/**
- * @generated
- */
- private String defaultText;
-
- /**
* direct edition mode (default, undefined, registered editor, etc.)
*
* @generated
@@ -209,7 +204,6 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
public void setLabel(WrappingLabel figure) {
unregisterVisuals();
setFigure(figure);
- defaultText = getLabelTextHelper(figure);
registerVisuals();
refreshVisuals();
}
@@ -217,6 +211,7 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
/**
* @generated
*/
+ @SuppressWarnings("rawtypes")
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -258,8 +253,8 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
if(parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
- text = defaultText;
+ if(text == null) {
+ text = "";
}
return text;
}
@@ -302,6 +297,7 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
+ @SuppressWarnings("rawtypes")
public String isValid(final Object value) {
if(value instanceof String) {
final EObject element = getParserElement();
@@ -309,6 +305,7 @@ public class ConstraintLabelEditPart extends PapyrusLabelEditPart implements ITe
try {
IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ @SuppressWarnings("unchecked")
public void run() {
setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
}

Back to the top