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.nokia.carbide.cpp.internal.codescanner.markers.CSMarkerDetailsDialog.java

License:Open Source License

/**
 * Constructor./* ww w.ja  v  a2  s  .c  o  m*/
 * @param parentShell - the parent shell
 * @param dialogTitle - the dialog title, or <code>null</code> if none
 * @param dialogMessage the dialog title image, or <code>null</code> if none
 * @param reference - external reference, or <code>null</code> if none
 */
public CSMarkerDetailsDialog(Shell parentShell, String dialogTitle, String dialogMessage, String reference) {
    super(parentShell, dialogTitle, null, dialogMessage, INFORMATION,
            new String[] { IDialogConstants.OK_LABEL }, 0);
    this.reference = reference;
}

From source file:com.nokia.carbide.cpp.internal.project.ui.editors.images.MultiImageEditorContext.java

License:Open Source License

/**
 * Save changes to the multi-image source.
 * <p>//  ww  w . ja  v  a 2  s .co m
 * If the context was initialized with a null IOperationHistory,
 * the incoming IMultiImageSource is directly modified.  Otherwise,
 * the change is executed and added as an operation to that history. 
 */
public void doSave() {
    if (sourceDisposition == SourceDisposition.FROM_VIEW) {
        // modify through the parent editor's operation history
        if (editorHistory != null) {
            // make the save operation for the parent editor
            IUndoableOperation operation = getEditingOperation();
            try {
                operation.addContext(editorUndoContext);
                editorHistory.execute(operation, null, null);
            } catch (ExecutionException e) {
                ProjectUIPlugin.log(e);
            }
        } else {
            ownedMultiImageSource.set(multiImageSource);
        }
    } else {
        // in this mode, we directly update the view
        while (true) {
            try {
                ownedMultiImageSource.set(multiImageSource);
                view.commit();
                break;
            } catch (IllegalStateException e) {
                // rollback or overwrite?
                ProjectUIPlugin.log(e);
                MessageDialog dialog = new MessageDialog((Shell) editorContext.getAdapter(Shell.class),
                        Messages.getString("MultiImageEditorContext.ConflictingChangesTitle"), //$NON-NLS-1$
                        MessageDialog.getImage(MessageDialog.DLG_IMG_MESSAGE_ERROR),
                        MessageFormat.format(
                                Messages.getString("MultiImageEditorContext.ConflictingChangesMessage"), //$NON-NLS-1$
                                new Object[] { ((IOwnedModel) view.getModel()).getPath() }),
                        MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
                dialog.open();
                view.revert();
            }
        }

        try {
            getMultiImageSourceWorkaround();

            // redraw entire UI
            this.page.dispose();
            createControl(this.parent);
            this.page.setVisible(true);
        } catch (PartInitException e) {
            // just fail -- this is a workaround, after all 
            ProjectUIPlugin.log(e);
        }
    }
}

From source file:com.nokia.carbide.cpp.internal.sdk.ui.AddSBSv2ProductVariant.java

License:Open Source License

/**
 * Create contents of the button bar/*w  w w  . j a  v a  2s . c om*/
 * @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.nokia.carbide.cpp.uiq.components.addViewPageDialog.AddViewPageDialog.java

License:Open Source License

/**
 * Create contents of the button bar//from  w  w w.j  av  a2s . com
 * @param parent
 */
protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    if (error) {
        okButton.setEnabled(false);
    } else {
        okButton.setEnabled(true);
    }
}

From source file:com.nokia.carbide.cpp.uiq.ui.vieweditor.ActionsLayoutsDialog.java

License:Open Source License

/**
 * Create contents of the button bar/*w w  w.  j  a  va  2  s  . c  o  m*/
 * @param parent
 */
protected void createButtonsForButtonBar(Composite parent) {
    System.currentTimeMillis();
    button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    if (error) {
        button.setEnabled(false);
    }
}

From source file:com.nokia.carbide.cpp.uiq.ui.vieweditor.ActionsUIConfigDialog.java

License:Open Source License

/**
 * Create contents of the button bar//from w  w w  . j a va  2s  . co  m
 * @param parent
 */
protected void createButtonsForButtonBar(Composite parent) {
    System.currentTimeMillis();
    button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    if (error) {
        button.setEnabled(false);
    } else {
        button.setEnabled(true);
    }

}

From source file:com.nokia.carbide.cpp.uiq.ui.vieweditor.LayoutsDialog.java

License:Open Source License

/**
 * Create contents of the button bar//from   w w w  . j  a  v a2 s  .  com
 * @param parent
 */
protected void createButtonsForButtonBar(Composite parent) {
    System.currentTimeMillis();
    button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    if (error) {
        button.setEnabled(false);
    } else {
        button.setEnabled(true);
    }
}

From source file:com.nokia.carbide.search.system.internal.ui.util.ListDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    if (!fCreateCancelButton)
        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    else//from  w  ww .  jav  a 2 s  .  c o m
        super.createButtonsForButtonBar(parent);
}

From source file:com.nokia.cdt.internal.debug.launch.ui.PartialUpgradeAlertDialog.java

License:Open Source License

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

From source file:com.nokia.cpp.internal.api.utils.ui.FilesListDialog.java

License:Open Source License

private FilesListDialog(Shell parentShell, List<IFile> filesList, String title, String caption, int style) {
    super(parentShell);
    setShellStyle(style);/*  ww  w . j  a va 2s . com*/
    this.filesList = filesList;
    this.title = title;
    this.caption = caption;
    this.okButtonLabel = IDialogConstants.OK_LABEL;
    this.cancelButtonLabel = IDialogConstants.CANCEL_LABEL;
}