当前位置: 首页>>代码示例>>Java>>正文


Java Messages.YES属性代码示例

本文整理汇总了Java中com.intellij.openapi.ui.Messages.YES属性的典型用法代码示例。如果您正苦于以下问题:Java Messages.YES属性的具体用法?Java Messages.YES怎么用?Java Messages.YES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.openapi.ui.Messages的用法示例。


在下文中一共展示了Messages.YES属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkMovePackage

private static boolean checkMovePackage(Project project, PsiPackage aPackage) {
  final PsiDirectory[] directories = aPackage.getDirectories();
  final VirtualFile[] virtualFiles = aPackage.occursInPackagePrefixes();
  if (directories.length > 1 || virtualFiles.length > 0) {
    final StringBuffer message = new StringBuffer();
    RenameUtil.buildPackagePrefixChangedMessage(virtualFiles, message, aPackage.getQualifiedName());
    if (directories.length > 1) {
      DirectoryAsPackageRenameHandlerBase.buildMultipleDirectoriesInPackageMessage(message, aPackage.getQualifiedName(), directories);
      message.append("\n\n");
      String report = RefactoringBundle
        .message("all.these.directories.will.be.moved.and.all.references.to.0.will.be.changed", aPackage.getQualifiedName());
      message.append(report);
    }
    message.append("\n");
    message.append(RefactoringBundle.message("do.you.wish.to.continue"));
    int ret =
      Messages.showYesNoDialog(project, message.toString(), RefactoringBundle.message("warning.title"), Messages.getWarningIcon());
    if (ret != Messages.YES) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:MoveClassesOrPackagesImpl.java

示例2: apply

public void apply() throws ConfigurationException {
  if (myUseUserManifest.isSelected() && myManifest.getText() != null && !new File(myManifest.getText()).exists()){
    throw new ConfigurationException(DevKitBundle.message("error.file.not.found.message", myManifest.getText()));
  }
  final File plugin = new File(myBuildProperties.getPluginXmlPath());
  final String newPluginPath = myPluginXML.getText() + File.separator + META_INF + File.separator + PLUGIN_XML;
  if (plugin.exists() && !plugin.getPath().equals(newPluginPath) && 
      Messages.showYesNoDialog(myModule.getProject(), DevKitBundle.message("deployment.view.delete", plugin.getPath()),
                               DevKitBundle.message("deployment.cleanup", META_INF), null) == Messages.YES) {

    CommandProcessor.getInstance().executeCommand(myModule.getProject(),
                                                  new Runnable() {
                                                    public void run() {
                                                      FileUtil.delete(plugin.getParentFile());
                                                    }
                                                  },
                                                  DevKitBundle.message("deployment.cleanup", META_INF),
                                                  null);
  }
  myBuildProperties.setPluginXmlPathAndCreateDescriptorIfDoesntExist(newPluginPath);
  myBuildProperties.setManifestPath(myManifest.getText());
  myBuildProperties.setUseUserManifest(myUseUserManifest.isSelected());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:PluginModuleBuildConfEditor.java

示例3: showYesNoDialog

@Override
public int showYesNoDialog(@NotNull String title,
                           String message,
                           @NotNull String yesButton,
                           @NotNull String noButton,
                           @Nullable Window window,
                           @Nullable DialogWrapper.DoNotAskOption doNotAskDialogOption) {
  if (window == null) {
    window = getForemostWindow(null);
  }
  SheetMessage sheetMessage = new SheetMessage(window, title, message, UIUtil.getQuestionIcon(),
                                               new String [] {yesButton, noButton}, doNotAskDialogOption, yesButton, noButton);
  int result = sheetMessage.getResult().equals(yesButton) ? Messages.YES : Messages.NO;
  if (doNotAskDialogOption != null && (result == Messages.YES || doNotAskDialogOption.shouldSaveOptionsOnCancel())) {
    doNotAskDialogOption.setToBeShown(sheetMessage.toBeShown(), result);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JBMacMessages.java

示例4: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
  AvdManagerConnection connection = AvdManagerConnection.getDefaultAvdManagerConnection();
  AvdInfo avdInfo = getAvdInfo();
  if (avdInfo == null) {
    return;
  }
  if (connection.isAvdRunning(avdInfo)) {
    Messages.showErrorDialog((Project)null, "The selected AVD is currently running in the Emulator. " +
                                            "Please exit the emulator instance and try wiping again.", "Cannot Wipe A Running AVD");
    return;
  }
  int result = Messages.showYesNoDialog((Project)null, "Do you really want to wipe user files from AVD " + avdInfo.getName() + "?",
                                        "Confirm Data Wipe", AllIcons.General.QuestionDialog);
  if (result == Messages.YES) {
    connection.wipeUserData(avdInfo);
    refreshAvds();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:WipeAvdDataAction.java

示例5: checkAddModuleDependency

private boolean checkAddModuleDependency(final ComponentItem item, final ModuleSourceOrderEntry moduleSourceOrderEntry) {
  final Module ownerModule = moduleSourceOrderEntry.getOwnerModule();
  int rc = Messages.showYesNoCancelDialog(
    myEditor,
    UIDesignerBundle.message("add.module.dependency.prompt", item.getClassName(), ownerModule.getName(), myEditor.getModule().getName()),
    UIDesignerBundle.message("add.module.dependency.title"),
    Messages.getQuestionIcon());
  if (rc == Messages.CANCEL) return false;
  if (rc == Messages.YES) {
    ModuleRootModificationUtil.addDependency(myEditor.getModule(), ownerModule);
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:InsertComponentProcessor.java

示例6: showExitWithoutApplyingChangesDialog

public static boolean showExitWithoutApplyingChangesDialog(@NotNull JComponent component,
                                                           @NotNull MergeRequest request,
                                                           @NotNull MergeContext context) {
  String message = DiffBundle.message("merge.dialog.exit.without.applying.changes.confirmation.message");
  String title = DiffBundle.message("cancel.visual.merge.dialog.title");
  Couple<String> customMessage = DiffUtil.getUserData(request, context, DiffUserDataKeysEx.MERGE_CANCEL_MESSAGE);
  if (customMessage != null) {
    title = customMessage.first;
    message = customMessage.second;
  }

  return Messages.showYesNoDialog(component.getRootPane(), message, title, Messages.getQuestionIcon()) == Messages.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MergeUtil.java

示例7: contentRemoveQuery

@Override
public void contentRemoveQuery(ContentManagerEvent event) {
  if (event.getContent() == myContent) {
    if (!myErrorsView.isProcessStopped()) {
      int result = Messages.showYesNoDialog(
        XmlBundle.message("xml.validate.validation.is.running.terminate.confirmation.text"),
        XmlBundle.message("xml.validate.validation.is.running.terminate.confirmation.title"),
        Messages.getQuestionIcon()
      );
      if (result != Messages.YES) {
        event.consume();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:StdErrorReporter.java

示例8: doOKAction

@Override
protected void doOKAction() {
  final PsiClass clazz = (PsiClass)myContext.getScope();
  final String name = getName();
  String message = RefactoringBundle.message("field.exists", name, clazz.getQualifiedName());
  if (clazz.findFieldByName(name, true) != null &&
      Messages.showYesNoDialog(myContext.getProject(), message, IntroduceFieldHandler.REFACTORING_NAME, Messages.getWarningIcon()) != Messages.YES) {
    return;
  }
  super.doOKAction();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GrIntroduceFieldDialog.java

示例9: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
  Device device = myProvider.getDevice();
  int result = Messages.showYesNoDialog((Project)null, "Do you really want to delete Device " + device.getDisplayName() + "?",
                                        "Confirm Deletion", AllIcons.General.QuestionDialog);
  if (result == Messages.YES) {
    DeviceManagerConnection.getDefaultDeviceManagerConnection().deleteDevice(device);
    myProvider.refreshDevices();
    myProvider.selectDefaultDevice();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DeleteDeviceAction.java

示例10: mergeIfNeeded

private static void mergeIfNeeded(@NotNull final File sourceSdk, @NotNull final File destSdk) {
  if (SdkMerger.hasMergeableContent(sourceSdk, destSdk)) {
    String msg = String.format("The Android SDK at\n\n%1$s\n\nhas packages not in your project's SDK at\n\n%2$s\n\n" +
                               "Would you like to copy into the project SDK?", sourceSdk.getPath(), destSdk.getPath());
    int result = MessageDialogBuilder.yesNo("Merge SDKs", msg).yesText("Copy").noText("Do not copy").show();
    if (result == Messages.YES) {
      new Task.Backgroundable(null, "Merging Android SDKs", false) {
        @Override
        public void run(@NotNull ProgressIndicator indicator) {
          SdkMerger.mergeSdks(sourceSdk, destSdk, indicator);
        }
      }.queue();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SdkSync.java

示例11: executeConfiguration

public static void executeConfiguration(@NotNull ExecutionEnvironment environment, boolean showSettings, boolean assignNewId) {
  if (ExecutorRegistry.getInstance().isStarting(environment)) {
    return;
  }

  RunnerAndConfigurationSettings runnerAndConfigurationSettings = environment.getRunnerAndConfigurationSettings();
  if (runnerAndConfigurationSettings != null) {
    if (!ExecutionTargetManager.canRun(environment)) {
      ExecutionUtil.handleExecutionError(environment, new ExecutionException(
        StringUtil.escapeXml("Cannot run '" + environment.getRunProfile().getName() + "' on '" + environment.getExecutionTarget().getDisplayName() + "'")));
      return;
    }

    if (!RunManagerImpl.canRunConfiguration(environment) || (showSettings && runnerAndConfigurationSettings.isEditBeforeRun())) {
      if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
        return;
      }

      while (!RunManagerImpl.canRunConfiguration(environment)) {
        if (Messages.YES == Messages
          .showYesNoDialog(environment.getProject(), "Configuration is still incorrect. Do you want to edit it again?", "Change Configuration Settings",
                           "Edit", "Continue Anyway", Messages.getErrorIcon())) {
          if (!RunDialog.editConfiguration(environment, "Edit configuration")) {
            return;
          }
        }
        else {
          break;
        }
      }
    }

    ConfigurationType configurationType = runnerAndConfigurationSettings.getType();
    if (configurationType != null) {
      UsageTrigger.trigger("execute." + ConvertUsagesUtil.ensureProperKey(configurationType.getId()) + "." + environment.getExecutor().getId());
    }
  }

  try {
    if (assignNewId) {
      environment.assignNewExecutionId();
    }
    environment.getRunner().execute(environment);
  }
  catch (ExecutionException e) {
    String name = runnerAndConfigurationSettings != null ? runnerAndConfigurationSettings.getName() : null;
    if (name == null) {
      name = environment.getRunProfile().getName();
    }
    if (name == null && environment.getContentToReuse() != null) {
      name = environment.getContentToReuse().getDisplayName();
    }
    if (name == null) {
      name = "<Unknown>";
    }
    ExecutionUtil.handleExecutionError(environment.getProject(), environment.getExecutor().getToolWindowId(), name, e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:58,代码来源:ProgramRunnerUtil.java

示例12: chooseOriginalMembers

@Nullable
@Override
protected ClassMember[] chooseOriginalMembers(PsiClass aClass, Project project) {
  final PsiMethod[] missings = aClass.findMethodsByName("methodMissing", true);

  PsiMethod method = null;

  for (PsiMethod missing : missings) {
    final PsiParameter[] parameters = missing.getParameterList().getParameters();
    if (parameters.length == 2) {
      if (isNameParam(parameters[0])) {
        method = missing;
      }
    }
  }
  if (method != null) {
    String text = GroovyCodeInsightBundle.message("generate.method.missing.already.defined.warning");

    if (Messages.showYesNoDialog(project, text,
                                 GroovyCodeInsightBundle.message("generate.method.missing.already.defined.title"),
                                 Messages.getQuestionIcon()) == Messages.YES) {
      final PsiMethod finalMethod = method;
      if (!ApplicationManager.getApplication().runWriteAction(new Computable<Boolean>() {
        @Override
        public Boolean compute() {
          try {
            finalMethod.delete();
            return Boolean.TRUE;
          }
          catch (IncorrectOperationException e) {
            LOG.error(e);
            return Boolean.FALSE;
          }
        }
      }).booleanValue()) {
        return null;
      }
    }
    else {
      return null;
    }
  }

  return new ClassMember[1];
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:GroovyGenerateMethodMissingHandler.java

示例13: confirmExitIfNeeded

private static boolean confirmExitIfNeeded(boolean exitConfirmed) {
  final boolean hasUnsafeBgTasks = ProgressManager.getInstance().hasUnsafeProgressIndicator();
  if (exitConfirmed && !hasUnsafeBgTasks) {
    return true;
  }

  DialogWrapper.DoNotAskOption option = new DialogWrapper.DoNotAskOption() {
    @Override
    public boolean isToBeShown() {
      return GeneralSettings.getInstance().isConfirmExit() && ProjectManager.getInstance().getOpenProjects().length > 0;
    }

    @Override
    public void setToBeShown(boolean value, int exitCode) {
      GeneralSettings.getInstance().setConfirmExit(value);
    }

    @Override
    public boolean canBeHidden() {
      return !hasUnsafeBgTasks;
    }

    @Override
    public boolean shouldSaveOptionsOnCancel() {
      return false;
    }

    @NotNull
    @Override
    public String getDoNotShowMessage() {
      return "Do not ask me again";
    }
  };

  if (hasUnsafeBgTasks || option.isToBeShown()) {
    String message = ApplicationBundle
      .message(hasUnsafeBgTasks ? "exit.confirm.prompt.tasks" : "exit.confirm.prompt",
               ApplicationNamesInfo.getInstance().getFullProductName());

    if (MessageDialogBuilder.yesNo(ApplicationBundle.message("exit.confirm.title"), message).yesText(ApplicationBundle.message("command.exit")).noText(CommonBundle.message("button.cancel"))
          .doNotAsk(option).show() != Messages.YES) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:ApplicationImpl.java

示例14: askUserToCancelGradleExecution

private boolean askUserToCancelGradleExecution() {
  String msg = "Gradle is running. Proceed with Project closing?";
  int result = Messages.showYesNoDialog(myProject, msg, GRADLE_RUNNING_MSG_TITLE, Messages.getQuestionIcon());
  return result == Messages.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GradleTasksExecutor.java

示例15: show

@Override
public void show(@NotNull final DiffRequest request) {
  saveContents(request);

  int result = DialogWrapper.CANCEL_EXIT_CODE;

  GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(getToolPath());
  try {
    commandLine.addParameters(getParameters(request));
    commandLine.createProcess();

    ProgressManager.getInstance().run(new Task.Modal(request.getProject(), "Launching external tool", false) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        indicator.setIndeterminate(true);
        TimeoutUtil.sleep(1000);
      }
    });

    if (Messages.YES == Messages.showYesNoDialog(request.getProject(),
                                                 "Press \"Mark as Resolved\" when you finish resolving conflicts in the external tool",
                                                 "Merge In External Tool", "Mark as Resolved", "Revert", null)) {
      result = DialogWrapper.OK_EXIT_CODE;
    }
    DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
      @Override
      public void run() {
        ((MergeRequestImpl)request).getResultContent().getFile().refresh(false, false);
      }
    });
    // We can actually check exit code of external tool, but some of them could work with tabs -> do not close at all
  }
  catch (Exception e) {
    ExecutionErrorDialog
      .show(new ExecutionException(e.getMessage()), DiffBundle.message("cant.launch.diff.tool.error.message"), request.getProject());
  }
  finally {
    ((MergeRequestImpl)request).setResult(result);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ExtMergeFiles.java


注:本文中的com.intellij.openapi.ui.Messages.YES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。