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.s60tools.remotecontrol.ui.dialogs.RenameDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    GridLayout gdl = new GridLayout(1, false);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
    parent.setLayout(gdl);//  w  w  w  . j av a  2  s  .  c  o  m
    parent.setLayoutData(gd);

    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    if (!allowOriginalName) {
        // Not allowed to return same file name. User needs to modify name before enabling OK button.
        getButton(IDialogConstants.OK_ID).setEnabled(false);
    }
}

From source file:com.nokia.s60tools.ui.dialogs.S60ToolsListBoxDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // Creating OK button
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    // Optionally adding context-sensitive help support
    if (contextHelpID != null) {
        PlatformUI.getWorkbench().getHelpSystem().setHelp(okButton, contextHelpID);
    }/*  w w w.ja  va 2s .  c  o  m*/
    //if cancel button also required
    if (hasCancelButton) {
        Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL,
                true);
        // Optionally adding context-sensitive help support
        if (contextHelpID != null) {
            PlatformUI.getWorkbench().getHelpSystem().setHelp(cancelButton, contextHelpID);
        }
    }
}

From source file:com.nokia.sdt.editor.SourceGenProblemsDialog.java

License:Open Source License

/**
 * @param shell/*from   w  ww  . j  av  a 2  s .c o  m*/
 * @param displayName
 * @param messages
 * @return
 */
public static SourceGenProblemsDialog create(Shell shell, String displayName, Collection<IMessage> messages) {
    boolean anyErrors = false;
    for (Iterator iter = messages.iterator(); iter.hasNext();) {
        IMessage message = (IMessage) iter.next();
        if (message.getSeverity() == IMessage.ERROR) {
            anyErrors = true;
            break;
        }
    }
    StringBuffer buffer = new StringBuffer();
    buffer.append(MessageFormat.format(
            Messages.getString("SourceGenProblemsDialog.SourceGenProblemsEncounteredMessage"), //$NON-NLS-1$
            displayName));

    SourceGenProblemsDialog dialog = new SourceGenProblemsDialog(shell,
            Messages.getString("SourceGenProblemsDialog.SourceGenProblemsEncounteredTitle"), null, //$NON-NLS-1$
            buffer.toString(), (anyErrors ? MessageDialog.ERROR : MessageDialog.WARNING),
            new String[] { IDialogConstants.OK_LABEL }, IDialogConstants.OK_ID);
    dialog.setMessages(messages);
    return dialog;
}

From source file:com.nokia.sdt.symbian.ui.editors.ArrayEditorDialog.java

License:Open Source License

/**
 * Create contents of the button bar/*from w  ww  .  ja v  a  2 s  .  c  o m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    // override to create with no default button. The user should
    // be able to press Enter to begin editing in the property sheet but
    // that would trigger the default button.
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.nokia.tools.carbide.ui.dialogs.CarbideAboutDialog.java

License:Open Source License

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

    createButton(parent, DETAILS_ID, WorkbenchMessages.AboutDialog_DetailsButton, false);

    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:com.nokia.tools.s60.editor.actions.AbstractEditAction.java

License:Open Source License

protected void displayMissingEditorInfo() {
    IBrandingManager branding = BrandingExtensionManager.getBrandingManager();
    Image image = null;/* w  w w  .  java  2 s .  c om*/
    if (branding != null) {
        image = branding.getIconImageDescriptor().createImage();
    }
    MessageDialogWithCheckBox dialog = new MessageDialogWithCheckBox(
            PlatformUI.getWorkbench().getDisplay().getActiveShell(),
            Messages.EditInExternalAction_toolSettingsError, image, Messages.EditInExternalAction_openToolError,
            null, false, null, Messages.EditInExternalAction_configureTool,
            Messages.EditInExternalAction_preferenceAddress, 1, new String[] { IDialogConstants.OK_LABEL }, 0);
    dialog.setPendingAction(this);
    dialog.open();
    if (image != null) {
        image.dispose();
    }
}

From source file:com.nokia.tools.s60.editor.actions.CopyImageAction.java

License:Open Source License

