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.android.ide.eclipse.adt.internal.launch.DeviceChooserDialog.java

License:Open Source License

/**
 * Create the button bar: We override the Dialog implementation of this method
 * so that we can create the checkbox at the same level as the 'Cancel' and 'OK' buttons.
 *///  w  w  w.jav  a 2s .c om
@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    mUseDeviceForFutureLaunchesCheckbox = new Button(composite, SWT.CHECK);
    mUseDeviceForFutureLaunchesCheckbox.setSelection(mUseDeviceForFutureLaunches);
    mResponse.setUseDeviceForFutureLaunches(mUseDeviceForFutureLaunches);
    mUseDeviceForFutureLaunchesCheckbox.setText("Use same device for future launches");
    mUseDeviceForFutureLaunchesCheckbox.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            mUseDeviceForFutureLaunches = mUseDeviceForFutureLaunchesCheckbox.getSelection();
            mResponse.setUseDeviceForFutureLaunches(mUseDeviceForFutureLaunches);
        }
    });
    mUseDeviceForFutureLaunchesCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    createButton(composite, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(composite, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    return composite;
}

From source file:com.android.ide.eclipse.adt.internal.wizards.newxmlfile.AddTranslationDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    mOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
            // Don't make the OK button default as in most dialogs, since when you press
            // Return thinking you might edit a value it dismisses the dialog instead
            false);// www .j  av a 2s . c o m
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    mOkButton.setEnabled(false);

    validatePage();
}

From source file:com.android.ide.eclipse.auidt.internal.launch.DeviceChooserDialog.java

License:Open Source License

/**
 * Create the button bar: We override the Dialog implementation of this method
 * so that we can create the checkbox at the same level as the 'Cancel' and 'OK' buttons.
 */// w  w w.ja  v a 2  s  .  c o m
@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    mUseDeviceForFutureLaunchesCheckbox = new Button(composite, SWT.CHECK);
    mUseDeviceForFutureLaunchesCheckbox.setSelection(sUseDeviceForFutureLaunchesValue);
    mResponse.setUseDeviceForFutureLaunches(sUseDeviceForFutureLaunchesValue);
    mUseDeviceForFutureLaunchesCheckbox.setText("Use same device for future launches");
    mUseDeviceForFutureLaunchesCheckbox.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            sUseDeviceForFutureLaunchesValue = mUseDeviceForFutureLaunchesCheckbox.getSelection();
            mResponse.setUseDeviceForFutureLaunches(sUseDeviceForFutureLaunchesValue);
        }
    });
    mUseDeviceForFutureLaunchesCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    createButton(composite, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(composite, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    return composite;
}

From source file:com.android.ide.eclipse.ddms.LogCatMonitorDialog.java

License:Apache License

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

From source file:com.android.uiautomator.OpenDialog.java

License:Apache License

/**
 * Create contents of the button bar.//  w  w  w  .j av a2s.c  o  m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    mOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    updateButtonState();
}

From source file:com.appnativa.studio.dialogs.BackgroundColorDialog.java

License:Open Source License

/**
 * Create contents of the button bar./*from   ww w . j  ava2 s.c om*/
 *
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.appnativa.studio.dialogs.BordersPopup.java

License:Open Source License

/**
 * Create contents of the button bar./*w w w .j av  a  2 s .  co  m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    getButton(IDialogConstants.OK_ID).setEnabled(false);
}

From source file:com.appnativa.studio.dialogs.ColorChooserDialog.java

License:Open Source License

/**
 * Create contents of the button bar.//from  ww w .  j a  va 2 s .  c o  m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    Button b = createButton(parent, IDialogConstants.CLIENT_ID, "None", false);

    b.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setReturnCode(IDialogConstants.CLIENT_ID);
            selectedColor = null;
            ColorChooserDialog.this.close();
        }
    });
}

From source file:com.appnativa.studio.dialogs.FontChooserDialog.java

License:Open Source License

/**
 * Create contents of the button bar.//from  w w w .j  a  v a 2s  .  c o m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    Button b = createButton(parent, IDialogConstants.CLIENT_ID, "None", false);

    b.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setReturnCode(IDialogConstants.CLIENT_ID);
            rareFont = fontPanel.getSelectedFont();
            rareFont.spot_clear();
            FontChooserDialog.this.close();
        }
    });
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
}

From source file:com.appnativa.studio.MessageDialogEx.java

License:Open Source License

/**
 * @param kind//from   w  ww . jav  a 2  s .  co m
 * @return
 */
public 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;
}