diff options
author | Remi Schnekenburger | 2015-07-23 07:15:22 +0000 |
---|---|---|
committer | Remi Schnekenburger | 2015-07-23 09:40:04 +0000 |
commit | 82dcf8bec146224c8a6a9619dab3b28a2d446c33 (patch) | |
tree | 1a0fad2543db971bd54db94b1c89a597370be55d /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org | |
parent | 53bfcad0c29e88c0704a858e2201010ed723736a (diff) | |
download | org.eclipse.papyrus-82dcf8bec146224c8a6a9619dab3b28a2d446c33.tar.gz org.eclipse.papyrus-82dcf8bec146224c8a6a9619dab3b28a2d446c33.tar.xz org.eclipse.papyrus-82dcf8bec146224c8a6a9619dab3b28a2d446c33.zip |
Allow to remove edition of the name when creating a diagram
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java index 217afa95d80..2e11fe855b4 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/AbstractPapyrusGmfCreateDiagramCommandHandler.java @@ -185,12 +185,9 @@ public abstract class AbstractPapyrusGmfCreateDiagramCommandHandler extends Abst } } - if (name == null) { - name = openDiagramNameDialog(prototype.isNatural() ? getDefaultDiagramName() : "New" + prototype.getLabel().replace(" ", "")); - } - // canceled - if (name == null) { - return CommandResult.newCancelledCommandResult(); + CommandResult result = doEditDiagramName(prototype, name); + if (!result.getStatus().isOK()) { + return result; } Diagram diagram = doCreateDiagram(notationResource, owner, element, prototype, name); @@ -262,6 +259,22 @@ public abstract class AbstractPapyrusGmfCreateDiagramCommandHandler extends Abst /** + * @return + */ + protected CommandResult doEditDiagramName(ViewPrototype prototype, String name) { + + if (name == null) { + name = openDiagramNameDialog(prototype.isNatural() ? getDefaultDiagramName() : "New" + prototype.getLabel().replace(" ", "")); + } + // canceled + if (name == null) { + return CommandResult.newCancelledCommandResult(); + } + return CommandResult.newOKCommandResult(); + } + + + /** * Get the root element associated with canvas. */ private EObject getRootElement(Resource modelResource) { |