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.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Control control = super.createButtonBar(parent);
    getButton(IDialogConstants.FINISH_ID).setText(IDialogConstants.OK_LABEL);
    hideButton(getButton(CANCEL));/*from ww  w .ja va 2 s  . co  m*/
    return control;
}

From source file:org.jboss.tools.openshift.express.internal.core.portforward.ApplicationPortForwardingWizardDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    getButton(IDialogConstants.CANCEL_ID).setVisible(false);
    getButton(IDialogConstants.FINISH_ID).setText("OK");
}

From source file:org.jboss.tools.openshift.express.internal.ui.wizard.OkButtonWizardDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Control control = super.createButtonBar(parent);
    getButton(IDialogConstants.FINISH_ID).setText("OK");
    hideButton(getButton(CANCEL));//from  w  w  w.j a  v a  2 s.  com
    return control;
}

From source file:org.jboss.tools.openshift.internal.common.ui.wizard.OkCancelButtonWizardDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Control control = super.createButtonBar(parent);
    getButton(IDialogConstants.FINISH_ID).setText(IDialogConstants.OK_LABEL);
    return control;
}

From source file:org.jkiss.dbeaver.tools.compare.CompareWizardDialog.java

License:Open Source License

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

From source file:org.jkiss.dbeaver.ui.dialogs.driver.DriverDownloadDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Control dialogArea = super.createDialogArea(parent);
    if (getWizard().isForceDownload()) {
        UIUtils.runInDetachedUI(getShell(), new Runnable() {
            @Override//from w ww  .j  a  v a2 s .co m
            public void run() {
                buttonPressed(IDialogConstants.FINISH_ID);
            }
        });
    }
    return dialogArea;
}

From source file:org.jkiss.dbeaver.ui.dialogs.driver.DriverDownloadDialog.java

License:Open Source License

@Override
protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
    if (id == IDialogConstants.FINISH_ID) {
        Button button = super.createButton(parent, id, getWizard().getFinishText(), defaultButton);
        button.setImage(DBeaverIcons.getImage(UIIcon.BROWSER));
        setButtonLayoutData(button);/*from   w w w. ja v a2  s.  c  om*/
        return button;
    }
    return super.createButton(parent, id, label, defaultButton);
}

From source file:org.jkiss.dbeaver.ui.dialogs.tools.ToolWizardDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    Button cancelButton = getButton(IDialogConstants.CANCEL_ID);
    cancelButton.setText(IDialogConstants.CLOSE_LABEL);
    Button finishButton = getButton(IDialogConstants.FINISH_ID);
    finishButton.setText(CoreMessages.tools_wizard_dialog_button_start);
}

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

License:Open Source License

protected void createButtonsForButtonBar(final Composite parent) {
    // Reset button; will be invisible if current page is not resetable (see IResetableWizard).
    createButton(parent, RESET_ID,//from  w w w . ja  va  2 s.c o m
            Messages.getString("org.kalypso.contribs.eclipse.jface.wizard.view.WizardView1"), "doReset", false); //$NON-NLS-1$ //$NON-NLS-2$

    if (m_wizard instanceof IWizard2 && ((IWizard2) m_wizard).hasSaveButton())
        createButton(parent, SAVE_ID,
                Messages.getString("org.kalypso.contribs.eclipse.jface.wizard.view.WizardView2"), "doSave", //$NON-NLS-1$//$NON-NLS-2$
                false);

    if (m_wizard.isHelpAvailable())
        createButton(parent, IDialogConstants.HELP_ID, IDialogConstants.HELP_LABEL, "doHelp", false); //$NON-NLS-1$

    if (m_wizard.needsPreviousAndNextButtons())
        createPreviousAndNextButtons(parent);

    createButton(parent, IDialogConstants.FINISH_ID, IDialogConstants.FINISH_LABEL, "doFinish", //$NON-NLS-1$
            !m_wizard.needsPreviousAndNextButtons());

    if (!(m_wizard instanceof IWizard2) || ((IWizard2) m_wizard).hasCancelButton())
        createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, "doCancel", false); //$NON-NLS-1$
}

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

License:Open Source License

/**
 * @see org.eclipse.jface.wizard.IWizardContainer#updateButtons()
 */// ww w.  jav  a 2  s .  co  m
@Override
public void updateButtons() {
    if (m_wizard == null || m_currentPage == null)
        return;

    boolean canFlipToNextPage = false;
    final boolean canFinish = m_wizard.canFinish();

    final boolean canReset = m_wizard instanceof IResetableWizard ? ((IResetableWizard) m_wizard).canReset()
            : false;
    final boolean showReset = m_wizard instanceof IResetableWizard
            ? ((IResetableWizard) m_wizard).showResetButton()
            : false;

    final Button backButton = getButton(IDialogConstants.BACK_ID);
    final Button nextButton = getButton(IDialogConstants.NEXT_ID);
    final Button finishButton = getButton(IDialogConstants.FINISH_ID);
    final Button resetButton = getButton(RESET_ID);

    if (backButton != null)
        backButton.setEnabled(m_currentPage.getPreviousPage() != null);

    if (nextButton != null) {
        canFlipToNextPage = m_currentPage.canFlipToNextPage();
        nextButton.setEnabled(canFlipToNextPage);
    }

    if (finishButton != null)
        finishButton.setEnabled(canFinish);

    if (resetButton != null) {
        resetButton.setVisible(showReset);
        resetButton.setEnabled(canReset);
    }

    // finish is default unless it is disabled and next is enabled
    // if( canFlipToNextPage && !canFinish )
    // cancel is default unless it is disabled or non-existent
    if (m_useDefaultButton) {
        if (canFlipToNextPage && nextButton != null)
            getShell().setDefaultButton(nextButton);
        else
            getShell().setDefaultButton(finishButton);
    }
}