Examples of MessageDialogWithToggle


Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle

    // Activate the shell if necessary so the prompt is visible
    if (shell.getMinimized()) {
      shell.setMinimized(false);
    }

    MessageDialogWithToggle dialog = MessageDialogWithToggle
        .openYesNoQuestion(shell,
            PHPUIMessages.PerspectiveManager_Switch_Dialog_Title,
            message, null, false, PHPUiPlugin.getDefault()
                .getPreferenceStore(), preferenceKey);
    boolean answer = (dialog.getReturnCode() == IDialogConstants.YES_ID);
    synchronized (PerspectiveManager.class) {
      fPrompting = false;
      PerspectiveManager.class.notifyAll();
    }
    if (isCurrentPerspective(window, perspectiveId)) {
View Full Code Here

Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle

    final Display disp = Display.getDefault();
    disp.syncExec(new Runnable() {
      public void run() {
        // Display a dialog to notify the existence of a previous active
        // launch.
        MessageDialogWithToggle m = MessageDialogWithToggle.openYesNoQuestion(
            disp.getActiveShell(),
            PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
            PHPDebugCoreMessages.PHPLaunchUtilities_multipleLaunchesPrompt,
            PHPDebugCoreMessages.PHPLaunchUtilities_rememberDecision,
            false, store,
            PreferenceConstants.ALLOW_MULTIPLE_LAUNCHES);
        resultHolder.setReturnCode(m.getReturnCode());
      }
    });
    switch (resultHolder.getReturnCode()) {
    case IDialogConstants.YES_ID:
    case IDialogConstants.OK_ID:
View Full Code Here

Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle

          return false;
        }
      }

      // Ask the user whether to switch
      MessageDialogWithToggle m = MessageDialogWithToggle
          .openYesNoQuestion(
              window.getShell(),
              PHPDebugCoreMessages.PHPLaunchUtilities_PHPPerspectiveSwitchTitle,
              NLS.bind(
                  PHPDebugCoreMessages.PHPLaunchUtilities_PHPPerspectiveSwitchMessage,
                  new String[] { perspective.getLabel() }),
              PHPDebugCoreMessages.PHPLaunchUtilities_rememberDecision,
              false, store,
              PreferenceConstants.SWITCH_BACK_TO_PHP_PERSPECTIVE);

      int result = m.getReturnCode();
      switch (result) {
      case IDialogConstants.YES_ID:
      case IDialogConstants.OK_ID:
        return true;
      case IDialogConstants.NO_ID:
View Full Code Here

Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle

            && !getPreferenceStore().getBoolean("MAKE_WRITABLE")) {
         
          String[] labels = new String[2];
          labels[0] = "OK";
          labels[1] = "Make writable";
          MessageDialogWithToggle msg = new MessageDialogWithToggle(
              this.getEditorSite().getShell(),
              "Warning!",
              null,
              "You are opening a read only file. You will not be able to make or save any changes.",
              MessageDialog.WARNING, labels, 0,
              "Don't show this warning in future.", false);
          //MessageBox msg = new MessageBox(this.getEditorSite().getShell());
          //msg.setText("Warning!");
          //msg.setMessage("You are opening a read only file. You will not be
          // able to make or save any changes.");
          if (msg.open() == 0) {
            if (msg.getToggleState()) {
              // Don't show warning in future.
              getPreferenceStore().setValue(
                  EditorPreferenceConstants.P_WARN_READ_ONLY_FILES, false);
            }
          } else {
            if (msg.getToggleState()) {
              // Don't show warning in future.
              getPreferenceStore().setValue("MAKE_WRITABLE", true);
            }
            setReadOnly(false);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.