summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan GEOFFROY2014-08-07 05:42:21 (EDT)
committerJonathan GEOFFROY2014-08-07 05:42:21 (EDT)
commitabe01060045fa494c6520a7cb56e9f2c0638c048 (patch)
tree2702a7f12d6be2f613d202246f89a4aef9928d82
parentb0896efe2e99b9eb52b80d5caea3bf3693c9d661 (diff)
downloadorg.eclipse.papyrus-abe01060045fa494c6520a7cb56e9f2c0638c048.zip
org.eclipse.papyrus-abe01060045fa494c6520a7cb56e9f2c0638c048.tar.gz
org.eclipse.papyrus-abe01060045fa494c6520a7cb56e9f2c0638c048.tar.bz2
Bug 441326 - [java code generation] In preferences menu, empty pathrefs/changes/75/31175/1
should not be added when user clicked on "cancel" button Change-Id: I2e6943b4967c3ce5be2dcdb2b3c9a2f2e9ce1f60 Signed-off-by: Jonathan GEOFFROY <geoffroy.jonathan@gmail.com>
-rw-r--r--extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java
index dd8d8cf..cb3c44f 100644
--- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java
+++ b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java
@@ -20,6 +20,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.jdt.internal.ui.preferences.TypeFilterInputDialog;
+import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.preference.ListEditor;
import org.eclipse.swt.widgets.Composite;
@@ -56,6 +57,10 @@ public class PackageListEditor extends ListEditor {
d.open();
Object pack = d.getResult();
+ // Return null if user clicked on "cancel" button, to not add ampty package on the list
+ if(d.getReturnCode() == InputDialog.CANCEL) {
+ return null;
+ }
return pack.toString();
}