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:io.usethesource.impulse.preferences.fields.details.DetailsDialogForComboFields.java

License:Open Source License

/**
* Add buttons to the dialog's button bar.
* 
* Subclasses should override./*from  w  ww  .  ja v a  2  s . c  o m*/
* 
* @param parent
*            the button bar composite
*/
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if (!field.getPreferencesLevel().equals(IPreferencesService.DEFAULT_LEVEL)) {
        copyButton = createButton(parent, COPY_ID, PreferenceDialogConstants.COPY_LABEL, false);
        copyButton.setEnabled(field.getPreferencesLevel() != null && field.isInherited()
                && field.getComboBoxControl().isEnabled());
    }

    //           emptyButton = createButton(parent, EMPTY_ID, PreferenceDialogConstants.EMPTY_LABEL, false);
    //           emptyButton.setEnabled(field.getPreferencesLevel() != null &&
    //                 field.isEmptyStringAllowed() && field.getComboBoxControl(parent).isEnabled());

    removeButton = createButton(parent, REMOVE_ID, PreferenceDialogConstants.REMOVE_LABEL, false);
    removeButton.setEnabled((field.getPreferencesLevel() != null) && !field.isInherited() && field.isRemovable()
            && field.getComboBoxControl().isEnabled());

    Label l = new Label(parent, SWT.NONE);
    l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns++;
    layout.makeColumnsEqualWidth = false;

    Button b = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    b.setFocus();
}

From source file:io.usethesource.impulse.preferences.fields.details.DetailsDialogForFontFields.java

License:Open Source License

/**
* Add buttons to the dialog's button bar.
* 
* Subclasses should override./*from  w w w .  j a  v a 2s  .  c  o m*/
* 
* @param parent
*            the button bar composite
*/
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if (!field.getPreferencesLevel().equals(IPreferencesService.DEFAULT_LEVEL)) {
        copyButton = createButton(parent, COPY_ID, PreferenceDialogConstants.COPY_LABEL, false);
        copyButton.setEnabled(field.getPreferencesLevel() != null && field.isInherited()
                && field.getChangeControl().isEnabled());
    }

    //           emptyButton = createButton(parent, EMPTY_ID, PreferenceDialogConstants.EMPTY_LABEL, false);
    //           emptyButton.setEnabled(field.getPreferencesLevel() != null &&
    //                 field.isEmptyStringAllowed() && field.getComboBoxControl(parent).isEnabled());

    removeButton = createButton(parent, REMOVE_ID, PreferenceDialogConstants.REMOVE_LABEL, false);
    removeButton.setEnabled((field.getPreferencesLevel() != null) && !field.isInherited() && field.isRemovable()
            && field.getChangeControl().isEnabled());

    Label l = new Label(parent, SWT.NONE);
    l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns++;
    layout.makeColumnsEqualWidth = false;

    Button b = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    b.setFocus();
}

From source file:io.usethesource.impulse.preferences.fields.details.DetailsDialogForRadioGroupFields.java

License:Open Source License

/**
* Add buttons to the dialog's button bar.
* 
* Subclasses should override./*from  w ww. j av  a2 s . c  o m*/
* 
* @param parent
*            the button bar composite
*/
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if (!field.getPreferencesLevel().equals(IPreferencesService.DEFAULT_LEVEL)) {
        copyButton = createButton(parent, COPY_ID, PreferenceDialogConstants.COPY_LABEL, false);
        copyButton.setEnabled(field.getPreferencesLevel() != null && field.isInherited()
                && field.getRadioBoxControl().isEnabled());
    }

    //           emptyButton = createButton(parent, EMPTY_ID, PreferenceDialogConstants.EMPTY_LABEL, false);
    //           emptyButton.setEnabled(field.getPreferencesLevel() != null &&
    //                 field.isEmptyStringAllowed() && field.getEmptyValue() != null && 
    //                 field.getTextControl().isEnabled() && field.getTextControl().getEditable());

    removeButton = createButton(parent, REMOVE_ID, PreferenceDialogConstants.REMOVE_LABEL, false);
    removeButton.setEnabled((field.getPreferencesLevel() != null) && !field.isInherited() && field.isRemovable()
            && field.getRadioBoxControl().isEnabled());

    Label l = new Label(parent, SWT.NONE);
    l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns++;
    layout.makeColumnsEqualWidth = false;

    Button b = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    b.setFocus();
}

From source file:io.usethesource.impulse.preferences.fields.details.DetailsDialogForStringFields.java

License:Open Source License

