diff --git a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java index 703ee342e985..358b6f04835e 100644 --- a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java @@ -140,6 +140,11 @@ public class GitTagDialog extends DialogWrapper { validateFields(); } + @Override + public JComponent getPreferredFocusedComponent() { + return myTagNameTextField; + } + /** * Perform tagging according to selected options * @@ -189,6 +194,7 @@ public class GitTagDialog extends DialogWrapper { } try { GitHandlerUtil.doSynchronously(h, GitBundle.getString("tagging.title"), h.printableCommandLine()); + GitUIUtil.notifySuccess(myProject, myTagNameTextField.getText(), "Created tag " + myTagNameTextField.getText() + " successfully."); } finally { exceptions.addAll(h.errors()); diff --git a/plugins/git4idea/src/git4idea/ui/GitUIUtil.java b/plugins/git4idea/src/git4idea/ui/GitUIUtil.java index c9aec1c1e948..06429dea972d 100644 --- a/plugins/git4idea/src/git4idea/ui/GitUIUtil.java +++ b/plugins/git4idea/src/git4idea/ui/GitUIUtil.java @@ -54,6 +54,13 @@ public class GitUIUtil { */ private GitUIUtil() { } + /** + * Displays a "success"-notification. + */ + public static void notifySuccess(Project project, String title, String description) { + Notifications.Bus.notify(new Notification(GitVcs.NOTIFICATION_GROUP_ID, title, description, NotificationType.INFORMATION), project); + } + /** * @return a list cell renderer for virtual files (it renders presentable URL) * @param listCellRenderer