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.papyrus.modelexplorer.dialog.NavigatorSearchDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    backButton.setEnabled(false);/*from  w  w  w . ja v a2  s  .c  o m*/
    nextButton.setEnabled(false);

    nextButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            ISelection sel = viewer.getSelection();
            if (!(sel instanceof StructuredSelection)) {
                return;
            }
            StructuredSelection ssel = (StructuredSelection) sel;

            int index = matchedObjects.lastIndexOf(ssel.getFirstElement());
            if (index == matchedObjects.size() - 1) {
                index = -1;
            }
            index++;
            fireSetSelection(new StructuredSelection(matchedObjects.get(index)), true);
        }

    });

    backButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            ISelection sel = viewer.getSelection();
            if (!(sel instanceof StructuredSelection)) {
                return;
            }
            StructuredSelection ssel = (StructuredSelection) sel;

            int index = matchedObjects.lastIndexOf(ssel.getFirstElement());
            if (index == 0) {
                index = matchedObjects.size() - 1;
            }
            index--;
            fireSetSelection(new StructuredSelection(matchedObjects.get(index)), true);
        }

    });
}

From source file:org.eclipse.papyrus.views.modelexplorer.dialog.ApexNavigatorSearchDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    /* apex replaced //ww w. j av a  2  s  .  c o m
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
    true);
    */

    backButton.setEnabled(false);
    nextButton.setEnabled(false);

    nextButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            if (currentIndex >= matchedObjects.size() - 1) {
                currentIndex = 0;
            } else {
                currentIndex++;
            }
            fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true);
        }

    });

    backButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            if (currentIndex <= 0) {
                currentIndex = matchedObjects.size() - 1;
            } else {
                currentIndex--;
            }
            fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true);
        }

    });

    /* apex added start */
    final Shell shell = parent.getShell();
    okButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            System.out.println(
                    "ApexNavigatorSearchDialog.createButtonsForButtonBar(...).new SelectionListener() {...}.widgetSelected(), line : "
                            + Thread.currentThread().getStackTrace()[1].getLineNumber());
            HierarchyInformationControl resultControl = new HierarchyInformationControl(shell,
                    SWT.RESIZE | SWT.BORDER, SWT.NONE);

            resultControl.open();
            /*
            if(currentIndex <= 0) {
               currentIndex = matchedObjects.size() - 1;
            } else {
               currentIndex--;
            }
            fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true);
            */
        }

    });
    /* apex added end */
}

From source file:org.eclipse.sirius.common.ui.tools.api.dialog.SiriusMessageDialogWithToggle.java

License:Open Source License

/**
 * Attempt to find a standard JFace button id that matches the specified
 * button label. If no match can be found, use the default id provided.
 * //from   w  w  w.  jav  a  2s.  c o  m
 * Overridden to investigate the provided buttons.
 * 
 * @param buttonLabel
 *            the button label whose id is sought
 * @param defaultId
 *            the id to use for the button if there is no standard id
 * @return the id for the specified button label
 */
// CHECKSTYLE:OFF
private int mapButtonLabelToButtonID(String buttonLabel, int defaultId) {
    // CHECKSTYLE:OON
    // Not pretty but does the job...
    if (IDialogConstants.OK_LABEL.equals(buttonLabel)) {
        return IDialogConstants.OK_ID;
    }

    if (IDialogConstants.YES_LABEL.equals(buttonLabel)) {
        return IDialogConstants.YES_ID;
    }

    if (IDialogConstants.NO_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NO_ID;
    }

    if (IDialogConstants.CANCEL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.CANCEL_ID;
    }

    if (IDialogConstants.YES_TO_ALL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.YES_TO_ALL_ID;
    }

    if (IDialogConstants.SKIP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.SKIP_ID;
    }

    if (IDialogConstants.STOP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.STOP_ID;
    }

    if (IDialogConstants.ABORT_LABEL.equals(buttonLabel)) {
        return IDialogConstants.ABORT_ID;
    }

    if (IDialogConstants.RETRY_LABEL.equals(buttonLabel)) {
        return IDialogConstants.RETRY_ID;
    }

    if (IDialogConstants.IGNORE_LABEL.equals(buttonLabel)) {
        return IDialogConstants.IGNORE_ID;
    }

    if (IDialogConstants.PROCEED_LABEL.equals(buttonLabel)) {
        return IDialogConstants.PROCEED_ID;
    }

    if (IDialogConstants.OPEN_LABEL.equals(buttonLabel)) {
        return IDialogConstants.OPEN_ID;
    }

    if (IDialogConstants.CLOSE_LABEL.equals(buttonLabel)) {
        return IDialogConstants.CLOSE_ID;
    }

    if (IDialogConstants.BACK_LABEL.equals(buttonLabel)) {
        return IDialogConstants.BACK_ID;
    }

    if (IDialogConstants.NEXT_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NEXT_ID;
    }

    if (IDialogConstants.FINISH_LABEL.equals(buttonLabel)) {
        return IDialogConstants.FINISH_ID;
    }

    if (IDialogConstants.HELP_LABEL.equals(buttonLabel)) {
        return IDialogConstants.HELP_ID;
    }

    if (IDialogConstants.NO_TO_ALL_LABEL.equals(buttonLabel)) {
        return IDialogConstants.NO_TO_ALL_ID;
    }

    if (IDialogConstants.SHOW_DETAILS_LABEL.equals(buttonLabel)) {
        return IDialogConstants.DETAILS_ID;
    }

    if (IDialogConstants.HIDE_DETAILS_LABEL.equals(buttonLabel)) {
        return IDialogConstants.DETAILS_ID;
    }

    for (String providedButton : buttonsMap.keySet()) {
        if (providedButton.equals(buttonLabel)) {
            return buttonsMap.get(providedButton);
        }
    }

    // No XXX_LABEL in IDialogConstants for these. Unlikely
    // they would be used in a message dialog though.
    // public int SELECT_ALL_ID = 18;
    // public int DESELECT_ALL_ID = 19;
    // public int SELECT_TYPES_ID = 20;

    return defaultId;
}

