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

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

Introduction

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

Prototype

int CLIENT_ID

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

Click Source Link

Document

Starting button id reserved for use by clients of JFace (value 1024).

Usage

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

License:Open Source License

/**
 * Create contents of the button bar.// www.java  2s. c  om
 *
 * @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.properties.ColorCellEditor.java

License:Open Source License

protected Object openDialogBox(Control cellEditorWindow) {
    if (background) {
        BackgroundColorDialog dialog = new BackgroundColorDialog(cellEditorWindow.getShell(),
                getColor(getValue()));/*from  ww w.  j  a v a 2s .co m*/
        int ret = dialog.open();

        if ((ret == IDialogConstants.OK_ID) || (ret == IDialogConstants.CLIENT_ID)) {
            return dialog.getSelectedColor();
        }
    } else {
        ColorChooserDialog dialog = new ColorChooserDialog(cellEditorWindow.getShell());
        Object value = getColor(getValue());

        if (value != null) {
            dialog.setColor((UIColor) value);
        }

        int ret = dialog.open();

        if ((ret == IDialogConstants.OK_ID) || (ret == IDialogConstants.CLIENT_ID)) {
            return dialog.getSelectedColor();
        }
    }

    return getValue();
}

From source file:com.atlassian.connector.eclipse.internal.crucible.ui.dialogs.AbstractCrucibleReviewActionDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    Button summarizeButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, actionText, false);
    summarizeButton.addSelectionListener(new SelectionAdapter() {
        @Override/*from w  w w  .j a va  2s  . c o  m*/
        public void widgetSelected(SelectionEvent e) {
            doAction();
        }
    });

    Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL,
            false);

    cancelButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            cancelPressed();
        }
    });

}

From source file:com.atlassian.connector.eclipse.internal.crucible.ui.dialogs.CrucibleAddCommentDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    saveButton = createButton(parent, IDialogConstants.CLIENT_ID + 2, SAVE_LABEL, false);
    saveButton.addSelectionListener(new SelectionAdapter() {
        @Override/*from  w  ww.  j ava2  s. c  o m*/
        public void widgetSelected(SelectionEvent e) {
            addComment();
        }
    });
    saveButton.setEnabled(false);
    if (!edit) { // if it is a new reply, saving as draft is possible
        saveDraftButton = createButton(parent, IDialogConstants.CLIENT_ID + 2, DRAFT_LABEL, false);
        saveDraftButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                draft = true;
                addComment();
            }
        });
        saveDraftButton.setEnabled(false);
    }
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false)
            .addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(SelectionEvent e) {
                    cancelPressed();
                }
            });
}

From source file:com.atlassian.connector.eclipse.internal.crucible.ui.dialogs.CrucibleEditCommentDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    updateButton = createButton(parent, IDialogConstants.CLIENT_ID + 2, UPDATE_LABEL, false);
    updateButton.addSelectionListener(new SelectionAdapter() {
        @Override/*  ww w  .ja va 2  s .  co m*/
        public void widgetSelected(SelectionEvent e) {
            updateComment(false);
        }
    });
    updateButton.setEnabled(false);
    if (CrucibleUtil.canPublishDraft(comment)) {
        saveDraftButton = createButton(parent, IDialogConstants.CLIENT_ID + 2, DRAFT_LABEL, false);
        saveDraftButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                updateComment(true);
            }
        });
        saveDraftButton.setEnabled(false);
    }
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false)
            .addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(SelectionEvent e) {
                    cancelPressed();
                }
            });
}

From source file:com.github.sdbg.debug.ui.internal.dialogs.ManageLaunchesDialog.java

License:Open Source License

@Override
public void updateButtons() {
    if (getButton(IDialogConstants.OK_ID) != null) {
        // Apply button
        getButton(IDialogConstants.CLIENT_ID).setEnabled(canEnableButton());
        // Run button
        getButton(IDialogConstants.OK_ID).setEnabled(canEnableButton());

        // Delete action
        getDeleteAction().setEnabled(selectedConfig != null);
    }//from w w  w.  jav  a 2s  . com
}

From source file:com.github.sdbg.debug.ui.internal.dialogs.ManageLaunchesDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // Close/*from www  .j  ava2s  . c o  m*/
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);

    // Apply
    createButton(parent, IDialogConstants.CLIENT_ID, "Apply", false);
    getButton(IDialogConstants.CLIENT_ID).addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            handleApplyButton();
        }
    });

    // Run
    createButton(parent, IDialogConstants.OK_ID, Messages.ManageLaunchesDialog_launchRun, true);

    updateButtons();
}

