diff options
31 files changed, 278 insertions, 52 deletions
diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java index ec567a76dd..a436b088e1 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java @@ -87,6 +87,9 @@ public class UIText extends NLS { public static String FeatureStartHandler_startingNewFeature; /** */ + public static String FeatureTrackHandler_ButtonOK; + + /** */ public static String FeatureTrackHandler_fetchingRemoteFeatures; /** */ @@ -165,6 +168,9 @@ public class UIText extends NLS { public static String InitDialog_versionTagPrefix; /** */ + public static String InitDialog_ButtonOK; + + /** */ public static String InitHandler_doYouWantToInitNow; /** */ @@ -198,6 +204,9 @@ public class UIText extends NLS { public static String ReleaseStartHandler_startingNewRelease; /** */ + public static String FeatureCheckoutHandler_ButtonOK; + + /** */ public static String FeatureCheckoutHandler_checkingOutFeature; /** */ @@ -228,6 +237,9 @@ public class UIText extends NLS { public static String FeatureCheckoutHandler_cleanupDialog_text; /** */ + public static String FinishFeatureDialog_ButtonOK; + + /** */ public static String FinishFeatureDialog_keepBranch; /** */ @@ -249,6 +261,9 @@ public class UIText extends NLS { public static String ReleaseFinishOperation_unexpectedConflictsReleaseAborted; /** */ + public static String StartDialog_ButtonOK; + + /** */ public static String UIIcons_errorDeterminingIconBase; /** */ diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java index d732b15068..247d90c791 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java @@ -59,6 +59,7 @@ public class FeatureCheckoutHandler extends AbstractHandler { FeatureBranchSelectionDialog dialog = new FeatureBranchSelectionDialog( HandlerUtil.getActiveShell(event), refs, + UIText.FeatureCheckoutHandler_ButtonOK, UIText.FeatureCheckoutHandler_selectFeature, UIText.FeatureCheckoutHandler_localFeatures, Constants.R_HEADS + gfRepo.getConfig().getFeaturePrefix(), gfRepo); diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java index 8d41f1884c..effa10aa04 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java @@ -34,7 +34,7 @@ public class FeatureStartHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); - InputDialog inputDialog = new InputDialog( + InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.FeatureStartHandler_provideFeatureName, UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java index b408d0857f..350b7b3a1d 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java @@ -76,6 +76,7 @@ public class FeatureTrackHandler extends AbstractHandler { FeatureBranchSelectionDialog dialog = new FeatureBranchSelectionDialog( HandlerUtil.getActiveShell(event), refs, + UIText.FeatureTrackHandler_ButtonOK, UIText.FeatureCheckoutHandler_selectFeature, UIText.FeatureTrackHandler_remoteFeatures, R_REMOTES + DEFAULT_REMOTE_NAME + SEP + gfRepo.getConfig().getFeaturePrefix(), gfRepo); diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java index 18e30f1a58..8851396336 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java @@ -32,7 +32,7 @@ public class HotfixStartHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); - InputDialog inputDialog = new InputDialog( + InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.HotfixStartHandler_provideHotfixName, UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java index 266243be40..d41d593be0 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java @@ -49,7 +49,7 @@ public class ReleaseStartHandler extends AbstractHandler { void doExecute(GitFlowRepository gfRepo, final String startCommitSha1, Shell activeShell) { - InputDialog inputDialog = new InputDialog( + InputDialog inputDialog = new StartDialog( activeShell, UIText.ReleaseStartHandler_provideReleaseName, UIText.ReleaseStartHandler_provideANameForTheNewRelease, "", //$NON-NLS-1$ diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/StartDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/StartDialog.java new file mode 100644 index 0000000000..ce91105dad --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/StartDialog.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (C) 2018, Max Hohenegger <eclipse@hohenegger.eu> + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.egit.gitflow.ui.internal.actions; + +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.IInputValidator; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; + +class StartDialog extends InputDialog { + + private Button startButton; + + StartDialog(Shell parentShell, String dialogTitle, + String dialogMessage, String initialValue, + IInputValidator validator) { + super(parentShell, dialogTitle, dialogMessage, initialValue, validator); + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + startButton = createButton(parent, IDialogConstants.OK_ID, + UIText.StartDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + + getText().setFocus(); + if (getValue() != null) { + getText().setText(getValue()); + getText().selectAll(); + } + } + + @Override + protected Button getOkButton() { + return startButton; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FeatureBranchSelectionDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FeatureBranchSelectionDialog.java index 1c44ff7261..bc442184a4 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FeatureBranchSelectionDialog.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FeatureBranchSelectionDialog.java @@ -11,7 +11,6 @@ package org.eclipse.egit.gitflow.ui.internal.dialogs; import static org.eclipse.jface.dialogs.IDialogConstants.CANCEL_LABEL; -import static org.eclipse.jface.dialogs.IDialogConstants.OK_LABEL; import java.io.IOException; import java.util.ArrayList; @@ -45,13 +44,14 @@ public class FeatureBranchSelectionDialog extends MessageDialog { * @param title * @param message * @param featurePrefix + * @param okButtonLabel * @param gfRepo */ public FeatureBranchSelectionDialog(Shell parentShell, - List<Ref> refs, String title, String message, + List<Ref> refs, String okButtonLabel, String title, String message, String featurePrefix, GitFlowRepository gfRepo) { super(parentShell, title, null, message, MessageDialog.QUESTION, - new String[] { OK_LABEL, CANCEL_LABEL }, 0); + new String[] { okButtonLabel, CANCEL_LABEL }, 0); this.gfRepo = gfRepo; filteredFeatures = new FilteredBranchesWidget(refs, featurePrefix, gfRepo); } diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java index 9c623ceb4c..5c66aa4868 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java @@ -169,4 +169,11 @@ public class FinishFeatureDialog extends TitleAreaDialog { public boolean isKeepBranch() { return keepBranch; } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, UIText.FinishFeatureDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/InitDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/InitDialog.java index 2058220d4b..cd1297a7b3 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/InitDialog.java +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/InitDialog.java @@ -57,9 +57,11 @@ import org.eclipse.egit.core.op.CreateLocalBranchOperation; import org.eclipse.egit.gitflow.GitFlowRepository; import org.eclipse.egit.gitflow.InitParameters; import org.eclipse.egit.gitflow.WrongGitFlowStateException; +import org.eclipse.egit.gitflow.ui.internal.UIText; import org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport; import org.eclipse.jface.databinding.dialog.ValidationMessageProvider; import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -303,4 +305,12 @@ public class InitDialog extends TitleAreaDialog { public InitParameters getResult() { return gitflowInitConfig; } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.InitDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties index c7a1b49fae..cf3258e26a 100644 --- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties @@ -27,6 +27,7 @@ FeatureRebaseHandler_statusWas=Rebase result status was ''{0}''. FeatureStartHandler_pleaseProvideANameForTheNewFeature=Please provide a name for the new feature. FeatureStartHandler_provideFeatureName=Provide feature name FeatureStartHandler_startingNewFeature=Starting new Feature... +FeatureTrackHandler_ButtonOK=&Track FeatureTrackHandler_fetchingRemoteFeatures=Fetching remote features... FeatureTrackHandler_noRemoteFeatures=No remote features FeatureTrackHandler_noRemoteFeaturesFoundOnTheConfiguredRemote=No features were found on the configured remote. @@ -53,6 +54,7 @@ InitDialog_masterBranchIsMissing=Master branch missing InitDialog_releaseBranchPrefix=Release branch prefix InitDialog_selectedMasterBranchDoesNotExistCreateNow=Selected master branch ''{0}'' does not exist. Do you want to create it now? InitDialog_versionTagPrefix=Version tag prefix +InitDialog_ButtonOK=&Initialize InitHandler_doYouWantToInitNow=This repository is empty. Do you want to initialize it now with an empty commit? InitHandler_emptyRepository=Empty repository InitHandler_initialCommit=Initial Commit @@ -64,6 +66,7 @@ ReleaseStartHandler_provideANameForTheNewRelease=Please provide a name for the n ReleaseStartHandler_provideReleaseName=Provide release name ReleaseStartHandler_startCommitCouldNotBeDetermined=Start commit could not be determined. ReleaseStartHandler_startingNewRelease=Starting new Release... +FeatureCheckoutHandler_ButtonOK=&Checkout FeatureCheckoutHandler_checkingOutFeature=Checking out feature... FeatureCheckoutHandler_localFeatures=Local features: FeatureCheckoutHandler_selectFeature=Select Feature @@ -74,6 +77,7 @@ NameValidator_invalidName='%s' is not a valid name. None of the following charac NameValidator_nameAlreadyExists=Name '%s' already exists FeatureCheckoutHandler_cleanupDialog_title=Cannot Rebase Repository ''{0}'' FeatureCheckoutHandler_cleanupDialog_text=You have uncommitted changes. Either commit the changes, stash the changes, or discard the changes by resetting the current branch. +FinishFeatureDialog_ButtonOK=&Finish FinishFeatureDialog_keepBranch=&Keep branch - do not delete branch after finishing the feature FinishFeatureDialog_saveAsDefault=Save as &default FinishFeatureDialog_squashCheck=&Squash - produce a single commit from the changes in this feature @@ -81,5 +85,6 @@ FinishFeatureDialog_title=Feature finish options FinishFeatureDialog_setParameterForFinishing=Set options for finishing {0}. ReleaseFinishOperation_unexpectedConflictsReleaseAborted=Unexpected conflicts while merging to {0}. Finish release aborted. HotfixFinishOperation_unexpectedConflictsHotfixAborted=Unexpected conflicts while merging to {0}. Finish hotfix aborted. +StartDialog_ButtonOK=&Start UIIcons_errorDeterminingIconBase=Can't determine icon base. UIIcons_errorLoadingPluginImage=Can''t load plugin image ''{0}''. diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LoginDialogTester.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LoginDialogTester.java index dc3d927560..70483c1606 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LoginDialogTester.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LoginDialogTester.java @@ -11,7 +11,6 @@ package org.eclipse.egit.ui.common; import org.eclipse.egit.ui.internal.UIText; -import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; public class LoginDialogTester { @@ -22,7 +21,7 @@ public class LoginDialogTester { bot.textWithLabel(UIText.LoginDialog_user).setText(user); bot.textWithLabel(UIText.LoginDialog_password).setText(password); bot.checkBoxWithLabel(UIText.LoginDialog_storeInSecureStore).deselect(); - bot.button(IDialogConstants.OK_LABEL).click(); + bot.button(UIText.LoginDialog_ButtonOK).click(); } } diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java index 7ca9b5b62a..83dba055a7 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java @@ -43,7 +43,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa bot.waitUntil(shellIsActive(UIText.FinishFeatureDialog_title)); selectOptions(); bot.checkBox(UIText.FinishFeatureDialog_saveAsDefault).click(); - bot.button("OK").click(); + bot.button(UIText.FinishFeatureDialog_ButtonOK).click(); preFinish(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); } @@ -67,7 +67,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa bot.waitUntil(shellIsActive(UIText.FeatureStartHandler_provideFeatureName)); bot.text().setText(featureName); - bot.button("OK").click(); + bot.button(UIText.StartDialog_ButtonOK).click(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); } @@ -91,7 +91,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa bot.text().setText(featureName); TestUtil.waitForJobs(500, 5000); bot.tree().select(featureName); - bot.button("OK").click(); + bot.button(UIText.FeatureCheckoutHandler_ButtonOK).click(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); } diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java index 6be0187837..ab42efce06 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java @@ -146,7 +146,7 @@ public class InitHandlerTest extends AbstractGitflowHandlerTest { private void fillDialog(String masterBranch) { typeInto(InitDialog_developBranch, ILLEGAL_BRANCH_NAME); - SWTBotButton ok = bot.button("OK"); + SWTBotButton ok = bot.button(UIText.InitDialog_ButtonOK); assertFalse(ok.isEnabled()); typeInto(InitDialog_developBranch, DEVELOP_BRANCH); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/StashesMenuTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/StashesMenuTest.java index 785e791891..1cab418ed5 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/StashesMenuTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/StashesMenuTest.java @@ -19,7 +19,6 @@ import org.eclipse.egit.ui.common.LocalRepositoryTestCase; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.egit.ui.test.ContextMenuHelper; import org.eclipse.egit.ui.test.TestUtil; -import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; @@ -65,7 +64,7 @@ public class StashesMenuTest extends LocalRepositoryTestCase { SWTBotText enterMessageText = createDialog.bot().text(0); String stashMessage = "stash message"; enterMessageText.setText(stashMessage); - createDialog.bot().button(IDialogConstants.OK_LABEL).click(); + createDialog.bot().button(UIText.StashCreateCommand_ButtonOK).click(); assertEquals(originalContent, getTestFileContent()); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java index 1f351ac7af..5c12d43d88 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java @@ -13,8 +13,8 @@ package org.eclipse.egit.ui.prefpages.configuration; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.File; import java.util.ArrayList; @@ -126,7 +126,8 @@ public class GlobalConfigurationPageTest { // reset saved preferences state SWTBotShell preferencePage = new Eclipse().openPreferencePage(null); preferencePage.bot().tree(0).getTreeItem("General").select(); - preferencePage.bot().button(IDialogConstants.OK_LABEL).click(); + preferencePage.bot().button(IDialogConstants.OK_LABEL) + .click(); TestUtil.processUIEvents(); } @@ -168,7 +169,7 @@ public class GlobalConfigurationPageTest { addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel) .setText("true"); // close the dialog - addDialog.bot().button(IDialogConstants.OK_LABEL).click(); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK).click(); // close the editor preferencePage.bot().button(IDialogConstants.OK_LABEL).click(); config.load(); @@ -194,7 +195,7 @@ public class GlobalConfigurationPageTest { addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel) .setText("true"); // close the dialog - addDialog.bot().button(IDialogConstants.OK_LABEL).click(); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK).click(); // close the editor preferencePage.bot().button(IDialogConstants.OK_LABEL).click(); config.load(); @@ -241,7 +242,7 @@ public class GlobalConfigurationPageTest { .setText(TESTSECTION + "." + TESTNAME); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel) .setText("true"); - assertTrue(addDialog.bot().button(IDialogConstants.OK_LABEL) + assertTrue(addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) .isEnabled()); addDialog.close(); } @@ -255,74 +256,91 @@ public class GlobalConfigurationPageTest { .shell(UIText.AddConfigEntryDialog_AddConfigTitle); addDialog.activate(); assertFalse("Should be disabled when neither key nor value set", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel) .setText("Somevalue"); assertFalse("Should be disabled when no key", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(TESTSECTION); assertFalse("Should be disabled when no dot", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(TESTSECTION + "." + TESTNAME); assertTrue("Should be enabled with one dot", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(TESTSECTION + "." + TESTSUBSECTION + "." + TESTNAME); assertTrue("Should be enabled with two dots", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(TESTSECTION + ". some stuff with dots.. and . non-ASCII characters: àéè." + TESTNAME); // ok: first and last section alphanumeric,subsection will be quoted assertTrue("Should be enabled with strange subsection", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("föö.bar.baz"); assertFalse("Should be disabled with non-ASCII in first segment", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foo.bar.bàz"); assertFalse("Should be disabled with non-ASCII in last segment", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foo bar.baz"); assertFalse("Should be disabled with blank in first segment", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foo.bar baz"); assertFalse("Should be disabled with blank in last segment", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foo-bar.baz-"); assertTrue("Should be enabled with dashes", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foo.bar."); assertFalse("Should be disabled when ending in dot", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(".foo.bar."); assertFalse("Should be disabled when beginning with dot", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText(".."); assertFalse("Should be disabled for \"..\"", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foobar.9nines"); assertFalse("Should be disabled for variable name starting with digit", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foobar.-bar"); assertFalse("Should be disabled for variable name starting with a dash", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel) .setText("foobar.b-9"); assertTrue("Should be enabled for variable name starting with a letter", - addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled()); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) + .isEnabled()); } @Test @@ -340,11 +358,11 @@ public class GlobalConfigurationPageTest { .setText(TESTSECTION + "." + subsection + "." + TESTNAME); addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel) .setText("true"); - assertTrue(addDialog.bot().button(IDialogConstants.OK_LABEL) + assertTrue(addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK) .isEnabled()); // close the dialog - addDialog.bot().button(IDialogConstants.OK_LABEL).click(); + addDialog.bot().button(UIText.AddConfigEntryDialog_ButtonOK).click(); // close the editor preferencePage.bot().button(IDialogConstants.OK_LABEL).click(); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java index 13315742c3..d701d66242 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java @@ -409,11 +409,13 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase { // rename stable to renamed SWTBotShell newNameDialog = bot.shell(UIText.BranchRenameDialog_Title); newNameDialog.bot().text().setText("master"); - assertFalse(newNameDialog.bot().button(IDialogConstants.OK_LABEL) + assertFalse(newNameDialog.bot() + .button(UIText.RenameBranchDialog_RenameButtonLabel) .isEnabled()); newNameDialog.bot().text().setText("renamed"); - newNameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + newNameDialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel) + .click(); TestUtil.joinJobs(JobFamilies.CHECKOUT); @@ -427,7 +429,8 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase { newNameDialog = bot.shell(UIText.BranchRenameDialog_Title); newNameDialog.bot().text().setText("stable"); - newNameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + newNameDialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel) + .click(); TestUtil.joinJobs(JobFamilies.CHECKOUT); dialog = openRenameBranchDialog(); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java index 4724595ed7..6be393b081 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java @@ -38,7 +38,6 @@ import org.eclipse.egit.ui.internal.dialogs.CompareTreeView; import org.eclipse.egit.ui.test.ContextMenuHelper; import org.eclipse.egit.ui.test.JobJoiner; import org.eclipse.egit.ui.test.TestUtil; -import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.ResetCommand.ResetType; import org.eclipse.jgit.lib.Constants; @@ -127,7 +126,8 @@ public class CompareActionsTest extends LocalRepositoryTestCase { JobJoiner jobJoiner = JobJoiner.startListening( ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS); - dialog.bot().button(IDialogConstants.OK_LABEL).click(); + dialog.bot().button(UIText.HistoryCommitSelectionDialog_ButtonOK) + .click(); jobJoiner.join(); closeFirstEmptySynchronizeDialog(); @@ -141,7 +141,8 @@ public class CompareActionsTest extends LocalRepositoryTestCase { jobJoiner = JobJoiner.startListening( ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS); - dialog.bot().button(IDialogConstants.OK_LABEL).click(); + dialog.bot().button(UIText.HistoryCommitSelectionDialog_ButtonOK) + .click(); jobJoiner.join(); assertSynchronizeFile1Changed(); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java index 7b7df801cf..a267d25c79 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java @@ -324,10 +324,12 @@ public class GitRepositoriesViewBranchHandlingTest extends renameDialog.bot().text(" " + // the text is now in the error message, and the MessageAreaDialog seems to add a space NLS.bind(UIText.ValidationUtils_InvalidRefNameMessage, "refs/heads/invalid~name")); - assertFalse(renameDialog.bot().button(IDialogConstants.OK_LABEL) + assertFalse(renameDialog.bot() + .button(UIText.RenameBranchDialog_RenameButtonLabel) .isEnabled()); newBranchNameText.setText("newmaster"); - renameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + renameDialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel) + .click(); refreshAndWait(); @@ -343,7 +345,7 @@ public class GitRepositoriesViewBranchHandlingTest extends newBranchNameText = renameDialog.bot().text(0); newBranchNameText.setText("master"); - renameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + renameDialog.bot().button(UIText.BranchRenameDialog_ButtonOK).click(); refreshAndWait(); @@ -501,7 +503,8 @@ public class GitRepositoriesViewBranchHandlingTest extends }; ListenerHandle handle = repo.getConfig().addChangeListener(listener); // only now click ok - configureBranchDialog.bot().button("OK").click(); + configureBranchDialog.bot() + .button(UIText.BranchConfigurationDialog_ButtonOK).click(); // cleanup behind ourselves handle.remove(); diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java index befc5bbcb7..e10c09e83c 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java @@ -144,7 +144,7 @@ public class GitRepositoriesViewRemoteHandlingTest extends "testRemote"); // configure fetch first shell.bot().radio(UIText.NewRemoteDialog_FetchRadio).click(); - shell.bot().button(IDialogConstants.OK_LABEL).click(); + shell.bot().button(UIText.NewRemoteDialog_ButtonOK).click(); // configure fetch dialog shell = bot.shell(UIText.SimpleConfigureFetchDialog_WindowTitle); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java index 061316b37f..53cb73828c 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java @@ -121,6 +121,9 @@ public class UIText extends NLS { public static String AddConfigEntryDialog_ValueLabel; /** */ + public static String AddConfigEntryDialog_ButtonOK; + + /** */ public static String AddRemotePage_EnterRemoteNameMessage; /** */ @@ -3169,6 +3172,9 @@ public class UIText extends NLS { public static String BranchConfigurationDialog_UpstreamBranchLabel; /** */ + public static String BranchConfigurationDialog_ButtonOK; + + /** */ public static String BranchOperationUI_CheckoutError_DialogMessage; /** */ @@ -3247,6 +3253,9 @@ public class UIText extends NLS { public static String BranchRenameDialog_WrongPrefixErrorMessage; /** */ + public static String BranchRenameDialog_ButtonOK; + + /** */ public static String BranchPropertySource_RebaseDescriptor; /** */ @@ -3592,6 +3601,9 @@ public class UIText extends NLS { public static String DeleteBranchOnCommitHandler_DeleteBranchesDialogTitle; /** */ + public static String DeletePathsOperationUI_ButtonOK; + + /** */ public static String DeleteRepositoryConfirmDialog_DeleteGitDirCheckbox; /** */ @@ -4763,6 +4775,9 @@ public class UIText extends NLS { public static String LoginDialog_user; /** */ + public static String LoginDialog_ButtonOK; + + /** */ public static String NewRemoteDialog_ConfigurationMessage; /** */ @@ -4787,6 +4802,9 @@ public class UIText extends NLS { public static String NewRemoteDialog_WindowTitle; /** */ + public static String NewRemoteDialog_ButtonOK; + + /** */ public static String NewRepositoryWizard_WizardTitle; /** */ @@ -5288,6 +5306,12 @@ public class UIText extends NLS { public static String CommitSelectionDialog_WindowTitle; /** */ + public static String CommitSelectionDialog_ButtonOK; + + /** */ + public static String HistoryCommitSelectionDialog_ButtonOK; + + /** */ public static String CommitUI_commitFailed; /** */ @@ -5558,6 +5582,9 @@ public class UIText extends NLS { public static String StashCreateCommand_includeUntrackedLabel; /** */ + public static String StashCreateCommand_ButtonOK; + + /** */ public static String StashDropCommand_confirmSingle; /** */ diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java index 152db17647..e0e4d6fc61 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java @@ -26,6 +26,7 @@ import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.GitLabelProvider; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.egit.ui.internal.search.CommitSearchPage; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.viewers.StyledString; @@ -231,4 +232,12 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog { return labelProvider.getText(item); } + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.CommitSelectionDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } + } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/LoginDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/LoginDialog.java index c269401989..f7e44bb4d1 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/LoginDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/LoginDialog.java @@ -16,6 +16,7 @@ import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.UIPreferences; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jgit.transport.URIish; import org.eclipse.swt.SWT; @@ -131,4 +132,11 @@ class LoginDialog extends Dialog { this.oldUser = oldUser; } + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.LoginDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java index da56abf714..33cb092e8c 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchConfigurationDialog.java @@ -25,6 +25,7 @@ import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.CommonUtils; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.egit.ui.internal.components.BranchRebaseModeCombo; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jgit.api.PullCommand; @@ -251,4 +252,12 @@ public class BranchConfigurationDialog extends TitleAreaDialog { Activator.handleError(e.getMessage(), e, true); } } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.BranchConfigurationDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java index cd6c96b4b0..b6b52951f0 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java @@ -19,6 +19,7 @@ import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.egit.ui.internal.ValidationUtils; import org.eclipse.egit.ui.internal.components.BranchNameNormalizer; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; @@ -148,4 +149,12 @@ public class BranchRenameDialog extends TitleAreaDialog { public String getNewName() { return newName; } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.BranchRenameDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java index 5f03d56aa6..7f08eb9984 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java @@ -15,6 +15,7 @@ package org.eclipse.egit.ui.internal.dialogs; import java.util.Set; import org.eclipse.egit.ui.internal.UIText; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jgit.lib.ConfigConstants; @@ -154,4 +155,11 @@ public class NewRemoteDialog extends TitleAreaDialog { return pushMode; } + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.NewRemoteDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java index 13cd1101a0..d1c33cc7d3 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java @@ -23,6 +23,7 @@ import org.eclipse.egit.ui.UIPreferences; import org.eclipse.egit.ui.UIUtils; import org.eclipse.egit.ui.internal.GitLabels; import org.eclipse.egit.ui.internal.UIText; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; @@ -280,4 +281,13 @@ public class CommitSelectionDialog extends TitleAreaDialog { else return OrTreeFilter.create(filters); } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.HistoryCommitSelectionDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } + } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/DeletePathsOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/DeletePathsOperationUI.java index db366121bd..9b5d1a83e7 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/DeletePathsOperationUI.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/DeletePathsOperationUI.java @@ -21,10 +21,12 @@ import org.eclipse.egit.core.internal.util.ResourceUtil; import org.eclipse.egit.core.op.DeletePathsOperation; import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.UIText; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.window.IShellProvider; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.actions.DeleteResourceAction; /** @@ -67,8 +69,18 @@ public class DeletePathsOperationUI { action.run(); } + private String[] getButtonLabels() { + return new String[] { UIText.DeletePathsOperationUI_ButtonOK, IDialogConstants.CANCEL_LABEL }; + } + + private boolean openConfirm(Shell parent, String title, String message) { + MessageDialog dialog = new MessageDialog(parent, title, null, message, + MessageDialog.CONFIRM, 0, getButtonLabels()); + return dialog.open() == 0; + } + private void runNonWorkspaceAction() { - boolean performAction = MessageDialog.openConfirm( + boolean performAction = openConfirm( shellProvider.getShell(), UIText.DeleteResourcesOperationUI_confirmActionTitle, UIText.DeleteResourcesOperationUI_confirmActionMessage); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/AddConfigEntryDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/AddConfigEntryDialog.java index 6d5b494d5f..b2d9db9b62 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/AddConfigEntryDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/AddConfigEntryDialog.java @@ -17,6 +17,7 @@ import java.util.StringTokenizer; import java.util.regex.Pattern; import org.eclipse.egit.ui.internal.UIText; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.swt.SWT; @@ -178,4 +179,12 @@ public class AddConfigEntryDialog extends TitleAreaDialog { public String getValue() { return value; } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.AddConfigEntryDialog_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java index 018a0357d0..eef1614ee6 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java @@ -189,7 +189,13 @@ public class StashCreateUI { return includeUntracked; } + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, + UIText.StashCreateCommand_ButtonOK, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } } - } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties index 3f14fbbb51..f243705e80 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties @@ -50,6 +50,7 @@ AddConfigEntryDialog_KeyComponentsMessage=The key must have two or more componen AddConfigEntryDialog_KeyLabel=&Key AddConfigEntryDialog_MustEnterKeyMessage=Please enter a key. AddConfigEntryDialog_ValueLabel=&Value +AddConfigEntryDialog_ButtonOK=&Add AddRemotePage_EnterRemoteNameMessage=Please enter a remote name AddRemotePage_RemoteNameAlreadyExistsError=Remote already exists AddRemotePage_RemoteNameEmptyError=Enter a name for the remote @@ -1133,7 +1134,7 @@ BranchConfigurationDialog_ExceptionGettingRefs=Exception getting Refs BranchConfigurationDialog_RemoteLabel=Rem&ote: BranchConfigurationDialog_SaveBranchConfigFailed=Could not save branch configuration BranchConfigurationDialog_UpstreamBranchLabel=Upstream &Branch: - +BranchConfigurationDialog_ButtonOK=&Save BranchOperationUI_CheckoutError_DialogTitle=Problem checking out repository BranchOperationUI_CheckoutError_DialogMessage=Checking out {0} - {1} has failed. BranchOperationUI_CheckoutRemoteTrackingAsLocal=Check out as New Local Branch @@ -1160,6 +1161,7 @@ BranchRenameDialog_RenameExceptionMessage=Could not rename branch BranchRenameDialog_Title=Rename Branch BranchRenameDialog_WindowTitle=Rename Branch BranchRenameDialog_WrongPrefixErrorMessage=Cannot rename Ref with name {0} +BranchRenameDialog_ButtonOK=&Rename BranchPropertySource_RebaseDescriptor=Rebase BranchPropertySource_RemoteDescriptor=Remote BranchPropertySource_UpstreamBranchDescriptor=Upstream Branch @@ -1271,6 +1273,7 @@ DeleteBranchDialog_WindowTitle=Delete branch DeleteBranchOnCommitHandler_DeleteBranchesDialogButton=&Delete DeleteBranchOnCommitHandler_DeleteBranchesDialogMessage=Please select the branches you want to delete DeleteBranchOnCommitHandler_DeleteBranchesDialogTitle=Delete Branches +DeletePathsOperationUI_ButtonOK=&Delete DeleteRepositoryConfirmDialog_DeleteGitDirCheckbox=Delete Git repository data and history: DeleteRepositoryConfirmDialog_DeleteRepositoryConfirmMessage=Confirm deletion of repository. DeleteRepositoryConfirmDialog_DeleteRepositoryNoUndoWarning=Repository deletion cannot be undone. @@ -1676,6 +1679,8 @@ CommitSelectionDialog_SectionRepo=\ [{0}] CommitSelectionDialog_TaskSearching=Searching commits CommitSelectionDialog_Title=Open Git Commit CommitSelectionDialog_WindowTitle=Select a Commit +CommitSelectionDialog_ButtonOK=&Open +HistoryCommitSelectionDialog_ButtonOK=&Select CommitUI_commitFailed=Commit failed CommitUI_pushFailedMessage=Could not push {0} to {1}: {2} @@ -1722,6 +1727,7 @@ LoginDialog_password=Password LoginDialog_repository=Repository LoginDialog_storeInSecureStore=Store in Secure Store LoginDialog_user=User +LoginDialog_ButtonOK=&Save NewRemoteDialog_ConfigurationMessage=You need to configure the new remote for either fetch or push; you can add configuration for the other direction later NewRemoteDialog_DialogTitle=Please enter a name for the new remote NewRemoteDialog_FetchRadio=Configure &fetch @@ -1730,6 +1736,7 @@ NewRemoteDialog_NameLabel=Remote &name: NewRemoteDialog_PushRadio=Configure &push NewRemoteDialog_RemoteAlreadyExistsMessage=Remote {0} already exists NewRemoteDialog_WindowTitle=New Remote +NewRemoteDialog_ButtonOK=C&reate NewRepositoryWizard_WizardTitle=Create a Git Repository NonBlockingWizardDialog_BackgroundJobName=Background Job ({0}) NonDeletedFilesDialog_NonDeletedFilesMessage=The files below could not be deleted, \nperhaps because of some temporary file locks\nor because a directory represents a submodule @@ -1941,6 +1948,7 @@ StashCreateCommand_messageNoChanges=The repository does not contain any local ch StashCreateCommand_stashFailed=Stash create error StashCreateCommand_titleEnterCommitMessage=Commit Stash StashCreateCommand_titleNoChanges=No Changes +StashCreateCommand_ButtonOK=&Stash StashDropCommand_confirmMultiple=Are you sure you want to delete the {0} selected stashed commits? StashDropCommand_confirmSingle=Are you sure you want to delete stashed commit stash@'{'{0}'}'? StashDropCommand_confirmTitle=Confirm Stashed Commit Deletion |