Example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL

List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.

Prototype

String NEXT_LABEL

To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.

Click Source Link

Document

The label for next buttons.

Usage

From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTest.java

License:Open Source License

 @Test
public void testImportWizardGeneralProject() throws Exception {
   deleteAllProjects();//w w w  .j a v a2s  .c om
   assertProjectExistence(PROJ2, false);
   SWTBotTree tree = getOrOpenView().bot().tree();
   String wizardTitle = NLS.bind(
         UIText.GitCreateProjectViaWizardWizard_WizardTitle,
         repositoryFile.getPath());
   // start wizard from PROJ2
   myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
         PROJ2).select();
   ContextMenuHelper.clickContextMenu(tree, myUtil
         .getPluginLocalizedValue("ImportProjectsCommand"));
   SWTBotShell shell = bot.shell(wizardTitle);
   shell = bot.shell(wizardTitle);
   // try import existing project first
   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 PROJ2
   assertEquals(PROJ2, wizardNode);
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   waitInUI();
   assertTrue(shell.bot().tree().getAllItems().length == 0);
   shell.bot().button(IDialogConstants.BACK_LABEL).click();
   // import as general
   shell.bot().radio(UIText.GitSelectWizardPage_ImportAsGeneralButton).click();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().textWithLabel(
         UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());
   // switch to a sub directory and see if this is used
   shell.bot().button(IDialogConstants.BACK_LABEL).click();
   shell.bot().tree().getAllItems()[0].expand().getNode(PROJ2).expand()
         .getNode(FOLDER).select();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   String name = shell.bot().textWithLabel(
         UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText();
   assertEquals(FOLDER, name);
   shell.bot().button(IDialogConstants.BACK_LABEL).click();
   // switch back to the root directory
   shell.bot().tree().getAllItems()[0].expand().getNode(PROJ2).select();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().textWithLabel(
         UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());

   shell.bot().button(IDialogConstants.FINISH_LABEL).click();
   waitInUI();
   assertProjectExistence(PROJ2, true);
}

From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTest.java

License:Open Source License

 @Test
public void testImportWizardGeneralProjectWithWorkingSet() throws Exception {
   deleteAllProjects();//from   w w  w  .  jav  a2 s.  co m
   assertProjectExistence(PROJ1, false);
   SWTBotTree tree = getOrOpenView().bot().tree();
   String wizardTitle = NLS.bind(
         UIText.GitCreateProjectViaWizardWizard_WizardTitle,
         repositoryFile.getPath());
   // start wizard from PROJ1
   myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
         PROJ1).select();
   ContextMenuHelper.clickContextMenu(tree, myUtil
         .getPluginLocalizedValue("ImportProjectsCommand"));
   SWTBotShell shell = bot.shell(wizardTitle);
   shell = bot.shell(wizardTitle);
   // try import existing project first
   bot.radio(UIText.GitSelectWizardPage_ImportExistingButton).click();
   // auto share
   bot.radio(UIText.GitSelectWizardPage_AutoShareButton).click();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   waitInUI();
   shell.bot().tree().getAllItems()[0].check();
   // add to working set
   shell.bot().checkBox().select();
   // create new working set
   shell.bot().button("Select...").click();
   SWTBotShell workingSetDialog = bot.shell("Select Working Sets");
   workingSetDialog.bot().button("New...").click();
   SWTBotShell newDialog = bot.shell("New Working Set");
   newDialog.bot().table().select("Java");
   newDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
   String workingSetName = "myWorkingSet";
   newDialog.bot().text(0).setText(workingSetName);
   newDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
   workingSetDialog.bot().table().getTableItem(workingSetName).check();
   workingSetDialog.bot().button(IDialogConstants.OK_LABEL).click();
   shell.bot().button(IDialogConstants.FINISH_LABEL).click();
   waitInUI();
   assertProjectExistence(PROJ1, true);
   assertProjectInWorkingSet(workingSetName, PROJ1);
}

From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTest.java

License:Open Source License

 @Test