@Override
public void doRun(Object sel) {

    if (clip == null)
        clip = Toolkit.getDefaultToolkit().getSystemClipboard();

    IContentData data = getContentData(sel);
    ISkinnableEntityAdapter skAdapter = (ISkinnableEntityAdapter) data
            .getAdapter(ISkinnableEntityAdapter.class);

    if (sel instanceof IAnimationFrame) {
        if (isMaskNode()) {
            IAnimationFrame frame = (IAnimationFrame) sel;
            if (frame.getMaskFile() != null) {
                ClipboardHelper.copyImageToClipboard(clip, frame.getMaskFile());
            } else {
                ClipboardHelper.copyImageToClipboard(clip, frame.getMask());
            }//from   www . jav a  2  s. com
        } else if (isImageNode()) {
            IAnimationFrame frame = (IAnimationFrame) sel;
            if (frame.getImageFile() != null) {
                ClipboardHelper.copyImageToClipboard(clip, frame.getImageFile());
            } else {
                ClipboardHelper.copyImageToClipboard(clip, frame.getRAWImage(false));
            }
        } else {
            ((IAnimationFrame) sel).copyImageToClipboard(clip);
        }
        return;
    }

    // when layer is selected in tree
    if (sel instanceof ILayer) {

        try {
            ILayer l = (ILayer) sel;
            if (isLayerNode() || isNodeOfType(AbstractAction.TYPE_PART)) {

                if (skAdapter instanceof S60SkinnableEntityAdapter) {
                    // copy image + mask
                    l.copyImageToClipboard(clip);
                }
            } else if (isImageNode()) {
                // copy image only
                Object param = l.getFileName(false) == null ? l.getRAWImage() : l.getFileName(true);
                ClipboardHelper.copyImageToClipboard(clip, param);
            } else if (isMaskNode()) {
                // copy mask only
                if (l.getMaskFileName(true) != null) {
                    ClipboardHelper.copyImageToClipboard(clip, l.getMaskFileName(true));
                } else {
                    ClipboardHelper.copyImageToClipboard(clip, l.getMaskImage());
                }
            } else {
                l.copyImageToClipboard(clip);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return;
    }

    IImageHolder holder = getImageHolder(sel);
    if (holder != null) {
        holder.copyImageToClipboard(clip);
        return;
    }

    // IContentData data = getContentData(sel);

    if (data != null) {

        ISkinnableContentDataAdapter skinableAdapter = (ISkinnableContentDataAdapter) data
                .getAdapter(ISkinnableContentDataAdapter.class);
        if (skinableAdapter != null) {
            skinableAdapter.copyToClipboard(null);
            return;
        }

        /*
         * ISkinnableEntityAdapter skAdapter = (ISkinnableEntityAdapter)
         * data .getAdapter(ISkinnableEntityAdapter.class);
         */
        if (skAdapter != null) {

            if (skAdapter.hasMask()) {

            }

            if (skAdapter instanceof S60SkinnableEntityAdapter)
                skAdapter.copyImageToClipboard(clip);

            else {
                copyIdAndFileToClipboard(data, skAdapter);
            }
            // if (skAdapter.isNinePiece()) {
            if (skAdapter.isMultiPiece()) {
                // copy from 9-piece was performed, show info dialog
                IPreferenceStore store = S60WorkspacePlugin.getDefault().getPreferenceStore();
                Boolean showState = store.getBoolean(skAdapter.getCopyPieceInfo());
                // .getBoolean(IMediaConstants.NINE_PIECE_COPY_INFO);
                if (showState || silent)
                    return;

                IBrandingManager branding = BrandingExtensionManager.getBrandingManager();
                Image image = null;
                if (branding != null) {
                    image = branding.getIconImageDescriptor().createImage();
                }
                MessageDialog messageDialog = new MessageDialogWithCheckBox(
                        PlatformUI.getWorkbench().getDisplay().getActiveShell(),
                        Messages.CopyAction_9piece_title, image, MultiPieceManager.getCopyMessageText(),
                        // MultipieceHelper.getCopyMessageText(),
                        Messages.CopyAction_9piece_checkbox, false, null, null, null, 2,
                        new String[] { IDialogConstants.OK_LABEL }, 0);
                messageDialog.open();
                if (image != null) {
                    image.dispose();
                }

                // store.setValue(IMediaConstants.NINE_PIECE_COPY_INFO,
                store.setValue(skAdapter.getCopyPieceInfo(),
                        ((MessageDialogWithCheckBox) messageDialog).getCheckBoxValue());
            }
        }
        return;
    }

    ILayer layer = getLayer(true, sel);
    if (layer != null) {
        layer.copyImageToClipboard(clip);
    }
}

From source file:com.nokia.tools.s60.editor.ProjectSaveAsDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.nokia.tools.s60.editor.ui.dialogs.ElevenPieceOperationConfirmDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    /*createButton(parent, IDialogConstants.YES_ID,
    IDialogConstants.YES_LABEL, true);//from w  w w .  j av a 2 s  . co  m
    createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL,
    false);*/
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.nokia.tools.s60.editor.ui.dialogs.WarningMessageDialogs.java

License:Open Source License

public static void noPreviewAvailableMessageBox() {
    IPreferenceStore store = S60WorkspacePlugin.getDefault().getPreferenceStore();
    Boolean showState = store.getBoolean(IS60IDEConstants.PREF_NO_PREVIEW_HIDE_MESSAGEBOX);
    if (showState)
        return;/*from  w ww.j av  a2 s . c  o m*/

    IBrandingManager branding = BrandingExtensionManager.getBrandingManager();
    Image image = null;
    if (branding != null) {
        image = branding.getIconImageDescriptor().createImage();
    }
    MessageDialog messageDialog = new MessageDialogWithCheckBox(
            PlatformUI.getWorkbench().getDisplay().getActiveShell(), ViewMessages.IconView_Preview_MsgBox_Title,
            image, ViewMessages.IconView_Preview_MsgBox_Message, ViewMessages.IconView_Preview_MsgBox_ShowAgain,
            false, null, null, null, 2, new String[] { IDialogConstants.OK_LABEL }, 0);

    messageDialog.open();

    if (image != null) {
        image.dispose();
    }

    store.setValue(IS60IDEConstants.PREF_NO_PREVIEW_HIDE_MESSAGEBOX,
            ((MessageDialogWithCheckBox) messageDialog).getCheckBoxValue());

}