From source file:com.google.dart.tools.ui.internal.text.dart.ContentAssistProcessor.java

License:Open Source License

/**
 * Informs the user about the fact that there are no enabled categories in the default content
 * assist set and shows a link to the preferences.
 *//*from w ww .j  a  va2  s.c om*/
private boolean informUserAboutEmptyDefaultCategory() {
    if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY)) {
        final Shell shell = DartToolsPlugin.getActiveWorkbenchShell();
        String title = DartTextMessages.ContentAssistProcessor_all_disabled_title;
        String message = DartTextMessages.ContentAssistProcessor_all_disabled_message;
        // see PreferencePage#createControl for the 'defaults' label
        final String restoreButtonLabel = JFaceResources.getString("defaults"); //$NON-NLS-1$
        final String linkMessage = Messages.format(
                DartTextMessages.ContentAssistProcessor_all_disabled_preference_link,
                LegacyActionTools.removeMnemonics(restoreButtonLabel));
        final int restoreId = IDialogConstants.CLIENT_ID + 10;
        final int settingsId = IDialogConstants.CLIENT_ID + 11;
        final OptionalMessageDialog dialog = new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY,
                shell, title, null /*
                                   * default image
                                   */, message, MessageDialog.WARNING,
                new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
            /*
             * @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar
             * (org.eclipse.swt.widgets.Composite)
             */
            @Override
            protected void createButtonsForButtonBar(Composite parent) {
                Button[] buttons = new Button[2];
                buttons[0] = createButton(parent, restoreId, restoreButtonLabel, false);
                buttons[1] = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL,
                        true);
                setButtons(buttons);
            }

            /*
             * @see com.google.dart.tools.ui.dialogs.OptionalMessageDialog#createCustomArea
             * (org.eclipse.swt.widgets.Composite)
             */
            @Override
            protected Control createCustomArea(Composite composite) {
                // wrap link and checkbox in one composite without space
                Composite parent = new Composite(composite, SWT.NONE);
                GridLayout layout = new GridLayout();
                layout.marginHeight = 0;
                layout.marginWidth = 0;
                layout.verticalSpacing = 0;
                parent.setLayout(layout);

                Composite linkComposite = new Composite(parent, SWT.NONE);
                layout = new GridLayout();
                layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
                layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
                layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
                linkComposite.setLayout(layout);

                Link link = new Link(linkComposite, SWT.NONE);
                link.setText(linkMessage);
                link.addSelectionListener(new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        setReturnCode(settingsId);
                        close();
                    }
                });
                GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
                gridData.widthHint = this.getMinimumMessageWidth();
                link.setLayoutData(gridData);

                // create checkbox and "don't show this message" prompt
                super.createCustomArea(parent);

                return parent;
            }
        };
        int returnValue = dialog.open();
        if (restoreId == returnValue || settingsId == returnValue) {
            if (restoreId == returnValue) {
                IPreferenceStore store = DartToolsPlugin.getDefault().getPreferenceStore();
                store.setToDefault(PreferenceConstants.CODEASSIST_CATEGORY_ORDER);
                store.setToDefault(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES);
            }
            if (settingsId == returnValue) {
                PreferencesUtil.createPreferenceDialogOn(shell,
                        "com.google.dart.tools.ui.internal.preferences.CodeAssistPreferenceAdvanced", null, //$NON-NLS-1$
                        null).open();
            }
            CompletionProposalComputerRegistry registry = CompletionProposalComputerRegistry.getDefault();
            registry.reload();
            return true;
        }
    }
    return false;
}

From source file:com.google.gdt.eclipse.suite.wizards.CreateAppIdDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create Create and Cancel buttons
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    createButton(parent, IDialogConstants.CLIENT_ID, "Create", false);
    createBtn = getButton(IDialogConstants.CLIENT_ID);
    createBtn.addSelectionListener(new SelectionAdapter() {
        @Override/*from w ww. j  a va2s.c  o  m*/
        public void widgetSelected(SelectionEvent e) {
            okPressed();
        }
    });
    createBtn.setEnabled(false);
}

From source file:com.nokia.sdt.symbian.ui.images.ImageEditorDialogBase.java

License:Open Source License

/**
 * Create a button that is visible only when the pane is visible.
 * @param parent TODO//from   w  ww  .j  ava2 s  . c  om
 * @param pane
 * @param label
 * @return
 */
public Button createPaneButton(Composite parent, Composite pane, String label) {
    final Button button = createButton(parent, IDialogConstants.CLIENT_ID, label, false);
    return button;
}