Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-03-13 09:41:04 +0000
committerAnsgar Radermacher2014-03-13 09:43:42 +0000
commit341b47692a28fae23d7d524efc374c5408832c7e (patch)
treec765b86611431fe20594f85cc9aebea71465689c /plugins/uml
parent601924f9d8b3ee332f20c038fbdf78d93b28a0ca (diff)
downloadorg.eclipse.papyrus-341b47692a28fae23d7d524efc374c5408832c7e.tar.gz
org.eclipse.papyrus-341b47692a28fae23d7d524efc374c5408832c7e.tar.xz
org.eclipse.papyrus-341b47692a28fae23d7d524efc374c5408832c7e.zip
[Bug 427025] [OCL For Papyrus] Cannot create OCL constraints in Luna
Show wait cursor before editing starts Re-activate selection of compartment edit part => enable edit on 2nd click Activate context link tool after constraint creation Enable xtext editor in UML tab of property view (currently for OCL only)
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPart.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPartCN.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintEditPart.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/factory/CustomUMLeditPartFactory.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPart.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPartCN.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/strategy/constraint/ClassifierToConstraintDropStrategy.java107
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/edit/parts/CustomConstraintBodyEditPart.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/edit/parts/CustomConstraintBodyEditPartCN.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/edit/parts/CustomConstraintEditPart.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/custom-src/org/eclipse/papyrus/uml/diagram/profile/custom/factory/CustomUMLeditPartFactory.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/parts/ConstraintBodyEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/parts/ConstraintBodyEditPartCN.java9
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF4
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/plugin.xml7
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/UndoRedoStack.java (renamed from plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/UndoRedoStack.java)2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java264
-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/Model/UML/ui/SingleConstraint.xwt32
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/plugin.xml4
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/ExpressionEditor.java26
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext/plugin.xml12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext/src/org/eclipse/papyrus/uml/textedit/constraintwithessentialocl/xtext/EssentialOCLEditorConfiguration.java28
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext/src/org/eclipse/papyrus/uml/textedit/constraintwithessentialocl/xtext/Messages.java16
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext/src/org/eclipse/papyrus/uml/textedit/constraintwithessentialocl/xtext/OCLLanguageEditorFactory.java5
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext/src/org/eclipse/papyrus/uml/textedit/constraintwithessentialocl/xtext/messages.properties2
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/DefaultXtextDirectEditorConfiguration.java22
29 files changed, 736 insertions, 77 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPart.java
new file mode 100644
index 00000000000..a0938b3fe9f
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPart.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintBodyEditPart;
+
+/**
+ * Custom variant. Automatically changes to context link tool.
+ */
+public class CustomConstraintBodyEditPart extends ConstraintBodyEditPart {
+
+ protected boolean first = true;
+
+ public CustomConstraintBodyEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * don't use isSelectable from @see PapyrusCompartmentEditPart (which returns always false)
+ * @return whether selectable
+ */
+ @Override
+ public boolean isSelectable() {
+ return super.isSelectableOrig();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPartCN.java
new file mode 100644
index 00000000000..c30100d3e98
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintBodyEditPartCN.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintBodyEditPartCN;
+
+/**
+ * Custom variant. Automatically changes to context link tool.
+ */
+public class CustomConstraintBodyEditPartCN extends ConstraintBodyEditPartCN {
+
+ protected boolean first = true;
+
+ public CustomConstraintBodyEditPartCN(View view) {
+ super(view);
+ }
+
+ /**
+ * don't use isSelectable from @see PapyrusCompartmentEditPart (which returns always false)
+ * @return whether selectable
+ */
+ @Override
+ public boolean isSelectable() {
+ return super.isSelectableOrig();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintEditPart.java
index b062c1fe0b7..6481f02fb01 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/edit/part/CustomConstraintEditPart.java
@@ -13,6 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.transaction.RunnableWithResult;
@@ -24,15 +27,21 @@ import org.eclipse.gmf.runtime.common.core.util.Trace;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
+import org.eclipse.uml2.uml.Constraint;
/**
- * @generated
+ * Custom variant. Automatically changes to context link tool.
*/
@SuppressWarnings("restriction")
public class CustomConstraintEditPart extends ConstraintEditPart {
+ protected boolean first = true;
+
public CustomConstraintEditPart(View view) {
super(view);
}
@@ -42,6 +51,17 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
*/
@Override
protected void performDirectEditRequest(Request request) {
+ if (resolveSemanticElement() instanceof Constraint) {
+ Constraint constraint = (Constraint) resolveSemanticElement();
+ if (first && constraint.getContext() == null) {
+ first = false;
+ // instead of editing, open link element tool
+ List<IElementType> elementTypes = new ArrayList<IElementType>();
+ elementTypes.add(UMLElementTypes.ConstraintContext_8500);
+ getEditDomain().setActiveTool(new AspectUnspecifiedTypeConnectionTool(elementTypes));
+ return;
+ }
+ }
EditPart editPart = this;
if (request instanceof DirectEditRequest){
Point p = new Point(((DirectEditRequest)request).getLocation());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/factory/CustomUMLeditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/factory/CustomUMLeditPartFactory.java
index 0d7f69c7ab8..9c6ef4b16d8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/factory/CustomUMLeditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/factory/CustomUMLeditPartFactory.java
@@ -28,6 +28,8 @@ import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CModelEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CPackageEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CPackageEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CShapeNamedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomConstraintBodyEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomConstraintBodyEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomConstraintEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassRoleSourceEditPart;
@@ -35,6 +37,8 @@ import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassRoleTarg
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationNodeEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationSourceNameEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationTargetNameEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintBodyEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintBodyEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintEditPartCN;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ContainmentCircleEditPart;
@@ -88,6 +92,10 @@ public class CustomUMLeditPartFactory extends UMLEditPartFactory {
return new CustomConstraintEditPart(view);
case ConstraintEditPartCN.VISUAL_ID:
return new CustomConstraintEditPartCN(view);
+ case ConstraintBodyEditPart.VISUAL_ID:
+ return new CustomConstraintBodyEditPart(view);
+ case ConstraintBodyEditPartCN.VISUAL_ID:
+ return new CustomConstraintBodyEditPartCN(view);
}
}
return super.createEditPart(context, model);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPart.java
index 0ad0b9bfbbd..372c99762d1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPart.java
@@ -72,9 +72,11 @@ import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.Feature;
@@ -360,7 +362,14 @@ public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit() {
- getManager().show();
+ // CursorUtils.setCursor(SWT.CURSOR_WAIT);
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+
+ public void run() {
+ getManager().show();
+ }
+ });
+ // CursorUtils.setCursor(SWT.CURSOR_ARROW);
}
/**
@@ -454,10 +463,8 @@ public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implement
if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((request instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)request;
- performDirectEdit(editRequest.getLocation());
- } else {
+ }
+ else {
performDirectEdit();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPartCN.java
index 6325b0aa446..b1a115a1d90 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ConstraintBodyEditPartCN.java
+++ b/