From source file:org.eclipse.tycho.targeteditor.dialogs.AddRepositoryWizardPO.java

License:Open Source License

private SWTBotButton getNextButton() {
    try {/*from   w  w w .  j a  v  a2s .  c o  m*/
        return bot.button(IDialogConstants.NEXT_LABEL);
    } catch (final WidgetNotFoundException e) {
        return null;
    }
}

From source file:org.kalypso.contribs.eclipse.jface.wizard.view.WizardView.java

License:Open Source License

/**
 * Creates the Previous and Next buttons for this wizard dialog. Creates standard (<code>SWT.PUSH</code>) buttons and
 * registers for their selection events. Note that the number of columns in the button bar composite is incremented.
 * These buttons are created specially to prevent any space between them.
 *
 * @param parent//  w  w w  .j a v a2  s  .co m
 *          the parent button bar
 * @return a composite containing the new buttons
 */
private Composite createPreviousAndNextButtons(final Composite parent) {
    // increment the number of columns in the button bar
    ((GridLayout) parent.getLayout()).numColumns++;
    final Composite composite = new Composite(parent, SWT.NONE);
    // create a layout with spacing and margins appropriate for the font size.
    GridLayoutFactory.fillDefaults().numColumns(0).spacing(0, 0).applyTo(composite);

    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER));

    composite.setFont(parent.getFont());
    createButton(composite, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, "doPrev", false); //$NON-NLS-1$
    createButton(composite, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, "doNext", true); //$NON-NLS-1$
    return composite;
}

From source file:org.kalypso.kalypsomodel1d2d.ui.map.temsys.model.CreateModelTinWizardPage.java

License:Open Source License

public CreateModelTinWizardPage(final String pageName, final IFile targetFile,
        final IFEDiscretisationModel1d2d model) {
    super(pageName,
            Messages.getString("org.kalypso.kalypsomodel1d2d.ui.map.temsys.model.CreateModelTinWizardPage.1"), //$NON-NLS-1$
            null);//from  www. j a v a 2  s . co  m

    m_targetFile = targetFile;
    m_model = model;

    final String msg;
    if (m_targetFile.exists()) {
        final Date date = new Date(m_targetFile.getLocalTimeStamp());
        final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
        df.setTimeZone(KalypsoCorePlugin.getDefault().getTimeZone());
        final String dateString = df.format(date);
        msg = Messages.getString("org.kalypso.kalypsomodel1d2d.ui.map.temsys.model.CreateModelTinWizardPage.0", //$NON-NLS-1$
                dateString, IDialogConstants.NEXT_LABEL);
    } else
        msg = Messages.getString("org.kalypso.kalypsomodel1d2d.ui.map.temsys.model.CreateModelTinWizardPage.2", //$NON-NLS-1$
                IDialogConstants.NEXT_LABEL);

    m_execute = new Status(IStatus.INFO, KalypsoModel1D2DPlugin.PLUGIN_ID, msg);

    setDescription(
            Messages.getString("org.kalypso.kalypsomodel1d2d.ui.map.temsys.model.CreateModelTinWizardPage.3")); //$NON-NLS-1$
}

From source file:org.modelio.api.ui.ModelioWizardDialog.java

License:Apache License

/**
 * Creates the Previous and Next buttons for this wizard dialog. Creates
 * standard (<code>SWT.PUSH</code>) buttons and registers for their
 * selection events. Note that the number of columns in the button bar
 * composite is incremented. These buttons are created specially to prevent
 * any space between them.//from  w  w w.  j a  va  2  s.  c  o m
 * @param parent the parent button bar
 * @return a composite containing the new buttons
 */
@objid("bc1ce886-120f-11e2-b5c6-002564c97630")
private Composite createPreviousAndNextButtons(final 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;
    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());
    this.backButton = createButton(composite, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    this.nextButton = createButton(composite, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    return composite;
}

From source file:org.talend.registration.wizards.register.AbstractBasicWizardDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true);
}

From source file:org.talend.registration.wizards.register.RegisterWizardPage1.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    createButton(parent, IDialogConstants.HELP_ID, Messages.getString("RegisterWizardPage.netWorkSetting"),
            true);//from w w w .j  ava 2 s . c  o m
    new Label(parent, SWT.NONE);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.getString("RegisterWizardPage.registerLater"),
            true);
    new Label(parent, SWT.NONE);
    new Label(parent, SWT.NONE);
    nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true);
    if (emailText.getText() != null && !"".equals(emailText.getText())) {
        nextButton.setEnabled(true);
    } else {
        nextButton.setEnabled(false);
    }
}

From source file:org.talend.registration.wizards.register.RegisterWizardPage2.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
    nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true);

    String password = passwordText.getText();
    String password2 = passwordText2.getText();
    String pseudonym = userNameText.getText();

    if (!alreadyRegistered) {

        if (password != null && !"".equals(password) && password2 != null && !"".equals(password2)
                && password.equals(password2) && pseudonym != null && !"".equals(pseudonym)) {
            nextButton.setEnabled(true);
        } else {// w  ww.  j  av  a 2s.  com
            nextButton.setEnabled(false);
        }
    } else {
        String oldPassword = oldPasswdText.getText();
        if (oldPassword != null && oldPassword.equals(password) && pseudonym != null && !"".equals(pseudonym)) {
            nextButton.setEnabled(true);
        } else {
            nextButton.setEnabled(false);
        }
    }

}