Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-26 12:58:22 +0000
committerCamille Letavernier2014-03-26 12:58:40 +0000
commitc41ebcc389ab8a385fa337c87e5f0d9cd303065b (patch)
treec315a58b1935046fc77aa93199dcec67dadf051d
parent74b466b6c3a7a11c480a6980b6aabd7fc83c2bac (diff)
parent81b039fa0c98ea52425f041e96fac1f660d1ef99 (diff)
downloadorg.eclipse.papyrus-c41ebcc389ab8a385fa337c87e5f0d9cd303065b.tar.gz
org.eclipse.papyrus-c41ebcc389ab8a385fa337c87e5f0d9cd303065b.tar.xz
org.eclipse.papyrus-c41ebcc389ab8a385fa337c87e5f0d9cd303065b.zip
Synchronize with master
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html44
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.pngbin0 -> 47208 bytes
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.pngbin0 -> 80620 bytes
-rw-r--r--plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java11
-rw-r--r--plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java27
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractFixEdgeAnchorDeferredCommand.java26
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshConnectionElementsRunnable.java135
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorAfterCreationDeferredCommand.java96
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorsDeferredCommand.java86
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackageEditPart.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ConstraintBodyEditPart.java50
16 files changed, 480 insertions, 124 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java
index 443bb17eaaf..5151caeccec 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java
@@ -29,7 +29,6 @@ import org.eclipse.papyrus.qompass.designer.core.Log;
import org.eclipse.papyrus.qompass.designer.core.Utils;
import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding;
import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException;
-import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
@@ -338,8 +337,7 @@ public class ConnectorSelectionDialog extends AbstractElementListSelectionDialog
connectorList.add((Class)el);
}
} catch (TransformationException e) {
- // transform into runtime exception
- throw new TransformationRTException(e.getMessage());
+ // silently ignore exception: it is normal that we cannot find a binding for some connectors
}
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html
index babf443f906..a8aacf1106c 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html
@@ -126,5 +126,49 @@ information compared to the tree structure depicted by the dedicated dialog.<br>
The last step is the code generation which can be executed via the context menu of a deployment plan. The code generation creates an CDT project
which can be compiled and executed.
+<h2>Compilation, Execution and Debugging</h2>
+
+<h3>For Windows users</h3>
+
+If you are using Windows and it is the first time you are running C++ project using Eclipse CDT,
+you can face some problems during compilation, execution and debugging of the generated code.
+
+First of all, be sure that you have defined the environment variable for your C++ compiler. To do so, open a command line window (cmd.exe) and type "gdb".
+You should see an output like below.
+
+<center>
+<img src="screenshots/cmd_without_error.png" alt="command line without error">
+</center>
+
+If you do not see this output and see the error below,
+
+<center>
+<img src="screenshots/cmd_with_error.png" alt="command line with error">
+</center>
+
+
+go to "My Computer -> Properties -> Advanced System Parameters". Edit the variable named "PATH" and add the following to the end of its value ";C:\MinGW\bin\"
+<br><br>
+Moreover, another problem you can face can be having no console output after a successful run of the code. In this case,
+<br><br>
+Right-click on your project. Select "Properties".
+<br><br>
+Select the "Run/Debug Settings" Property on the left of the new window.
+<br><br>
+In the right window, click on your executable to highlight (ie - Test.exe) and click "Edit".
+<br><br>
+In the Environment tab, hit "New"
+<br><br>
+Name: <b>PATH</b>
+<br>
+Value: <b>Path to your MinGW bin directory</b> (For example: C:\MinGW\bin)
+<br><br>
+Click "OK" on all windows to close down.
+<br><br>
+Try running again, it should print output to the screen.
+<br><br>
+<a href="http://stackoverflow.com/questions/3443254/eclipse-cdt-using-mingw-does-not-output-in-console">See this link!</a>
+
+
</body>
</html> \ No newline at end of file
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png
new file mode 100644
index 00000000000..b239ab329eb
--- /dev/null
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png
Binary files differ
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png
new file mode 100644
index 00000000000..a03d922c087
--- /dev/null
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png
Binary files differ
diff --git a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
index fec6cb57121..755feb0c2e8 100644
--- a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
+++ b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureHierarchyView.java
@@ -113,17 +113,20 @@ public class FigureHierarchyView extends ViewPart {
viewer.getTree().setLinesVisible(true);
TreeColumn tcName = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcName.setText("Figure");
+ tcName.setText("Figure"); //$NON-NLS-1$
tcName.setWidth(300);
TreeColumn tcFigBounds = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcFigBounds.setText("Figure bounds");
+ tcFigBounds.setText("Figure bounds"); //$NON-NLS-1$
tcFigBounds.setWidth(250);
TreeColumn tcLayoutManager = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcLayoutManager.setText("Layout manager");
+ tcLayoutManager.setText("Layout manager"); //$NON-NLS-1$
tcLayoutManager.setWidth(150);
TreeColumn tcBorder = new TreeColumn(viewer.getTree(), SWT.LEFT);
- tcBorder.setText("Border");
+ tcBorder.setText("Border (width)"); //$NON-NLS-1$
tcBorder.setWidth(150);
+ TreeColumn tcLineWidth = new TreeColumn(viewer.getTree(), SWT.LEFT);
+ tcLineWidth.setText("Line width"); //$NON-NLS-1$
+ tcLineWidth.setWidth(100);
}
@Override
diff --git a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
index 82b875b34d1..4f3a7784769 100644
--- a/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
+++ b/plugins/developer/org.eclipse.papyrus.gmf.figureview/src/org/eclipse/papyrus/gmf/figureview/view/FigureLabelProvider.java
@@ -15,6 +15,9 @@
package org.eclipse.papyrus.gmf.figureview.view;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -52,7 +55,7 @@ public class FigureLabelProvider implements ITableLabelProvider, ITableColorProv
switch(columnIndex) {
case 0:
String name = figure.getClass().getName();
- int index = name.lastIndexOf(".");
+ int index = name.lastIndexOf("."); //$NON-NLS-1$
if(index == -1) {
return name;
}
@@ -66,18 +69,32 @@ public class FigureLabelProvider implements ITableLabelProvider, ITableColorProv
return figure.getLayoutManager().getClass().getSimpleName();
}
else {
- return "no layout manager";
+ return "none"; //$NON-NLS-1$
}
case 3:
if(figure.getBorder() != null) {
- return figure.getBorder().getClass().getSimpleName();
+ String borderInfo = figure.getBorder().getClass().getSimpleName();
+ if (figure.getBorder() instanceof LineBorder) {
+ borderInfo += String.format(" (%d)", ((LineBorder) figure.getBorder()).getWidth()); //$NON-NLS-1$
+ }
+ return borderInfo;
}
else {
- return "no border";
+ return "no border"; //$NON-NLS-1$
+ }
+ case 4:
+ if (figure instanceof Shape) {
+ return String.format("%d", ((Shape) figure).getLineWidth()); //$NON-NLS-1$
+ }
+ else if (figure instanceof NodeFigure) {
+ return String.format("%d", ((NodeFigure) figure).getLineWidth()); //$NON-NLS-1$
+ }
+ else {
+ return "not avail"; //$NON-NLS-1$
}
}
}
- return "cannot display element: " + element;
+ return "cannot display element: " + element; //$NON-NLS-1$
}
public Image getColumnImage(Object element, int columnIndex) {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractFixEdgeAnchorDeferredCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractFixEdgeAnchorDeferredCommand.java
index 3652277ed79..3229f7b00ba 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractFixEdgeAnchorDeferredCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractFixEdgeAnchorDeferredCommand.java
@@ -17,13 +17,17 @@ package org.eclipse.papyrus.infra.gmfdiag.common.commands;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
import org.eclipse.gef.EditPart;
@@ -33,6 +37,7 @@ import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.helper.FixAnchorHelper;
@@ -86,25 +91,6 @@ public abstract class AbstractFixEdgeAnchorDeferredCommand extends AbstractTrans
*
* @param connectionToRefresh
* the connection edit part to refresh
- */
- protected void refreshConnection(final AbstractConnectionEditPart connectionToRefresh) {
- connectionToRefresh.refresh();
- final EditPart sourceEp = connectionToRefresh.getSource();
- if(sourceEp != null) {
- sourceEp.refresh();
- }
- final EditPart targetEP = connectionToRefresh.getTarget();
- if(targetEP != null) {
- targetEP.refresh();
- }
- //to force the call to the router, to update the figure
- connectionToRefresh.getFigure().validate();
- }
-
- /**
- *
- * @param connectionToRefresh
- * the connection edit part to refresh
* @param commandToContribute
* the command to contribute (as parameter to avoid to create several compound command
*/
@@ -171,4 +157,6 @@ public abstract class AbstractFixEdgeAnchorDeferredCommand extends AbstractTrans
public boolean canExecute() {
return super.canExecute() && this.helper != null && this.containerEP != null;
}
+
+
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshConnectionElementsRunnable.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshConnectionElementsRunnable.java
new file mode 100644
index 00000000000..0c7b2d62c31
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/AbstractRefreshConnectionElementsRunnable.java
@@ -0,0 +1,135 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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.infra.gmfdiag.common.commands;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+
+
+/**
+ *
+ * abstract runnable used to refresh the connection, source and target editparts
+ *
+ */
+public abstract class AbstractRefreshConnectionElementsRunnable<T> implements RunnableWithResult<T> {
+
+ /**
+ * the status of the runnable
+ */
+ private IStatus status;
+
+ /**
+ * the result of the runnable
+ */
+ private T result;
+
+ /**
+ * the container editpart of the refreshed connection
+ */
+ private final IGraphicalEditPart containerEP;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param containerEP
+ * the editpart owning the connection
+ */
+ public AbstractRefreshConnectionElementsRunnable(final IGraphicalEditPart containerEP) {
+ this.containerEP = containerEP;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.transaction.RunnableWithResult#getResult()
+ *
+ * @return
+ */
+ public final T getResult() {
+ return result;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.transaction.RunnableWithResult#setStatus(org.eclipse.core.runtime.IStatus)
+ *
+ * @param status
+ * set the new status for the runnable
+ */
+ public final void setStatus(IStatus status) {
+ this.status = status;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.transaction.RunnableWithResult#getStatus()
+ *
+ * @return
+ * the status of the runnable
+ */
+ public final IStatus getStatus() {
+ return status;
+ }
+
+ /**
+ *
+ * @return
+ * the container edit part
+ */
+ protected final IGraphicalEditPart getContainerEditPart() {
+ return this.containerEP;
+ }
+ /**
+ *
+ * @param connectionToRefresh
+ * the connection edit part to refresh
+ */
+ protected final void refreshConnection(final AbstractConnectionEditPart connectionToRefresh) {
+ connectionToRefresh.refresh();
+ final EditPart sourceEp = connectionToRefresh.getSource();
+ if(sourceEp != null) {
+ sourceEp.refresh();
+ }
+ final EditPart targetEP = connectionToRefresh.getTarget();
+ if(targetEP != null) {
+ targetEP.refresh();
+ }
+ //to force the call to the router, to update the figure
+ connectionToRefresh.getFigure().validate();
+ }
+
+ /**
+ *
+ * @return
+ * the figure for the container edit part
+ */
+ protected final IFigure getContainerFigure() {
+ return this.containerEP.getFigure();
+ }
+
+ /**
+ *
+ * @param result
+ * set the result of the runnable
+ */
+ protected final void setResult(T result) {
+ this.result = result;
+ }
+
+}; \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorAfterCreationDeferredCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorAfterCreationDeferredCommand.java
index 77dae8137ee..ac8f3bc8826 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorAfterCreationDeferredCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorAfterCreationDeferredCommand.java
@@ -15,6 +15,7 @@
package org.eclipse.papyrus.infra.gmfdiag.common.commands;
+import java.io.ObjectInputStream.GetField;
import java.util.Map;
import org.eclipse.core.commands.ExecutionException;
@@ -22,6 +23,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.draw2d.IFigure;
import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.commands.CompoundCommand;
@@ -32,6 +34,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
+import org.eclipse.swt.widgets.Display;
/**
@@ -73,44 +76,14 @@ public class FixEdgeAnchorAfterCreationDeferredCommand extends AbstractFixEdgeAn
*/
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- final RunnableWithResult<AbstractConnectionEditPart> refreshRunnable = new RunnableWithResult<AbstractConnectionEditPart>() {
-
- private IStatus status;
-
- private AbstractConnectionEditPart result;
-
- public AbstractConnectionEditPart getResult() {
- return result;
- }
-
- public void setStatus(IStatus status) {
- this.status = status;
- }
-
- public IStatus getStatus() {
- return status;
- }
-
- public void run() {
- getContainerEP().refresh();
-
- // We update the figure world
- getContainerFigure().invalidate();
- getContainerFigure().validate();
- final View view = (View)request.getConnectionViewDescriptor().getAdapter(View.class);
- if(view != null) {
- final Map<?, ?> epRegistry = getContainerEP().getRoot().getViewer().getEditPartRegistry();
- Object editPart = epRegistry.get(view);
- if(editPart instanceof AbstractConnectionEditPart) {
- this.result = (AbstractConnectionEditPart)editPart;
- refreshConnection(this.result);
- }
- }
- setStatus(Status.OK_STATUS);
- }
- };
+ //we execute all ui thread
+ while(Display.getDefault().readAndDispatch());
+ //we refresh the editparts
+ RefreshConnectionElementsRunnable refreshRunnable = new RefreshConnectionElementsRunnable(this.request, getContainerEP());
EditPartUtil.synchronizeRunnableToMainThread(getContainerEP(), refreshRunnable);
+
+ //we do the work
final AbstractConnectionEditPart connectionEP = refreshRunnable.getResult();
if(connectionEP != null) {
final CompoundCommand cc = new CompoundCommand("Fix connections anchors"); //$NON-NLS-1$
@@ -145,4 +118,55 @@ public class FixEdgeAnchorAfterCreationDeferredCommand extends AbstractFixEdgeAn
public boolean canExecute() {
return super.canExecute() && this.request != null;
}
+
+ /**
+ *
+ * The runnable used to refresh the views
+ *
+ */
+ private static class RefreshConnectionElementsRunnable extends AbstractRefreshConnectionElementsRunnable<AbstractConnectionEditPart> {
+
+ /**
+ * the connection request
+ */
+ final CreateConnectionViewRequest request;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param request
+ * the request used to create the connection view
+ * @param containerEP
+ * the edit part owning the new connection editpart
+ * @param containerFigure
+ */
+ public RefreshConnectionElementsRunnable(final CreateConnectionViewRequest request, final IGraphicalEditPart containerEP) {
+ super(containerEP);
+ this.request = request;
+ }
+
+ /**
+ *
+ * @see java.lang.Runnable#run()
+ *
+ */
+ public void run() {
+ getContainerEditPart().refresh();
+ // We update the figure world
+ getContainerFigure().invalidate();
+ getContainerFigure().validate();
+ final View view = (View)this.request.getConnectionViewDescriptor().getAdapter(View.class);
+ if(view != null) {
+ final Map<?, ?> epRegistry = getContainerEditPart().getRoot().getViewer().getEditPartRegistry();
+ Object editPart = epRegistry.get(view);
+ if(editPart instanceof AbstractConnectionEditPart) {
+ setResult((AbstractConnectionEditPart)editPart);
+ refreshConnection(getResult());
+ }
+ }
+ setStatus(Status.OK_STATUS);
+ }
+ };
+
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorsDeferredCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorsDeferredCommand.java
index 41b83cab5c1..a5cd2e2e346 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorsDeferredCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/FixEdgeAnchorsDeferredCommand.java
@@ -72,44 +72,8 @@ public class FixEdgeAnchorsDeferredCommand extends AbstractFixEdgeAnchorDeferred
*/
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- final RunnableWithResult<Collection<AbstractConnectionEditPart>> refreshRunnable = new RunnableWithResult<Collection<AbstractConnectionEditPart>>() {
-
- private IStatus status;
-
- private Collection<AbstractConnectionEditPart> result;
-
- public Collection<AbstractConnectionEditPart> getResult() {
- return result;
- }
-
- public void setStatus(IStatus status) {
- this.status = status;
- }
-
- public IStatus getStatus() {
- return status;
- }
-
- public void run() {
- getContainerEP().refresh();
-
- // We update the figure world
- getContainerFigure().invalidate();
- getContainerFigure().validate();
- final Iterator<?> iter = connectionsEditPartToRefresh.iterator();
- final Collection<AbstractConnectionEditPart> connectionsEP = new HashSet<AbstractConnectionEditPart>();
- this.result = connectionsEP;
- while(iter.hasNext()) {
- final Object object = iter.next();
- if(object instanceof AbstractConnectionEditPart) {
- connectionsEP.add((AbstractConnectionEditPart)object);
- refreshConnection((AbstractConnectionEditPart)object);
- }
- }
- setStatus(Status.OK_STATUS);
- }
- };
-
+ final RefreshConnectionElementsRunnable refreshRunnable = new RefreshConnectionElementsRunnable(this.connectionsEditPartToRefresh, getContainerEP());
+
EditPartUtil.synchronizeRunnableToMainThread(getContainerEP(), refreshRunnable);
final Collection<AbstractConnectionEditPart> toRefresh = refreshRunnable.getResult();
final Iterator<AbstractConnectionEditPart> iter = toRefresh.iterator();
@@ -119,7 +83,7 @@ public class FixEdgeAnchorsDeferredCommand extends AbstractFixEdgeAnchorDeferred
addFixAnchorCommand(current, cc);
if(cc.canExecute()) {
cc.execute();
- }else{
+ } else {
Activator.log.warn("Command to fix the anchors is null"); //$NON-NLS-1$
}
}
@@ -136,6 +100,48 @@ public class FixEdgeAnchorsDeferredCommand extends AbstractFixEdgeAnchorDeferred
this.connectionsEditPartToRefresh.clear();
}
+ private static class RefreshConnectionElementsRunnable extends AbstractRefreshConnectionElementsRunnable<Collection<AbstractConnectionEditPart>> {
+
+ /**
+ * the list of the connections to refresh
+ */
+ private Collection<?> connectionsEditPartToRefresh;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param connectionsEditPartToRefresh
+ * the list of the connection edit part to refresh
+ * @param containerEP
+ */
+ public RefreshConnectionElementsRunnable(final Collection<?> connectionsEditPartToRefresh, final IGraphicalEditPart containerEP) {
+ super(containerEP);
+ this.connectionsEditPartToRefresh = connectionsEditPartToRefresh;
+ }
-
+ /**
+ *
+ * @see java.lang.Runnable#run()
+ *
+ */
+ public void run() {
+ getContainerEditPart().refresh();
+
+ // We update the figure world
+ getContainerFigure().invalidate();
+ getContainerFigure().validate();
+ final Iterator<?> iter = connectionsEditPartToRefresh.iterator();
+ final Collection<AbstractConnectionEditPart> connectionsEP = new HashSet<AbstractConnectionEditPart>();
+ setResult(connectionsEP);
+ while(iter.hasNext()) {
+ final Object object = iter.next();
+ if(object instanceof AbstractConnectionEditPart) {
+ connectionsEP.add((AbstractConnectionEditPart)object);
+ refreshConnection((AbstractConnectionEditPart)object);
+ }
+ }
+ setStatus(Status.OK_STATUS);
+ }
+ }
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF
index 0fa07b01229..ffe869440ce 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/META-INF/MANIFEST.MF
@@ -20,4 +20,6 @@ Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.menu;singleton:
=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.gmfdiag.menu,
+ org.eclipse.papyrus.infra.gmfdiag.menu.handlers
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackageEditPart.java
index fd798bcdf9c..48acc949db0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackageEditPart.java
@@ -314,21 +314,21 @@ public class PackageEditPart extends NamedElementEditPart
}
/**
- * @generated
+ * @generated NOT
*/
protected void setLineWidth(int width) {
- if (primaryShape instanceof NodeFigure) {
- ((NodeFigure) primaryShape).setLineWidth(width);
- }
+ // Do not mask implementation, use method from parent.
+ // See. https://bugs.eclipse.org/bugs/show_bug.cgi?id=352549
+ super.setLineWidth(width);
}
/**
- * @generated
+ * @generated NOT
*/
protected void setLineType(int style) {
- if (primaryShape instanceof NodeFigure) {
- ((NodeFigure) primaryShape).setLineStyle(style);
- }
+ // Do not mask implementation, use method from parent.
+ // See. https://bugs.eclipse.org/bugs/show_bug.cgi?id=352549
+ super.setLineType(style);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
index 340bf21e0ef..20c5432395e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPart.java
@@ -51,6 +51,7 @@ import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
@@ -58,6 +59,7 @@ import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
@@ -70,16 +72,18 @@ import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLParserProvider;
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;
/**
* @generated
*/
-public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart {
+public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
@@ -352,7 +356,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit() {
- getManager().show();
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
@@ -396,7 +405,11 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
+ if(configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if(configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
@@ -455,6 +468,37 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
/**
* @generated
*/
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected void initializeDirectEditManager(final Request request) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ 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 {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
index 07599feb617..b6907c88deb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/src/org/eclipse/papyrus/uml/diagram/deployment/edit/parts/ConstraintSpecificationEditPartCN.java
@@ -51,6 +51,7 @@ import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
@@ -58,6 +59,7 @@ import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
@@ -70,16 +72,18 @@ import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLParserProvider;
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;
/**
* @generated
*/
-public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart {
+public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
@@ -352,7 +356,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit() {
- getManager().show();
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
@@ -396,7 +405,11 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
+ if(configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if(configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
@@ -455,6 +468,37 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
/**
* @generated
*/
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected void initializeDirectEditManager(final Request request) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ 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 {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
index 741b63ae2d7..73643dd8870 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomConstraintEditPart.java
@@ -19,11 +19,13 @@ import org.eclipse.draw2d.ColorConstants;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.FillStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomConstraintItemSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
/**
* @author Jin Liu (jin.liu@soyatec.com)
@@ -103,4 +105,9 @@ public class CustomConstraintEditPart extends ConstraintEditPart {
setTransparency(style.getTransparency());
}
}
+
+ @Override
+ protected IElementType elementTypeOfToolAfterCreation() {
+ return UMLElementTypes.ConstraintContext_8500;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ConstraintBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ConstraintBodyEditPart.java
index 9e41266723b..6ede5dbfcca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ConstraintBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ConstraintBodyEditPart.java
@@ -52,6 +52,7 @@ import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
@@ -59,6 +60,7 @@ import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
@@ -71,16 +73,18 @@ import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLParserProvider;
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;
/**
* @generated
*/
-public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart {
+public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
/**
* @generated
@@ -352,7 +356,12 @@ public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit() {
- getManager().show();
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
@@ -394,7 +403,11 @@ public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implement
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
+ if(configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if(configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
@@ -450,6 +463,37 @@ public class ConstraintBodyEditPart extends PapyrusCompartmentEditPart implement
/**
* @generated
*/
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected void initializeDirectEditManager(final Request request) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ 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 {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();

Back to the top