List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL
String NEXT_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.
Click Source Link
From source file:org.eclipse.egit.ui.common.PushWizardTester.java
License:Open Source License
public void nextPage() { bot.button(IDialogConstants.NEXT_LABEL).click(); }
From source file:org.eclipse.egit.ui.internal.push.PushBranchWizardTester.java
License:Open Source License
public void next() { wizard.button(IDialogConstants.NEXT_LABEL).click(); }
From source file:org.eclipse.egit.ui.internal.push.PushTagsWizardTester.java
License:Open Source License
public void assertNextDisabled() { assertFalse("Expected Next button to be disabled", wizard.button(IDialogConstants.NEXT_LABEL).isEnabled()); }
From source file:org.eclipse.egit.ui.submodule.SubmoduleAddTest.java
License:Open Source License
@Test public void addAtRoot() throws Exception { deleteAllProjects();//from www . j a v a 2 s .c om assertProjectExistence(PROJ1, false); clearView(); Activator.getDefault().getRepositoryUtil().addConfiguredRepository(repositoryFile); shareProjects(repositoryFile); assertProjectExistence(PROJ1, true); refreshAndWait(); assertHasRepo(repositoryFile); FileRepository repo = lookupRepository(repositoryFile); SWTBotTree tree = getOrOpenView().bot().tree(); tree.getAllItems()[0].select(); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue(ADD_SUBMODULE_CONTEXT_MENU_LABEL)); SWTBotShell shell = bot.shell(UIText.AddSubmoduleWizard_WindowTitle); shell.activate(); shell.bot().textWithLabel(UIText.SubmodulePathWizardPage_PathLabel).setText("sub"); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); shell.bot().textWithLabel(UIText.RepositorySelectionPage_promptURI + ":") .setText(repo.getDirectory().toURI().toString()); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); waitInUI(); TestUtil.joinJobs(JobFamilies.SUBMODULE_ADD); refreshAndWait(); tree = getOrOpenView().bot().tree(); SWTBotTreeItem submodules = tree.getAllItems()[0].select().expand() .getNode(UIText.RepositoriesViewLabelProvider_SubmodulesNodeText); assertNotNull(submodules); submodules.expand(); assertEquals(1, submodules.rowCount()); }
From source file:org.eclipse.egit.ui.test.team.actions.DisconnectConnectTest.java
License:Open Source License
private SWTBotShell openConnectDialog() throws Exception { SWTBotTree projectExplorerTree = bot.viewById("org.eclipse.jdt.ui.PackageExplorer").bot().tree(); getProjectItem(projectExplorerTree, PROJ1).select(); String menuString = "Share Project..."; ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team", menuString); bot.shell("Share Project").bot().table().getTableItem("Git").select(); bot.button(IDialogConstants.NEXT_LABEL).click(); return bot.shell(UIText.SharingWizard_windowTitle); }
From source file:org.eclipse.egit.ui.test.team.actions.FetchAndMergeActionTest.java
License:Open Source License
@Test public void testFetchFromOriginThenMerge() throws Exception { String previousCommit = prepare(); String oldContent = getTestFileContent(); SWTBotShell fetchDialog = openFetchDialog(); fetchDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); fetchDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); SWTBotShell confirm = bot.shell(NLS.bind(UIText.FetchResultDialog_title, "origin")); SWTBotTable table = confirm.bot().table(); String branch = table.getTableItem(0).getText(2); assertTrue("Wrong result", previousCommit.startsWith(branch.substring(0, 7))); confirm.close();//from ww w. j ava 2 s . c o m String newContent = getTestFileContent(); assertEquals(oldContent, newContent); fetchDialog = openFetchDialog(); fetchDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); fetchDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); confirm = bot.shell(NLS.bind(UIText.FetchResultDialog_title, "origin")); int count = confirm.bot().table().rowCount(); confirm.close(); assertEquals("Wrong result count", 0, count); newContent = getTestFileContent(); assertEquals(oldContent, newContent); SWTBotShell mergeDialog = openMergeDialog(); mergeDialog.bot().tree().getTreeItem(REMOTE_BRANCHES).expand().getNode("origin/master").select(); mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click(); bot.shell(UIText.MergeAction_MergeResultTitle).close(); newContent = getTestFileContent(); assertFalse(oldContent.equals(newContent)); }
From source file:org.eclipse.egit.ui.test.team.actions.PushActionTest.java
License:Open Source License
private void pushTo(String destination, boolean withConfirmPage) throws Exception, MissingObjectException, IncorrectObjectTypeException, IOException { Repository repo = lookupRepository(remoteRepositoryFile); RevWalk rw = new RevWalk(repo); String previous = rw.parseCommit(repo.resolve("HEAD")).name(); touchAndSubmit(null);/* ww w . j ava 2 s. co m*/ SWTBotShell pushDialog = openPushDialog(); SWTBotCombo destinationCombo = pushDialog.bot().comboBox(); String[] items = destinationCombo.items(); for (int i = 0; i < items.length; i++) { if (items[i].startsWith(destination)) destinationCombo.setSelection(i); } pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); if (withConfirmPage) pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); SWTBotShell confirm = bot.shell(NLS.bind(UIText.ResultDialog_title, destination)); String result = confirm.bot().table().getTableItem(0).getText(3); assertTrue("Wrong result", previous.startsWith(result.substring(0, 7))); confirm.close(); pushDialog = openPushDialog(); destinationCombo = pushDialog.bot().comboBox(); for (int i = 0; i < items.length; i++) { if (items[i].startsWith(destination)) destinationCombo.setSelection(i); } pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); if (withConfirmPage) pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click(); pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); confirm = bot.shell(NLS.bind(UIText.ResultDialog_title, destination)); result = confirm.bot().table().getTableItem(0).getText(3); confirm.close(); assertEquals("Wrong result", UIText.PushResultTable_statusUpToDate, result); }
From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewRemoteHandlingTest.java
License:Open Source License
/** * Remote configuration scenarios//from w w w.ja v a 2 s.c o m * * @throws Exception */ @Test public void testConfigureRemote() throws Exception { removeRemotesConfig(repositoryFile); refreshAndWait(); SWTBotTree tree = getOrOpenView().bot().tree(); SWTBotTreeItem remotesItem = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand(); remotesItem = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand(); remotesItem.select(); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("NewRemoteCommand")); SWTBotShell shell = bot.shell(UIText.ConfigureRemoteWizard_WizardTitle_New); shell.bot().textWithLabel(UIText.SelectRemoteNamePage_RemoteNameLabel).setText("testRemote"); // select configure fetch shell.bot().checkBox(UIText.SelectRemoteNamePage_ConfigureFetch_button).select(); // select configure push shell.bot().checkBox(UIText.SelectRemoteNamePage_ConfigurePush_button).select(); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // Click change shell.bot().button(UIText.ConfigureUriPage_Change_button).click(); shell = bot.shell(UIText.SelectUriWiazrd_Title); shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath()); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); // now we have the fetch URI shell = bot.shell(UIText.ConfigureRemoteWizard_WizardTitle_New); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // add all branches shell.bot().button(UIText.RefSpecPanel_predefinedAll).click(); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // the URIish-like path String testString = new org.eclipse.jgit.transport.URIish("file:///" + remoteRepositoryFile.getPath()) .toPrivateString(); assertEquals(testString, shell.bot().text().getText()); // let's try to add the same URI as push shell.bot().button(UIText.ConfigureUriPage_Add_button).click(); shell = bot.shell(UIText.SelectUriWiazrd_Title); shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath()); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); // we get a "duplicate URI" popup shell = bot.shell(UIText.ConfigureUriPage_DuplicateUriTitle); shell.close(); shell = bot.shell(UIText.ConfigureRemoteWizard_WizardTitle_New); // we continue without adding a special push URI shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // add all branches shell.bot().button(UIText.RefSpecPanel_predefinedAll).click(); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); refreshAndWait(); // assert 2 children SWTBotTreeItem item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote") .expand(); List<String> children = item.getNodes(); assertTrue(children.size() == 2); item.getNode(0).select(); // we remove the fetch, the URI is copied into push ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("RemoveFetchCommand")); refreshAndWait(); // assert 1 children item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 1); item.getNode(0).select(); // now we also remove the push ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("RemovePushCommand")); refreshAndWait(); // assert 0 children item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 0); myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").select(); String shellText = NLS.bind(UIText.ConfigureRemoteWizard_WizardTitle_Change, "testRemote"); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("ConfigureFetchCommand")); shell = bot.shell(shellText); // change is 0 shell.bot().button(UIText.ConfigureUriPage_Change_button).click(); shell = bot.shell(UIText.SelectUriWiazrd_Title); shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath()); // finish is 1 shell.bot().button(IDialogConstants.FINISH_LABEL).click(); shell = bot.shell(shellText); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // all branches shell.bot().button(UIText.RefSpecPanel_predefinedAll).click(); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); refreshAndWait(); // assert 1 children item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 1); // we remove the fetch again item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 1); item.getNode(0).select(); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("RemoveFetchCommand")); refreshAndWait(); myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").select(); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("ConfigurePushCommand")); shell = bot.shell(shellText); shell.bot().button(UIText.ConfigureUriPage_Add_button).click(); shell = bot.shell(UIText.SelectUriWiazrd_Title); shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath()); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); shell = bot.shell(shellText); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); // all branches shell.bot().button(UIText.RefSpecPanel_predefinedAll).click(); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); refreshAndWait(); // assert 2 children item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 1); item.select(); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("RepoViewRemoveRemote.label")); shell = bot.shell(UIText.RepositoriesView_ConfirmDeleteRemoteHeader); // Cancel shell.bot().button(IDialogConstants.CANCEL_LABEL).click(); refreshAndWait(); // assert 2 children item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode("testRemote").expand(); children = item.getNodes(); assertTrue(children.size() == 1); ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("RepoViewRemoveRemote.label")); // OK bot.shell(UIText.RepositoriesView_ConfirmDeleteRemoteHeader).bot().button(IDialogConstants.OK_LABEL) .click(); refreshAndWait(); assertTrue(myRepoViewUtil.getRemotesItem(tree, repositoryFile).getNodes().isEmpty()); }
From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewRepoHandlingTest.java
License:Open Source License
@Test public void testCloneRepoButton() throws Exception { clearView();/* ww w .ja v a 2s . co m*/ refreshAndWait(); assertEmpty(); getOrOpenView().toolbarButton(myUtil.getPluginLocalizedValue("RepoViewCloneRepository.tooltip")).click(); SWTBotShell shell = bot.shell(UIText.GitCloneWizard_title).activate(); // for some reason, textWithLabel doesn't seem to work shell.bot().textInGroup(UIText.RepositorySelectionPage_groupLocation, 0).setText(repositoryFile.getPath()); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); waitInUI(); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); waitInUI(); // for some reason textWithLabel doesn't work; 0 is path text SWTBotText pathText = shell.bot().text(0); pathText.setText(pathText.getText() + "Cloned"); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); waitInUI(); refreshAndWait(); assertHasClonedRepo(); }
From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTest.java
License:Open Source License
/** * Import wizard golden path test/*from ww w . jav a 2s . c om*/ * * @throws Exception */ @Test public void testImportWizard() throws Exception { deleteAllProjects(); assertProjectExistence(PROJ1, false); SWTBotTree tree = getOrOpenView().bot().tree(); SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile); String wizardTitle = NLS.bind( UIText.GitCreateProjectViaWizardWizard_WizardTitle, repositoryFile.getPath()); // start wizard from root item item.select(); ContextMenuHelper.clickContextMenu(tree, myUtil .getPluginLocalizedValue("ImportProjectsCommand")); SWTBotShell shell = bot.shell(wizardTitle); bot.radio(UIText.GitSelectWizardPage_ImportExistingButton).click(); // auto share bot.radio(UIText.GitSelectWizardPage_AutoShareButton).click(); TableCollection selected = shell.bot().tree().selection(); String wizardNode = selected.get(0, 0); // wizard directory should be working dir assertEquals(myRepoViewUtil.getWorkdirItem(tree, repositoryFile) .getText(), wizardNode); waitInUI(); shell.close(); // start wizard from .git myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode( Constants.DOT_GIT).select(); ContextMenuHelper.clickContextMenu(tree, myUtil .getPluginLocalizedValue("ImportProjectsCommand")); shell = bot.shell(wizardTitle); selected = shell.bot().tree().selection(); wizardNode = selected.get(0, 0); // wizard directory should be .git assertEquals(Constants.DOT_GIT, wizardNode); shell.bot().button(IDialogConstants.NEXT_LABEL).click(); waitInUI(); assertTrue(shell.bot().tree().getAllItems().length == 0); shell.bot().button(IDialogConstants.BACK_LABEL).click(); // go to project with .project shell.bot().tree().getAllItems()[0].getNode(PROJ1).select(); // next is 1 shell.bot().button(IDialogConstants.NEXT_LABEL).click(); waitInUI(); assertTrue(shell.bot().tree().getAllItems().length == 1); assertTrue(!shell.bot().button(IDialogConstants.FINISH_LABEL) .isEnabled()); shell.bot().button(UIText.WizardProjectsImportPage_selectAll).click(); assertTrue(shell.bot().button(IDialogConstants.FINISH_LABEL) .isEnabled()); shell.bot().button(IDialogConstants.FINISH_LABEL).click(); waitInUI(); assertProjectExistence(PROJ1, true); }