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

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

Introduction

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

Prototype

int FINISH_ID

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

Click Source Link

Document

Button id for a "Finish" button (value 16).

Usage

From source file:org.eclipse.oomph.setup.ui.wizards.SetupWizardDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    AccessUtil.setKey(getButton(IDialogConstants.BACK_ID), "back");
    AccessUtil.setKey(getButton(IDialogConstants.NEXT_ID), "next");
    AccessUtil.setKey(getButton(IDialogConstants.FINISH_ID), "finish");
    AccessUtil.setKey(getButton(IDialogConstants.CANCEL_ID), "cancel");
}

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

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    if (wizard.isHelpAvailable()) {
        helpButton = createButton(parent, IDialogConstants.HELP_ID, IDialogConstants.HELP_LABEL, false);
    }//w ww.ja  v  a2 s  .com
    if (wizard.needsPreviousAndNextButtons()) {
        createPreviousAndNextButtons(parent);
    }
    finishButton = createButton(parent, IDialogConstants.FINISH_ID, IDialogConstants.FINISH_LABEL, true);
    cancelButton = createCancelButton(parent);
}

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.
 * /*ww  w.  ja  v  a 2  s  . 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.wst.common.project.facet.ui.internal.FacetsPropertyPage.java

License:Open Source License

private void handleFurtherConfigHyperlinkEvent() {
    final IWizard wizard = new ModifyFacetedProjectWizard(this.fpjwc) {
        @Override/*from   w  w w.  j av  a 2  s .  c om*/
        public boolean getShowFacetsSelectionPage() {
            return false;
        }

        @Override
        public boolean canFinish() {
            return true;
        }

        @Override
        public boolean performFinish() {
            for (IWizardPage page : getPages()) {
                final IFacetWizardPage facetPage = (IFacetWizardPage) page;
                facetPage.transferStateToConfig();
            }

            return true;
        }
    };

    final WizardDialog dialog = new WizardDialog(getShell(), wizard) {
        @Override
        protected void createButtonsForButtonBar(final Composite parent) {
            super.createButtonsForButtonBar(parent);

            getButton(IDialogConstants.FINISH_ID).setText(IDialogConstants.OK_LABEL);
            getButton(IDialogConstants.CANCEL_ID).dispose();
            ((GridLayout) parent.getLayout()).numColumns--;
        }
    };

    dialog.open();
    updateFurtherConfigHyperlink();
}

From source file:org.gluster.storage.management.console.actions.CreateVolumeAction.java

License:Open Source License

@Override
protected void performAction(IAction action) {
    CreateVolumeWizard wizard = new CreateVolumeWizard();

    WizardDialog dialog = new WizardDialog(getShell(), wizard) {
        @Override//from   w  w  w .j av a2s . c om
        protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
            Button button = super.createButton(parent, id, label, defaultButton);
            if (id == IDialogConstants.FINISH_ID) {
                button.setText("&Create");
            }
            return button;
        }
    };
    dialog.create();
    dialog.getShell().setSize(510, 620);
    dialog.open();
}

From source file:org.jboss.tools.common.model.ui.editors.dnd.DropWizardDialog.java

License:Open Source License

@Override
public void updateButtons() {
    boolean canFlipToNextPage = false;
    boolean canFinish = getWizard().canFinish();
    if (getButton(IDialogConstants.BACK_ID) != null) {
        getButton(IDialogConstants.BACK_ID).setEnabled(getCurrentPage().getPreviousPage() != null);
    }/*  w  w  w  .j ava 2  s.com*/
    if (getButton(IDialogConstants.NEXT_ID) != null) {
        canFlipToNextPage = getCurrentPage().canFlipToNextPage();
        getButton(IDialogConstants.NEXT_ID).setEnabled(canFlipToNextPage);
    }
    getButton(IDialogConstants.FINISH_ID).setEnabled(canFinish);
    getShell().setDefaultButton(null);
}

From source file:org.jboss.tools.common.model.ui.editors.dnd.DropWizardDialog.java

License:Open Source License

@Override
protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
    Button button = super.createButton(parent, id, label, defaultButton);
    if (id == IDialogConstants.FINISH_ID) {
        getShell().setDefaultButton(null);
    }/*from  www.  j  a v a2 s. c  o m*/
    return button;
}

From source file:org.jboss.tools.common.model.ui.editors.dnd.DropWizardDialog.java

License:Open Source License

@Override
public void create() {
    super.create();
    getShell().addTraverseListener(new TraverseListener() {

        public void keyTraversed(TraverseEvent e) {
            if (e.character == '\r') {
                Button finishButton = getButton(IDialogConstants.FINISH_ID);
                Button cancelButton = getButton(IDialogConstants.CANCEL_ID);
                if (!finishButton.isFocusControl() && !cancelButton.isFocusControl()) {
                    if (finishButton.isEnabled()) {
                        buttonPressed(IDialogConstants.FINISH_ID);
                    } else {
                        handleShellCloseEvent();
                    }//from ww w . j a v  a 2 s.com
                }
            }
        }
    });
}

From source file:org.jboss.tools.internal.deltacloud.ui.wizards.CustomWizardDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    // All we want to do is override the text for the finish button
    Button finishButton = getButton(IDialogConstants.FINISH_ID);
    finishButton.setText(finishText);//from  ww w  .  j a v  a 2 s.co  m
}

From source file:org.jboss.tools.jst.jsp.i18n.ExternalizeStringsDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    Button finishButton = getButton(IDialogConstants.FINISH_ID);
    finishButton.setText(IDialogConstants.OK_LABEL);
}