Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGautier de Saint Martin Lacaze2020-02-12 10:49:43 +0000
committerGautier de Saint Martin Lacaze2020-02-12 10:49:43 +0000
commit5212f4dfaf0e391904b31c5d9da2bb2656bfb332 (patch)
treef87ad8fe31bb173450dba39fd457319614928ea2
parent4c9a7526886c2c5ebe32be6ba5e02a3d02cdbd2c (diff)
downloadeclipse.platform.text-5212f4dfaf0e391904b31c5d9da2bb2656bfb332.tar.gz
eclipse.platform.text-5212f4dfaf0e391904b31c5d9da2bb2656bfb332.tar.xz
eclipse.platform.text-5212f4dfaf0e391904b31c5d9da2bb2656bfb332.zip
dialog text Change-Id: I6e336627810b695d77349d21aeceb609e5b8ed70 Signed-off-by: Gautier de Saint Martin Lacaze <gautier.desaintmartinlacaze@gmail.com>
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java13
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.properties4
3 files changed, 15 insertions, 4 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
index 5db91d566..b1077de8b 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
@@ -1203,9 +1203,7 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I
if (newTemplate != null) {
if (!newTemplate.getName().equals(oldTemplate.getName()) &&
- MessageDialog.openQuestion(getShell(),
- TemplatesMessages.TemplatePreferencePage_question_create_new_title,
- TemplatesMessages.TemplatePreferencePage_question_create_new_message))
+ openCreateNewOrRenameDialog())
{
data= new TemplatePersistenceData(newTemplate, true);
fTemplateStore.add(data);
@@ -1436,6 +1434,15 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I
MessageDialog.openError(getShell(), title, message);
}
+ private boolean openCreateNewOrRenameDialog() {
+ MessageDialog dialog = new MessageDialog(getShell(),
+ TemplatesMessages.TemplatePreferencePage_question_create_new_title, null,
+ TemplatesMessages.TemplatePreferencePage_question_create_new_message, MessageDialog.QUESTION, 0,
+ TemplatesMessages.TemplatePreferencePage_question_create_new_button_create,
+ TemplatesMessages.TemplatePreferencePage_question_create_new_button_rename);
+ return dialog.open() == 0;
+ }
+
protected SourceViewer getViewer() {
return fPatternViewer;
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.java
index da6c60b13..acc613f86 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.java
@@ -64,6 +64,8 @@ final class TemplatesMessages extends NLS {
public static String TemplatePreferencePage_error_write_message;
public static String TemplatePreferencePage_question_create_new_title;
public static String TemplatePreferencePage_question_create_new_message;
+ public static String TemplatePreferencePage_question_create_new_button_create;
+ public static String TemplatePreferencePage_question_create_new_button_rename;
public static String TemplatePreferencePage_preview;
public static String EditTemplateDialog_error_noname;
public static String EditTemplateDialog_error_adjacent_variables;
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.properties b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.properties
index a3f3b711b..b8fe42256 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.properties
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesMessages.properties
@@ -58,7 +58,9 @@ TemplatePreferencePage_error_read_message= Failed to read templates. See the err
TemplatePreferencePage_error_write_message= Failed to write templates. See the error log for details.
TemplatePreferencePage_question_create_new_title= Edit Template
-TemplatePreferencePage_question_create_new_message= The name of the template has been changed. Click 'Yes' to create an additional template with the new name or 'No' to rename the existing one.
+TemplatePreferencePage_question_create_new_message= The name of the template has been changed.
+TemplatePreferencePage_question_create_new_button_create= Create New
+TemplatePreferencePage_question_create_new_button_rename= Rename Existing
TemplatePreferencePage_preview=Previe&w:

Back to the top