diff options
author | Jonas Hungershausen | 2018-05-03 08:02:47 +0000 |
---|---|---|
committer | Jonas Hungershausen | 2018-05-03 08:03:16 +0000 |
commit | 26c62b6438715ea0863d1facee844e6703f01c55 (patch) | |
tree | 3d3d74ee456cb92f8c7aba1fc5da324fa59d456d /org.eclipse.ui.editors | |
parent | 945d5eb3c73a66b124940fc8a20c58801a7c7118 (diff) | |
download | eclipse.platform.text-26c62b6438715ea0863d1facee844e6703f01c55.tar.gz eclipse.platform.text-26c62b6438715ea0863d1facee844e6703f01c55.tar.xz eclipse.platform.text-26c62b6438715ea0863d1facee844e6703f01c55.zip |
Bug 533601 - Add Bookmark dialog should use verbs
Change-Id: I52dedf5568747c3e055d7d2ac67c0131a0d8a9e7
Signed-off-by: Jonas Hungershausen <jonas.hungershausen@vogella.com>
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r-- | org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties | 1 | ||||
-rw-r--r-- | org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties index 6504cfad8da..ed62308b807 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties @@ -44,6 +44,7 @@ Editor.ManageBookmarks.add.label=Add Boo&kmark... Editor.ManageBookmarks.remove.label=Remove Boo&kmark Editor.ManageBookmarks.add.dialog.title=Add Bookmark Editor.ManageBookmarks.add.dialog.message=Enter Bookmark name: +Editor.ManageBookmarks.add.dialog.addbutton=&Add Editor.ManageBookmarks.error.dialog.title=Managing Bookmarks Editor.ManageBookmarks.error.dialog.message=Problems managing bookmarks diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java index 033b413a032..fe70489f437 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java @@ -20,6 +20,8 @@ import java.util.ResourceBundle; import org.osgi.framework.Bundle; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; import org.eclipse.core.commands.ExecutionException; @@ -400,13 +402,14 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { String proposal= (o instanceof String) ? (String) o : ""; //$NON-NLS-1$ String title= getString(fBundle, fPrefix + "add.dialog.title", fPrefix + "add.dialog.title"); //$NON-NLS-2$ //$NON-NLS-1$ String message= getString(fBundle, fPrefix + "add.dialog.message", fPrefix + "add.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$ + String addButtonText= getString(fBundle, fPrefix + "add.dialog.addbutton", fPrefix + "add.dialog.addbutton"); //$NON-NLS-1$ //$NON-NLS-2$ IInputValidator inputValidator= new IInputValidator() { @Override public String isValid(String newText) { return (newText == null || newText.trim().length() == 0) ? " " : null; //$NON-NLS-1$ } }; - InputDialog dialog= new InputDialog(fTextEditor.getSite().getShell(), title, message, proposal, inputValidator); + AddBookmarkDialog dialog= new AddBookmarkDialog(fTextEditor.getSite().getShell(), title, message, proposal, inputValidator, addButtonText); String label= null; if (dialog.open() != Window.CANCEL) @@ -423,6 +426,24 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { return true; } + class AddBookmarkDialog extends InputDialog { + + private final String addButtonText; + + public AddBookmarkDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator, String addButtonText) { + super(parentShell, dialogTitle, dialogMessage, initialValue, validator); + this.addButtonText= addButtonText; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + super.createButtonsForButtonBar(parent); + Button okButton= getOkButton(); + okButton.setText(addButtonText); + } + + } + /** * Returns the attributes with which a newly created marker will be * initialized. |