當前位置: 首頁>>代碼示例>>Java>>正文


Java IDialogConstants.YES_LABEL屬性代碼示例

本文整理匯總了Java中org.eclipse.jface.dialogs.IDialogConstants.YES_LABEL屬性的典型用法代碼示例。如果您正苦於以下問題:Java IDialogConstants.YES_LABEL屬性的具體用法?Java IDialogConstants.YES_LABEL怎麽用?Java IDialogConstants.YES_LABEL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.jface.dialogs.IDialogConstants的用法示例。


在下文中一共展示了IDialogConstants.YES_LABEL屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MultipleDeletionDialog

public MultipleDeletionDialog(Shell shell, String title, boolean hasMultiple) {
    this.title = title;
    this.shell = shell;
    this.hasMultiple = hasMultiple;
    if (hasMultiple) {
        buttons = new String[] {
            IDialogConstants.YES_LABEL, 
            IDialogConstants.YES_TO_ALL_LABEL, 
            IDialogConstants.NO_LABEL, 
            IDialogConstants.CANCEL_LABEL
        };
    } else {
        buttons = new String[] { 
                IDialogConstants.YES_LABEL,
                IDialogConstants.NO_LABEL, 
                IDialogConstants.CANCEL_LABEL 
        };
    }	 
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:19,代碼來源:MultipleDeletionDialog.java

示例2: processChanges

/**
 * This method has been copied and adapted from org.eclipse.xtext.ui.preferences.OptionsConfigurationBlock.
 */
@Override
protected boolean processChanges(IWorkbenchPreferenceContainer container) {
    boolean needsBuild = !getPreferenceChanges().isEmpty() | projectSpecificChanged;
    boolean doBuild = false;
    if (needsBuild) {
        int count = getRebuildCount();
        if (count > rebuildCount) {
            needsBuild = false;
            rebuildCount = count;
        }
    }
    if (needsBuild) {
        String[] strings = getFullBuildDialogStrings(project == null);
        if (strings != null) {
            MessageDialog dialog = new MessageDialog(this.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;
            }
        }
    }
    if (container != null) {
        if (doBuild) {
            incrementRebuildCount();
            container.registerUpdateJob(getBuildJob(getProject()));
        }
    } else {
        if (doBuild) {
            getBuildJob(getProject()).schedule();
        }
    }
    return true;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:42,代碼來源:N4JSBuilderPreferencePage.java

示例3: queryYesNoQuestion

/**
 * Displays a Yes/No question to the user with the specified message and returns the user's response.
 *
 * @param message
 *            the question to ask
 * @return <code>true</code> for Yes, and <code>false</code> for No
 */
private boolean queryYesNoQuestion(String message) {
    MessageDialog dialog = new MessageDialog(getContainer().getShell(),
            IDEWorkbenchMessages.Question,
            (Image) null, message, MessageDialog.NONE,
            new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) {
        @Override
        protected int getShellStyle() {
            return super.getShellStyle() | SWT.SHEET;
        }
    };
    return dialog.open() == 0;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:19,代碼來源:AbstractExportToSingleFileWizardPage.java

示例4: showDialog

private Boolean showDialog ( final ConfirmationCallback cb, final Display display, final Shell parentShell, final String dialogTitle )
{
    switch ( cb.getConfirmationType () )
    {
        case CONFIRM:
            return MessageDialog.openConfirm ( parentShell, dialogTitle, cb.getLabel () ) ? true : null;
        case ERROR:
            MessageDialog.openError ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case WARNING:
            MessageDialog.openWarning ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case INFORMATION:
            MessageDialog.openInformation ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case QUESTION:
            return MessageDialog.openQuestion ( parentShell, dialogTitle, cb.getLabel () );
        case QUESTION_WITH_CANCEL:
        {
            final MessageDialog dialog = new MessageDialog ( parentShell, dialogTitle, null, cb.getLabel (), MessageDialog.QUESTION_WITH_CANCEL, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0 );
            final int result = dialog.open ();
            if ( result == 2 /*CANCEL*/)
            {
                return null;
            }
            else
            {
                return result == Window.OK;
            }
        }
        default:
            throw new IllegalArgumentException ( String.format ( "Unable to process type: %s", cb.getConfirmationType () ) );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:34,代碼來源:ConfirmationDialogFuture.java

示例5: queryOverwrite

/**
 * The default implementation of this <code>IOverwriteQuery</code> method asks the user whether the existing
 * resource at the given path should be overwritten.
 *
 * @param pathString
 *            the path of the archive
 * @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>, <code>"ALL"</code>, or
 *         <code>"CANCEL"</code>
 */
@Override
public String queryOverwrite(String pathString) {

    IPath path = Path.fromOSString(pathString);

    String messageString;
    // Break the message up if there is a file name and a directory
    // and there are at least 2 segments.
    if (path.getFileExtension() == null || path.segmentCount() < 2) {
        messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_existsQuestion, pathString);
    } else {
        messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_overwriteNameAndPathQuestion,
                path.lastSegment(),
                path.removeLastSegments(1).toOSString());
    }

    final MessageDialog dialog = new MessageDialog(getContainer()
            .getShell(), IDEWorkbenchMessages.Question,
            null, messageString, MessageDialog.QUESTION, new String[] {
        IDialogConstants.YES_LABEL,
        IDialogConstants.YES_TO_ALL_LABEL,
        IDialogConstants.NO_LABEL,
        IDialogConstants.NO_TO_ALL_LABEL,
        IDialogConstants.CANCEL_LABEL }, 0) {
        @Override
        protected int getShellStyle() {
            return super.getShellStyle() | SWT.SHEET;
        }
    };
    String[] response = new String[] { YES, ALL, NO, NO_ALL, CANCEL };
    // run in syncExec because callback is from an operation,
    // which is probably not running in the UI thread.
    getControl().getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
            dialog.open();
        }
    });
    return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()];
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:49,代碼來源:AbstractExportToSingleFileWizardPage.java


注:本文中的org.eclipse.jface.dialogs.IDialogConstants.YES_LABEL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。