Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-02-07 05:27:38 -0500
committerAnsgar Radermacher2014-02-07 05:27:38 -0500
commit7e7ba26a846e15b4692bd3cb2aeb147241a66c0a (patch)
tree148defc1e1d8d6d5c6210c7e392f5cb489fd7f6b /plugins
parent5b7aaf8d0e9cc026491d3605eefadb59d788081f (diff)
downloadorg.eclipse.papyrus-7e7ba26a846e15b4692bd3cb2aeb147241a66c0a.tar.gz
org.eclipse.papyrus-7e7ba26a846e15b4692bd3cb2aeb147241a66c0a.tar.xz
org.eclipse.papyrus-7e7ba26a846e15b4692bd3cb2aeb147241a66c0a.zip
- Bug 315231 - [All Diagrams] Direct Edit : Xtext / Papyrus integration
- Updated composite diagram (regeneration) to re-enable xtext integreation, still need to remove dependency
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
index 86cb00ce9b9..e3caeac9670 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
@@ -53,6 +53,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;
@@ -410,6 +411,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
+ if(configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ setParser(((ICustomDirectEditorConfiguration)configuration).createParser(this.resolveSemanticElement()));
+ initializeDirectEditManager(theRequest);
+ return;
+ }
if(configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
helper.showEditor();
@@ -535,6 +542,32 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
/**
* @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 if((request instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)request;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -621,6 +654,13 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
}
/**
+ * @generated
+ */
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
* Checks if a default direct edition is available
*
* @return <code>true</code> if a default direct edition is available

Back to the top