Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2015-03-24 15:41:04 +0000
committerFrancois Le Fevre2015-03-27 14:02:46 +0000
commit1cb507726fa5fe03b35ead9de52c299d24846c90 (patch)
treeeb3fec334207f8bd977d17dcce94906a3e02edfb /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu
parentf2568b5ba276b425ee7aa597a1f09c7c4460a258 (diff)
downloadorg.eclipse.papyrus-1cb507726fa5fe03b35ead9de52c299d24846c90.tar.gz
org.eclipse.papyrus-1cb507726fa5fe03b35ead9de52c299d24846c90.tar.xz
org.eclipse.papyrus-1cb507726fa5fe03b35ead9de52c299d24846c90.zip
Bug 462641 - [General]: implement different naming strategy for quick
format button - refactoring for strategy of command - adding all default methods - name the action buttons Change-Id: If1b69baa9b75116903e7dbb8036fa406668aa914 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=462641 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/DiagramNameNormalizationCommand.java18
2 files changed, 47 insertions, 16 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
index 5ed34acaea0..11596399c3b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
@@ -3740,6 +3740,51 @@
</and>
</activeWhen>
</handler>
+ <handler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.DiagramQuickFormatHandler"
+ commandId="org.eclipse.papyrus.infra.ui.menu.commands.QuickFormattingSwitchSpace2UnderscoreCommand">
+ <activeWhen>
+ <and>
+ <with
+ variable="selection">
+ <test
+ property="org.eclipse.papyrus.uml.diagram.menu.quickformatpropertytester.isNameChangeable"
+ value="true">
+ </test>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.DiagramQuickFormatHandler"
+ commandId="org.eclipse.papyrus.infra.ui.menu.commands.QuickFormattingCapitalizeFirstLetterCommand">
+ <activeWhen>
+ <and>
+ <with
+ variable="selection">
+ <test
+ property="org.eclipse.papyrus.uml.diagram.menu.quickformatpropertytester.isNameChangeable"
+ value="true">
+ </test>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.DiagramQuickFormatHandler"
+ commandId="org.eclipse.papyrus.infra.ui.menu.commands.QuickFormattingRemoveSpaceCommand">
+ <activeWhen>
+ <and>
+ <with
+ variable="selection">
+ <test
+ property="org.eclipse.papyrus.uml.diagram.menu.quickformatpropertytester.isNameChangeable"
+ value="true">
+ </test>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
</extension>
<extension
id="PapyrusFillColorCommand"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/DiagramNameNormalizationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/DiagramNameNormalizationCommand.java
index 734a163448b..c5584c529ee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/DiagramNameNormalizationCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/DiagramNameNormalizationCommand.java
@@ -37,23 +37,9 @@ public class DiagramNameNormalizationCommand extends NameNormalizationCommand{
protected void doExecute() {
if(source instanceof Diagram){
String name = ((Diagram)source).getName();
-
- switch (parameter) {
- case UPPERCASE_ACTION:
- ((Diagram)source).setName(name.toUpperCase());
- break;
- case LOWERCASE_ACTION:
- ((Diagram)source).setName(name.toLowerCase());
- break;
-
- default:
- ((Diagram)source).setName(name.toUpperCase());
- break;
- }
+ String newName = normalizeName(name,parameter);
+ ((Diagram)source).setName(newName);
}
-
-
-
}
} \ No newline at end of file

Back to the top