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

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

Introduction

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

Prototype

String OK_LABEL

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

Click Source Link

Document

The label for OK buttons.

Usage

From source file:com.windowtester.eclipse.ui.updater.UpdateDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK 
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}

From source file:com.windowtester.test.eclipse.locator.DialogMessageLocatorSmokeTest.java

License:Open Source License

public void testInfoTextIdentification() throws WidgetSearchException {

    final Label[] label = new Label[1];
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            MessageDialog dialog = new MessageDialog(getShell(), "Info", null, "Something",
                    MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0) {

                public void create() {
                    super.create();
                    label[0] = this.messageLabel; //cache label
                }//w  w w .j a  v  a  2s. c o  m
            };
            dialog.open();
        }
    });

    IUIContext ui = getUI();
    ui.wait(new ShellShowingCondition("Info"));

    assertIsMessageLocator(identify(label[0]));

    ui.assertThat(new DialogMessageLocator().hasText("Something"));
    ui.click(new ButtonLocator("OK"));
    ui.wait(new ShellDisposedCondition("Info"));
}

From source file:com.windowtester.test.runtime.CloseNestedShellsTest.java

License:Open Source License

public void uiSetup() {
    Shell shell = new Shell(Display.getDefault());
    dialog = new MessageDialog(shell, "First Shell", null, "message", MessageDialog.INFORMATION,
            new String[] { IDialogConstants.OK_LABEL }, 0) {

        /* (non-Javadoc)
         * @see org.eclipse.jface.dialogs.Dialog#close()
         *//*from   w  ww  .  ja va  2 s.co  m*/
        @Override
        public boolean close() {
            boolean confirmed = MessageDialog.openConfirm(getShell(), "Nested", "Nested Shell");
            if (confirmed)
                return super.close();
            return false;
        }

    };

    dialog.open();
}

From source file:conspecedit.editors.ReactionEdit.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // Add buttons for OK and Cancel to the dialogue box.
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:de.anbos.eclipse.logviewer.plugin.ui.EncodingDialog.java

License:Apache License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, 3, LogViewerPlugin.getResourceString("dialog.encoding.defaults.button"), false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    //do this here because setting the text will set enablement on the ok
    // button/*from w w w  .  ja  va 2 s.c  o  m*/
    encodingCombo.setFocus();
    if (value != null) {
        encodingCombo.setText(value);
    }
}

From source file:de.anbos.eclipse.logviewer.plugin.ui.LogFileTypeDialog.java

License:Apache License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    // button/*from  www. j a va 2 s. co  m*/
    typeCombo.setFocus();
    if (value != null) {
        typeCombo.setText(value);
    }
}

From source file:de.anbos.eclipse.logviewer.plugin.ui.TabRenameDialog.java

License:Apache License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    //do this here because setting the text will set enablement on the ok
    // button/* w w  w  .ja  va 2 s  . c  om*/
    nameField.setFocus();
    if (value != null) {
        nameField.setText(value);
    }
}

From source file:de.babe.eclipse.plugins.quickREx.dialogs.OrganizeTestTextDialog.java

License:Open Source License

private void createButtonsForLoad(Composite parent) {
    createButton(parent, BROWSE_BUTTON_ID, Messages.getString("dialogs.OrganizeTestTextDialog.button.browse"), //$NON-NLS-1$
            false);//www.  j a v  a 2  s.  c  om
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:de.defmacro.dandelion.internal.ui.dialogs.EvalFailureDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.ABORT_ID, IDialogConstants.ABORT_LABEL, true);
    if (!fRestarts.isEmpty()) {
        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
        setOKButtonEnabled(false);// w w  w  .  j  a  v a 2 s.  c o  m
        hintSelectRestart(true);
    }
}

From source file:de.fhg.igd.swingrcp.ComponentMessageDialog.java

License:Open Source License

/**
 * @see MessageDialog#getButtonLabels(int)
 *//*  w w  w .  ja v a 2  s  . c o m*/
static String[] getButtonLabels(int kind) {
    String[] dialogButtonLabels;
    switch (kind) {
    case ERROR:
    case INFORMATION:
    case WARNING: {
        dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL };
        break;
    }
    case CONFIRM: {
        dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL };
        break;
    }
    case QUESTION: {
        dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
        break;
    }
    case QUESTION_WITH_CANCEL: {
        dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                IDialogConstants.CANCEL_LABEL };
        break;
    }
    default: {
        throw new IllegalArgumentException("Illegal value for kind in MessageDialog.open()"); //$NON-NLS-1$
    }
    }
    return dialogButtonLabels;
}