public void testImportWizardGeneralProjectManualShareCancel()
      throws Exception {
   deleteAllProjects();/*from  w  w w. j  a v a  2 s . co m*/
   assertProjectExistence(PROJ2, false);
   SWTBotTree tree = getOrOpenView().bot().tree();
   String wizardTitle = NLS.bind(
         UIText.GitCreateProjectViaWizardWizard_WizardTitle,
         repositoryFile.getPath());
   // start wizard from PROJ2
   myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
         PROJ2).select();
   ContextMenuHelper.clickContextMenu(tree, myUtil
         .getPluginLocalizedValue("ImportProjectsCommand"));
   SWTBotShell shell = bot.shell(wizardTitle);
   shell = bot.shell(wizardTitle);
   // import as general
   bot.radio(UIText.GitSelectWizardPage_ImportAsGeneralButton).click();
   // share manual
   bot.radio(UIText.GitSelectWizardPage_InteractiveShareButton).click();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().textWithLabel(
         UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().table().getTableItem(0).getText(0));
   // cancel -> not share
   shell.bot().button(IDialogConstants.CANCEL_LABEL).click();
   waitInUI();
   assertProjectExistence(PROJ2, true);
   RepositoryMapping mapping = RepositoryMapping
         .getMapping(ResourcesPlugin.getWorkspace().getRoot()
               .getProject(PROJ2));
   assertNull(mapping);
}

From source file:org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTest.java

License:Open Source License

 @Test
public void testImportWizardGeneralProjectManualShareOk() throws Exception {
   deleteAllProjects();//from  w  w w  . j a  v  a  2  s .co m
   assertProjectExistence(PROJ2, false);
   SWTBotTree tree = getOrOpenView().bot().tree();
   String wizardTitle = NLS.bind(
         UIText.GitCreateProjectViaWizardWizard_WizardTitle,
         repositoryFile.getPath());
   // start wizard from PROJ2
   myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
         PROJ2).select();
   ContextMenuHelper.clickContextMenu(tree, myUtil
         .getPluginLocalizedValue("ImportProjectsCommand"));
   SWTBotShell shell = bot.shell(wizardTitle);
   shell = bot.shell(wizardTitle);
   // import as general
   bot.radio(UIText.GitSelectWizardPage_ImportAsGeneralButton).click();
   // share manual
   bot.radio(UIText.GitSelectWizardPage_InteractiveShareButton).click();
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().textWithLabel(
         UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());
   shell.bot().button(IDialogConstants.NEXT_LABEL).click();
   assertEquals(PROJ2, shell.bot().table().getTableItem(0).getText(0));
   // finish -> share
   shell.bot().button(IDialogConstants.FINISH_LABEL).click();
   waitInUI();
   assertProjectExistence(PROJ2, true);
   RepositoryMapping mapping = RepositoryMapping
         .getMapping(ResourcesPlugin.getWorkspace().getRoot()
               .getProject(PROJ2));
   assertNotNull(mapping);
}

From source file:org.eclipse.epp.internal.mpc.ui.wizards.MarketplaceWizardDialog.java

License:Open Source License

public String getNextButtonLabel(IWizardPage page) {
    if (page == getWizard().getCatalogPage()) {
        return Messages.MarketplaceWizardDialog_Install_Now;
    } else if (page == getWizard().getFeatureSelectionWizardPage()) {
        return Messages.MarketplaceWizardDialog_Confirm;
    }//  w  ww  .j  a  v  a  2s . com
    return IDialogConstants.NEXT_LABEL;
}

From source file:org.eclipse.ltk.internal.ui.refactoring.ErrorWizardPage.java

License:Open Source License

/**
 * {@inheritDoc}/*from   www  . ja  v  a2s .c om*/
 */
