Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle


    protected static void askUserToSwitch(IWorkbenchPart part, int warningsNumber) {
        final IPreferenceStore store = FindbugsPlugin.getDefault().getPreferenceStore();
        String message = "FindBugs analysis finished, " + warningsNumber
                + " warnings found.\n\nSwitch to the FindBugs perspective?";

        MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(null, "FindBugs analysis finished",
                message, "Remember the choice and do not ask me in the feature", false, store,
                FindBugsConstants.ASK_ABOUT_PERSPECTIVE_SWITCH);

        boolean remember = dialog.getToggleState();
        int returnCode = dialog.getReturnCode();

        if (returnCode == IDialogConstants.YES_ID) {
            if (remember) {
                store.setValue(FindBugsConstants.SWITCH_PERSPECTIVE_AFTER_ANALYSIS, true);
            }
View Full Code Here


    IPreferenceStore store = WorkbenchPlugin.getDefault()
        .getPreferenceStore();
    if (!store.contains(PREF_SKIP_GOTO_ACTION_PROMPT)
        || !store.getString(PREF_SKIP_GOTO_ACTION_PROMPT).equals(
            MessageDialogWithToggle.ALWAYS)) {
      MessageDialogWithToggle dialog = MessageDialogWithToggle
          .openOkCancelConfirm(
              getShell(),
              ProgressMessages.JobErrorDialog_CloseDialogTitle,
              ProgressMessages.JobErrorDialog_CloseDialogMessage,
              ProgressMessages.JobErrorDialog_DoNotShowAgainMessage,
              false, store, PREF_SKIP_GOTO_ACTION_PROMPT);
      return dialog.getReturnCode() == OK;
    }
    return true;
  }
View Full Code Here

        }

        boolean doPasteFile = false;
        if (fileSize == 0 || fileSize > 1024) {
          if (preferenceStore.getString(IEclipastiePreferenceConstants.MENU_HANDLER_OPENFILEQUESTION_TOGGLE_PREFERENCE).equals(MessageDialogWithToggle.PROMPT)) {
            MessageDialogWithToggle openFileQuestion = MessageDialogWithToggle.openYesNoCancelQuestion(
                window.getShell(),
                EclipastiePlugin.PLUGINNAME,
                String.format(Messages.Message_ReallyPaste, fileName, niceFileSizeForMessageBox),
                Messages.Message_RememberDecision,
                false,
                preferenceStore,
                IEclipastiePreferenceConstants.MENU_HANDLER_OPENFILEQUESTION_TOGGLE_PREFERENCE);

            if (openFileQuestion.getReturnCode() == IDialogConstants.YES_ID) {
              doPasteFile = true;
            }
          } else {
            if (preferenceStore.getString(IEclipastiePreferenceConstants.MENU_HANDLER_OPENFILEQUESTION_TOGGLE_PREFERENCE).equals(MessageDialogWithToggle.ALWAYS)) {
              doPasteFile = true;
View Full Code Here

        try {
            String jarPath = PDEJavaModelUtil.getContainingJarPath(element);
            ModuleInfo moduleInfo = WojServicesHelper.getDefault().getModuleInfo(jarPath);
            if(moduleInfo == null || !moduleInfo.isKnown()) {
              LOGGER.debug("module is unknow");//$NON-NLS-1$
                MessageDialogWithToggle dialogWithToggle = MessageDialogWithToggle.openYesNoQuestion(shell, Messages.getString("javadoc.addmodule.title"), Messages.getString("javadoc.addmodule.message"), Messages.getString("javadoc.addmodule.toggle.message"), false, WojPlugin.getDefault().getPreferenceStore(), PreferenceConstants.ASK_ADDMODULE_FROM_JAVADOC); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                int response = dialogWithToggle.getReturnCode();
                if(response == MessageDialogWithToggle.OK || response == 2) {//seems that return value is 2 for ok instaed of 0
                    AddModule.showAddModuleDialog(jarPath);
                }
            } else if(!moduleInfo.hasJavadoc()) {
              LOGGER.debug("module has no javadoc");//$NON-NLS-1$
View Full Code Here

    if (desc == null || desc.length() == 0)
      message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage, finalPersp.getLabel());
    else
      message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessageWithDesc, new String[] { finalPersp.getLabel(), desc });

    MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(window.getShell(), ResourceMessages.NewProject_perspSwitchTitle, message, null, false, store, IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
    int result = dialog.getReturnCode();

    // If we are not going to prompt anymore propogate the choice.
    if (dialog.getToggleState()) {
      String preferenceValue;
      if (result == IDialogConstants.YES_ID) {
        // Doesn't matter if it is replace or new window
        // as we are going to use the open perspective setting
        preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;
View Full Code Here

    }
    if (name != null && extension != null && name.equals("." + extension))
      extension = null;
    String pattern = null;
    if (name != null && extension != null) {
      MessageDialogWithToggle messageDialogWithToggle = MessageDialogWithToggle.openOkCancelConfirm(this.part.getSite().getShell(), "Add pattern", "Add all resources with extension " + extension, "add by extension (otherwise by name)", true, null, null);
      if (messageDialogWithToggle.getReturnCode() == Window.CANCEL)
        return null;
      if (messageDialogWithToggle.getToggleState()) {
        if (this.getActionResource() instanceof IContainer)
          pattern = "**/*." + extension + "/**";
        pattern = "**/*." + extension;
      } else {
        if (this.getActionResource() instanceof IContainer)
View Full Code Here

    if (desc == null || desc.length() == 0)
      message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage, finalPersp.getLabel());
    else
      message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessageWithDesc, new String[] { finalPersp.getLabel(), desc });

    MessageDialogWithToggle dialog = MessageDialogWithToggle
        .openYesNoQuestion(window.getShell(),
            ResourceMessages.NewProject_perspSwitchTitle, message,
            null /* use the default message for the toggle */,
            false /* toggle is initially unchecked */, store,
            IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
    int result = dialog.getReturnCode();
   
    // If we are not going to prompt anymore propagate the choice.
    if (dialog.getToggleState()) {
      String preferenceValue;
      if (result == IDialogConstants.YES_ID) {
        // Doesn't matter if it is replace or new window
        // as we are going to use the open perspective setting
        preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;
View Full Code Here

    else
      message = NLS.bind(
          ResourceMessages.NewProject_perspSwitchMessageWithDesc,
          new String[] { finalPersp.getLabel(), desc });

    MessageDialogWithToggle dialog = MessageDialogWithToggle
        .openYesNoQuestion(window.getShell(),
            ResourceMessages.NewProject_perspSwitchTitle, message,
            null /* use the default message for the toggle */,
            false /* toggle is initially unchecked */, store,
            IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
    int result = dialog.getReturnCode();

    // If we are not going to prompt anymore propogate the choice.
    if (dialog.getToggleState()) {
      String preferenceValue;
      if (result == IDialogConstants.YES_ID) {
        // Doesn't matter if it is replace or new window
        // as we are going to use the open perspective setting
        preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;
View Full Code Here

      IPreferenceStore store = Activator.getDefault()
          .getPreferenceStore();

      if (store.getBoolean(UIPreferences.SHOW_CHECKOUT_CONFIRMATION)) {
        String toggleMessage = UIText.RepositoriesView_CheckoutConfirmationToggleMessage;
        MessageDialogWithToggle dlg = MessageDialogWithToggle
            .openOkCancelConfirm(
                getViewSite().getShell(),
        UIText.RepositoriesView_CheckoutConfirmationTitle,
        MessageFormat.format(UIText.RepositoriesView_CheckoutConfirmationMessage,
                    shortName),
                    toggleMessage, false, store,
                    UIPreferences.SHOW_CHECKOUT_CONFIRMATION);
        if (dlg.getReturnCode() != Window.OK)
          return;
      }
    }
    executeOpenCommand();
  }
View Full Code Here

    String[] buttons = new String[] { UIText.BranchOperationUI_Continue,
        IDialogConstants.CANCEL_LABEL };
    String message = NLS.bind(
        UIText.BranchOperationUI_RunningLaunchMessage,
        launchConfiguration.getName());
    MessageDialogWithToggle continueDialog = new MessageDialogWithToggle(
        getShell(), UIText.BranchOperationUI_RunningLaunchTitle, null,
        message, MessageDialog.NONE, buttons, 0,
        UIText.BranchOperationUI_RunningLaunchDontShowAgain, false);
    int result = continueDialog.open();
    // cancel
    if (result == IDialogConstants.CANCEL_ID || result == SWT.DEFAULT)
      return true;
    boolean dontWarnAgain = continueDialog.getToggleState();
    if (dontWarnAgain)
      store.setValue(
          UIPreferences.SHOW_RUNNING_LAUNCH_ON_CHECKOUT_WARNING,
          false);
    return false;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.MessageDialogWithToggle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.