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:org.tencompetence.ldauthor.opendock.ui.UoLDetailsDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true);
    Button downloadButton = createButton(parent, IDialogConstants.CLIENT_ID, Messages.UoLDetailsDialog_15,
            false);/*w  w  w .java2 s  .c o m*/
    downloadButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            doDownloadItem();
        }
    });
}

From source file:phasereditor.canvas.ui.editors.grid.editors.FrameDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CLIENT_ID) {
        _result = PGridFrameProperty.NULL_FRAME;
        setReturnCode(OK);//  w  w w. j a  v a  2 s .c o m
        close();
    }
    super.buttonPressed(buttonId);
}

From source file:phasereditor.canvas.ui.editors.grid.editors.FrameDialog.java

License:Open Source License

/**
 * Create contents of the button bar./*from w w w.  j a  va2 s. co m*/
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    if (_allowNull) {
        createButton(parent, IDialogConstants.CLIENT_ID, "Set Null", false);
    }
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:uk.ac.stfc.isis.ibex.ui.configserver.dialogs.EditConfigDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    if (!isBlank && !this.config.getName().isEmpty()) {
        createButton(parent, IDialogConstants.OK_ID, "Save", true);
    }//from  w  w w.  j  a  v  a2 s. c om

    saveAsBtn = createButton(parent, IDialogConstants.CLIENT_ID + 1, "Save as ...", false);
    saveAsBtn.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            Collection<String> configNames = server.configNames();
            Collection<String> componentNames = server.componentNames();
            boolean hasComponents = !config.getEditableComponents().getSelected().isEmpty();
            String currentConfigName = server.currentConfig().getValue().name();
            SaveConfigDialog dlg = new SaveConfigDialog(null, config.getName(), config.getDescription(),
                    configNames, componentNames, !config.getIsComponent(), hasComponents, currentConfigName);
            if (dlg.open() == Window.OK) {
                if (dlg.getNewName() != config.getName()) {
                    config.setName(dlg.getNewName());
                }

                config.setDescription(dlg.getNewDescription());
                doAsComponent = dlg.willBeComponent();

                okPressed();
            }
        }
    });

    createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);

    // Show any error message and set buttons after creating those buttons
    super.showErrorMessage();
}

From source file:uk.ac.stfc.isis.ibex.ui.synoptic.editor.dialogs.EditSynopticDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // createButton(parent, IDialogConstants.OK_ID, "Save", true);
    previewBtn = createButton(parent, IDialogConstants.CLIENT_ID + 3, "Synoptic Preview", false);
    previewBtn.addSelectionListener(new SelectionAdapter() {
        @Override/*ww w  .  j a  va 2 s  .c  om*/
        public void widgetSelected(SelectionEvent e) {
            SynopticPreview previewDialog = new SynopticPreview(getShell(), synopticViewModel.getSynoptic());
            previewDialog.open();
        }

    });

    if (!isBlank) {
        // createButton(parent, IDialogConstants.OK_ID, "Save", true);
        saveBtn = createButton(parent, IDialogConstants.CLIENT_ID + 2, "Save", false);

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

        });
    }
    saveAsBtn = createButton(parent, IDialogConstants.CLIENT_ID + 1, "Save as ...", false);

    saveAsBtn.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            SaveSynopticViewModel model = new SaveSynopticViewModel(synopticViewModel.getSynoptic().name(),
                    SynopticInfo.names(Synoptic.getInstance().availableSynoptics()));
            SaveSynopticDialog dlg = new SaveSynopticDialog(null, model);
            if (dlg.open() == Window.OK) {
                synopticViewModel.getSynoptic().setName(model.getSynopticName());
                okPressed();
            }
        }
    });

    synopticValidator.addPropertyChangeListener("error", new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            updateErrors((ErrorMessage) evt.getNewValue());
        }
    });

    updateErrors(synopticValidator.getError());

    createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);
}