public void setStatus(RefactoringStatus status) {
    fStatus = status;
    if (fStatus != null) {
        final int severity = fStatus.getSeverity();
        setPageComplete(severity < RefactoringStatus.FATAL);
        if (severity >= RefactoringStatus.FATAL) {
            setDescription(RefactoringUIMessages.ErrorWizardPage_cannot_proceed);
        } else if (severity >= RefactoringStatus.INFO) {
            setDescription(Messages.format(RefactoringUIMessages.ErrorWizardPage_confirm,
                    new String[] { getLabelAsText(IDialogConstants.NEXT_LABEL),
                            getLabelAsText(IDialogConstants.FINISH_LABEL) }));
        } else {
            setDescription(""); //$NON-NLS-1$
        }
    } else {
        setPageComplete(true);
        setDescription(""); //$NON-NLS-1$
    }
}

From source file:org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryErrorPage.java

License:Open Source License

/**
 * Creates a new refactoring history error page.
 *///w ww  .j  a v  a  2  s .  com
public RefactoringHistoryErrorPage() {
    super(true);
    setTitle(RefactoringUIMessages.RefactoringHistoryOverviewPage_title);
    setDescription(Messages.format(RefactoringUIMessages.RefactoringHistoryErrorPage_description, new String[] {
            getLabelAsText(IDialogConstants.NEXT_LABEL), getLabelAsText(IDialogConstants.FINISH_LABEL) }));
}

From source file:org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryErrorPage.java

License:Open Source License

/**
 * {@inheritDoc}/*  w  ww .j  a  v  a 2  s .  co  m*/
 */
public void setStatus(final RefactoringStatus status) {
    super.setStatus(status);
    if (status != null) {
        final int severity = status.getSeverity();
        if (severity >= RefactoringStatus.FATAL)
            setDescription(RefactoringUIMessages.RefactoringHistoryErrorPage_fatal_error);
        else if (severity >= RefactoringStatus.INFO)
            setDescription(Messages.format(RefactoringUIMessages.RefactoringHistoryErrorPage_info_error,
                    new String[] { getLabelAsText(IDialogConstants.NEXT_LABEL),
                            getLabelAsText(IDialogConstants.FINISH_LABEL) }));
    }
    if (fViewer != null)
        fViewer.setStatus(status);
}

From source file:org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.java

License:Open Source License

private Composite createPreviousAndNextButtons(Composite parent) {
    // Copied from Wizard Dialog.

    // increment the number of columns in the button bar
    GridLayout barLayout = (GridLayout) parent.getLayout();
    barLayout.numColumns += 2; // parent is assumed to have a GridLayout (see javadoc of Dialog#createButton(..))
    Composite composite = new Composite(parent, SWT.NONE);
    // create a layout with spacing and margins appropriate for the font
    // size.//from  w  ww. j  a  v a  2  s  . c  om
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // will be incremented by createButton
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    composite.setLayout(layout);
    composite.setFont(parent.getFont());
    Button backButton = createButton(composite, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    backButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            backPressed();
        }
    });
    Button nextButton = createButton(composite, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    nextButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            nextOrPreviewPressed();
        }
    });

    GridData data = new GridData();
    int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    Point minSize1 = backButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    Point minSize2 = nextButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    int minSize = Math.max(minSize1.x, minSize2.x);
    ((GridData) backButton.getLayoutData()).widthHint = minSize;
    ((GridData) nextButton.getLayoutData()).widthHint = minSize;
    data.widthHint = 2 * Math.max(widthHint, minSize) + barLayout.horizontalSpacing;
    data.horizontalAlignment = SWT.FILL;
    data.grabExcessHorizontalSpace = true;
    data.horizontalSpan = 2;
    composite.setLayoutData(data);

    return composite;
}

From source file:org.eclipse.osee.framework.ui.swt.NonmodalWizardDialog.java

License:Open Source License

private Composite createPreviousAndNextButtons(Composite parent) {
    // increment the number of columns in the button bar
    ((GridLayout) parent.getLayout()).numColumns++;
    Composite composite = new Composite(parent, SWT.NONE);
    // create a layout with spacing and margins appropriate for the font size.
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // will be incremented by createButton
    layout.marginWidth = 0;//from   w  ww .  j  ava  2 s.  co m
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    composite.setLayout(layout);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());
    backButton = createButton(composite, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    nextButton = createButton(composite, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    nextButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            //            System.out.println("the next button was pressed");
        }
    });
    return composite;
}