/**
* Add buttons to the dialog's button bar.
* 
* Subclasses should override./* ww w . j a  v a 2s.  c o m*/
* 
* @param parent
*            the button bar composite
*/
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    //   boolean enabled;

    if (!field.getPreferencesLevel().equals(IPreferencesService.DEFAULT_LEVEL)) {
        copyButton = createButton(parent, COPY_ID, PreferenceDialogConstants.COPY_LABEL, false);
        copyButton.setEnabled(field.getPreferencesLevel() != null && field.isInherited()
                && field.getTextControl().isEnabled() && field.getTextControl().getEditable());
    }

    emptyButton = createButton(parent, EMPTY_ID, PreferenceDialogConstants.EMPTY_LABEL, false);
    emptyButton.setEnabled(
            field.getPreferencesLevel() != null && field.isEmptyValueAllowed() && field.getEmptyValue() != null
                    && field.getTextControl().isEnabled() && field.getTextControl().getEditable());

    removeButton = createButton(parent, REMOVE_ID, PreferenceDialogConstants.REMOVE_LABEL, false);
    removeButton.setEnabled((field.getPreferencesLevel() != null) && !field.isInherited() && field.isRemovable()
            && field.getTextControl().isEnabled() && field.getTextControl().getEditable());

    Label l = new Label(parent, SWT.NONE);
    l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns++;
    layout.makeColumnsEqualWidth = false;

    Button b = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    b.setFocus();
}

From source file:it.eng.spagobi.studio.console.dialogs.LiveLinesSettingsDialog.java

License:Open Source License

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

From source file:it.uniba.di.cdg.xcore.ui.dialogs.CompletableInputDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = 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 ww  . ja v a 2  s .  c  om*/
    text.setFocus();
    if (value != null) {
        text.setText(value);
        text.select(0);
    }
}

From source file:kr.co.apexsoft.stella.modeler.explorer.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);
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    backButton.setEnabled(false);/*from   w  w  w  .  j a va  2  s .c  om*/
    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);
        }

    });
}

From source file:msi.gama.application.workspace.PickWorkspaceDialog.java

@Override
protected void createButtonsForButtonBar(final Composite parent) {

    /* Clone workspace needs a lot of checks */
    final Button clone = createButton(parent, IDialogConstants.IGNORE_ID, "Clone existing workspace", false);
    clone.addListener(SWT.Selection, arg0 -> cloneCurrentWorkspace());
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:msi.gama.gui.swt.dialogs.AbstractDetailsDialog.java

License:Open Source License

/**
 * Adds OK and Details buttons to this dialog's button bar.
 * //from  w  w  w.jav a2  s  .c  om
 * @param parent the button bar composite
 */
@Override
protected void createButtonsForButtonBar(final Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);
}

From source file:msi.gama.gui.swt.dialogs.PickWorkspaceDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(final Composite parent) {

    /* Clone workspace needs a lot of checks */
    Button clone = createButton(parent, IDialogConstants.IGNORE_ID, "Clone current workspace", false);
    clone.addListener(SWT.Selection, new Listener() {

        @Override//from   w w  w .j a v  a  2  s.  c  om
        public void handleEvent(final Event arg0) {
            cloneCurrentWorkspace();
            // try {
            // String txt = workspacePathCombo.getText();
            // File workspaceDirectory = new File(txt);
            // if ( !workspaceDirectory.exists() ) {
            // MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            // "The path entered does not exist. Please enter a valid path.");
            // return;
            // }
            //
            // if ( !workspaceDirectory.canRead() ) {
            // MessageDialog
            // .openError(Display.getDefault().getActiveShell(), "Error",
            // "The currently entered workspace path is not readable. Please check file system permissions.");
            // return;
            // }
            //
            // // check for workspace file (empty indicator that it's a workspace)
            // File wsFile = new File(txt + File.separator + WS_IDENTIFIER);
            // if ( !wsFile.exists() ) {
            // boolean b =
            // MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Confirm cloning",
            // "A new workspace will be created at location " + txt +
            // " and the current workspace contents will be copied to it. Confirm ?");
            // if ( !b ) { return; }
            // if ( !checkAndCreateWorkspaceRoot(txt) ) { return; }
            // } else {
            // boolean b =
            // MessageDialog
            // .openConfirm(
            // Display.getDefault().getActiveShell(),
            // "Existing workspace",
            // "The path entered is a path to an existing workspace. All its contents will be erased and replaced by the current workspace contents. Proceed anyway ?");
            // if ( !b ) { return; }
            // }
            //
            // DirectoryDialog dd = new DirectoryDialog(Display.getDefault().getActiveShell());
            // dd.setFilterPath(txt);
            // String directory = dd.open();
            // if ( directory == null ) { return; }
            //
            // File targetDirectory = new File(directory);
            // if ( targetDirectory.getAbsolutePath().equals(workspaceDirectory.getAbsolutePath()) ) {
            // MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            // "Source and target workspaces are the same");
            // return;
            // }
            //
            // // recursive check, if new directory is a subdirectory of
            // // our workspace, that's a big no-no or we'll
            // // create directories forever
            // if ( isTargetSubdirOfDir(workspaceDirectory, targetDirectory) ) {
            // MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            // "The path entered is a subdirectory of the current workspace");
            // return;
            // }
            //
            // try {
            // copyFiles(workspaceDirectory, targetDirectory);
            // } catch (Exception err) {
            // MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            // "There was an error cloning the workspace: " + err.getMessage());
            // return;
            // }
            //
            // boolean setActive =
            // MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Workspace Cloned",
            // "Would you like to set the newly cloned workspace to be the active one?");
            // if ( setActive ) {
            // workspacePathCombo.setText(directory);
            // }
            // } catch (Exception err) {
            // MessageDialog.openError(Display.getDefault().getActiveShell(), "Error",
            // "There was an internal error, please check the logs");
            // err.printStackTrace();
            // }
        }
    });
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}