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

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

Introduction

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

Prototype

String CANCEL_LABEL

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

Click Source Link

Document

The label for cancel buttons.

Usage

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

License:Apache License

/**
 * Create contents of the button bar.//from   www .  j  a v  a2 s.  c  om
 *
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    mOkButton = createButton(parent, IDialogConstants.OK_ID, "", true);
    mOkButton.addListener(SWT.Selection, new Listener() {
        @Override
        public void handleEvent(Event event) {
            saveFile();
        }
    });
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

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

License:Apache License

/**
 * Create contents of the button bar.//from   w w  w  .ja  v 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 w ww  .  j a v a  2  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.  ja va2 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);
    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./* w  ww .j a  va  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);

    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.//  w w w . j a va  2 s . com
 * @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.dialogs.FormsLayout.java

License:Open Source License

/**
 * Create contents of the button bar./*from  w  ww . j  av  a 2 s .  co m*/
 *
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    applyButton = createButton(parent, IDialogConstants.CLIENT_ID, string("Studio.text.apply"), true);
    applyButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            apply();
        }
    });
    applyButton.setEnabled(false);
    createButton(parent, IDialogConstants.OK_ID, string("Studio.text.save"), true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

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

License:Open Source License

/**
 * @param kind//  w ww  .ja v a  2s .  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;
}

From source file:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected boolean processChanges(IWorkbenchPreferenceContainer container) {

    IScopeContext currContext = fLookupOrder[0];

    List<Key> changedOptions = new ArrayList<Key>();
    boolean needsBuild = getChanges(currContext, changedOptions);
    if (changedOptions.isEmpty()) {
        hasChanges = false;/*  w ww. j ava 2  s. c om*/
        return true;
    } else {
        hasChanges = true;
    }

    boolean doBuild = false;
    if (needsBuild) {
        String[] strings = getFullBuildDialogStrings(fProject == null);
        if (strings != null) {
            MessageDialog dialog = new MessageDialog(getShell(), strings[0], null, strings[1],
                    MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL,
                            IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL },
                    2);
            int res = dialog.open();
            if (res == 0) {
                doBuild = true;
            } else if (res != 1) {
                return false; // cancel pressed
            }
        }
    }
    if (doBuild) {
        prepareForBuild();
    }
    if (container != null) {
        // no need to apply the changes to the original store: will be done by the page container
        if (doBuild) { // post build
            container.registerUpdateJob(CoreUtility.getBuildJob(fProject));
        }
    } else {
        // apply changes right away
        try {
            fManager.applyChanges();
        } catch (BackingStoreException e) {
            IdeLog.logError(PHPEplPlugin.getDefault(), "Error applying changes", e); //$NON-NLS-1$
            return false;
        }
        if (doBuild) {
            CoreUtility.getBuildJob(fProject).schedule();
        }

    }
    return true;
}

From source file:com.aptana.formatter.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected boolean processChanges(IWorkbenchPreferenceContainer container) {
    IScopeContext currContext = fLookupOrder[0];

    List<PreferenceKey> changedOptions = new ArrayList<PreferenceKey>();
    boolean needsBuild = getChanges(currContext, changedOptions);
    if (changedOptions.isEmpty()) {
        return true;
    }//from   ww  w . j ava  2 s  . com
    if (needsBuild) {
        int count = getRebuildCount();
        if (count > fRebuildCount) {
            needsBuild = false; // build already requested
            fRebuildCount = count;
        }
    }

    boolean doBuild = false;
    if (needsBuild) {
        IPreferenceChangeRebuildPrompt prompt = getPreferenceChangeRebuildPrompt(fProject == null,
                changedOptions);
        if (prompt != null) {
            MessageDialog dialog = new MessageDialog(getShell(), prompt.getTitle(), null, prompt.getMessage(),
                    MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL,
                            IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL },
                    2);
            int res = dialog.open();
            if (res == 0) {
                doBuild = true;
            } else if (res != 1) {
                return false; // cancel pressed
            }
        }
    }
    if (container != null) {
        // no need to apply the changes to the original store: will be done
        // by the page container
        if (doBuild) { // post build
            incrementRebuildCount();
            for (Job job : createBuildJobs(fProject)) {
                container.registerUpdateJob(job);
            }
        }
    } else {
        // apply changes right away
        try {
            fManager.applyChanges();
        } catch (BackingStoreException e) {
            IdeLog.logError(FormatterUIEplPlugin.getDefault(), e, IDebugScopes.DEBUG);
            return false;
        }
        if (doBuild) {
            for (Job job : createBuildJobs(fProject)) {
                job.schedule();
            }
        }

    }
    return true;
}