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


Java Messages.showYesNoDialog方法代码示例

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


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

示例1: apply

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
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,代码行数:24,代码来源:PluginModuleBuildConfEditor.java

示例2: ensureCouldCloseIfUnableToSave

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static boolean ensureCouldCloseIfUnableToSave(@NotNull Project project) {
  UnableToSaveProjectNotification[] notifications =
    NotificationsManager.getNotificationsManager().getNotificationsOfType(UnableToSaveProjectNotification.class, project);
  if (notifications.length == 0) {
    return true;
  }

  StringBuilder message = new StringBuilder();
  message.append(String.format("%s was unable to save some project files,\nare you sure you want to close this project anyway?",
                               ApplicationNamesInfo.getInstance().getProductName()));

  message.append("\n\nRead-only files:\n");
  int count = 0;
  VirtualFile[] files = notifications[0].myFiles;
  for (VirtualFile file : files) {
    if (count == 10) {
      message.append('\n').append("and ").append(files.length - count).append(" more").append('\n');
    }
    else {
      message.append(file.getPath()).append('\n');
      count++;
    }
  }
  return Messages.showYesNoDialog(project, message.toString(), "Unsaved Project", Messages.getWarningIcon()) == Messages.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ProjectManagerImpl.java

示例3: processCheckedOutDirectory

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public boolean processCheckedOutDirectory(Project project, File directory) {
  final File[] files = directory.listFiles();
  if (files != null) {
    final LocalFileSystem localFileSystem = LocalFileSystem.getInstance();
    for (File file : files) {
      if (file.isDirectory()) continue;
      final VirtualFile virtualFile = localFileSystem.findFileByIoFile(file);
      if (virtualFile != null) {
        final ProjectOpenProcessor openProcessor = ProjectOpenProcessor.getImportProvider(virtualFile);
        if (openProcessor != null) {
          int rc = Messages
            .showYesNoDialog(project, VcsBundle.message("checkout.open.project.prompt", ProjectCheckoutListener.getProductNameWithArticle(), file.getPath()),
                             VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
          if (rc == Messages.YES) {
            openProcessor.doOpenProject(virtualFile, project, false);
          }
          return true;
        }
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ProjectImporterCheckoutListener.java

示例4: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  RepositoryTreeNode node = myBrowserComponent.getSelectedNode();
  if (node == null) {
    return;
  }
  SVNURL url = node.getURL();
  if (url != null) {
    int rc = Messages.showYesNoDialog(myBrowserComponent.getProject(), SvnBundle.message("repository.browser.discard.location.prompt", url.toString()),
                                      SvnBundle.message("repository.browser.discard.location.title"), Messages.getQuestionIcon());
    if (rc != Messages.YES) {
      return;
    }
    SvnApplicationSettings.getInstance().removeCheckoutURL(url.toString());
    myBrowserComponent.removeURL(url.toString());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RepositoryBrowserDialog.java

示例5: checkForReturnFromMethod

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static boolean checkForReturnFromMethod(GrExpression replacedNewExpression) {
  final PsiElement parent = PsiUtil.skipParentheses(replacedNewExpression.getParent(), true);
  final GrMethod method = PsiTreeUtil.getParentOfType(replacedNewExpression, GrMethod.class, true, GrClosableBlock.class);
  if (method == null) return false;

  if (!(parent instanceof GrReturnStatement)) { //check for return expression
    final List<GrStatement> returns = ControlFlowUtils.collectReturns(method.getBlock());
    final PsiElement expr = PsiUtil.skipParentheses(replacedNewExpression, true);
    if (!(returns.contains(expr))) return false;
  }
  return !(!ApplicationManager.getApplication().isUnitTestMode() && Messages.showYesNoDialog(replacedNewExpression.getProject(),
                                                                                             GroovyIntentionsBundle.message(
                                                                                               "do.you.want.to.change.method.return.type",
                                                                                               method.getName()),
                                                                                             GroovyIntentionsBundle
                                                                                               .message(
                                                                                                 "convert.map.to.class.intention.name"),
                                                                                             Messages.getQuestionIcon()) != Messages.YES);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ConvertMapToClassIntention.java

示例6: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
    final Project project = e.getData(CommonDataKeys.PROJECT);
    // Prompt since we are killing ALL
    if (Messages.showYesNoDialog(project, "This will clear all of your channels settings", "Slack Settings", SlackStorage.getSlackIcon()) == 0) {
        SlackStorage.getInstance().clearAll();
        Messages.showMessageDialog(project, "Settings cleared.", "Information", Messages.getInformationIcon());
    }
}
 
开发者ID:chakki-works,项目名称:watchMe,代码行数:9,代码来源:SlackSettings.java

示例7: resetStats

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void resetStats() {
    if (Messages.showYesNoDialog(
            KeyPromoterBundle.message("kp.dialog.reset.statistic.text"),
            KeyPromoterBundle.message("kp.dialog.reset.statistic.title"),
            Messages.getQuestionIcon()) == 0) {
        statService.resetStatistic();
    }
}
 
开发者ID:halirutan,项目名称:IntelliJ-Key-Promoter-X,代码行数:9,代码来源:KeyPromoterToolWindowBuilder.java

示例8: onWizardFinished

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void onWizardFinished() throws CommitStepException {
  if (isFrameworksMode()) {
    boolean ok = myFrameworksPanel.downloadLibraries();
    if (!ok) {
      int answer = Messages.showYesNoDialog(getComponent(),
                                            ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
                                            CommonBundle.getWarningTitle(), Messages.getWarningIcon());
      if (answer != Messages.YES) {
        throw new CommitStepException(null);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ProjectTypeStep.java

示例9: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  final int result = Messages
    .showYesNoDialog(project, VcsBundle.message("delete.all.already.unshelved.confirmation"), myText,
                     Messages.getWarningIcon());
  if (Messages.YES == result) {
    final ShelveChangesManager manager = ShelveChangesManager.getInstance(project);
    manager.clearRecycled();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DeleteAlreadyUnshelvedAction.java

示例10: processCheckedOutDirectory

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public boolean processCheckedOutDirectory(Project project, File directory) {
  if (new File(directory, Project.DIRECTORY_STORE_FOLDER).exists()) {
    String message = VcsBundle.message("checkout.open.project.dir.prompt",
                                       ProjectCheckoutListener.getProductNameWithArticle(), directory.getPath());
    int rc = Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
    if (rc == Messages.YES) {
      ProjectUtil.openProject(directory.getPath(), project, false);
    }
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ProjectDirCheckoutListener.java

示例11: getCurrentRootDir

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static File getCurrentRootDir(Context ctx) {
    if (FileTemplateHelper.isDefaultScheme(ctx.project)) {
        return PackageTemplateHelper.getRootDir();
    }

    int resultCode = Messages.showYesNoDialog(
            ctx.project,
            Localizer.get("title.ImportPackageTemplate"),
            Localizer.get("text.WhereToSave"),
            Localizer.get("action.ToDefaultDir"),
            Localizer.get("action.ToProjectDir"),
            Messages.getQuestionIcon()
    );
    //To Default
    if (resultCode == Messages.YES) {
        ctx.newFileTemplateSource = FileTemplateSource.DEFAULT_ONLY;
        return PackageTemplateHelper.getRootDir();
    } else {
        //To Project
        ctx.newFileTemplateSource = FileTemplateSource.PROJECT_ONLY;
        String rootDirPath = PackageTemplateHelper.getProjectRootDirPath(ctx.project);
        if (rootDirPath == null) {
            return null;
        }

        File file = new File(rootDirPath);
        FileWriter.createDirectories(file.toPath());
        return file;
    }
}
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:31,代码来源:ImportHelper.java

示例12: apply

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public boolean apply() {
  if (myFirstTime ||
      Messages.showYesNoDialog((Project)null, "All stored passwords will be removed! Are you sure you want to proceed?",
                               "Confirm Master Password Reset", Messages.getWarningIcon()) == Messages.YES) {
    mySafe.resetMasterPassword(new String(myNewPasswordField.getPassword()), myEncryptCheckBox.isSelected());
    ((PasswordSafeImpl)PasswordSafe.getInstance()).getMemoryProvider().clear();
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ResetPasswordComponent.java

示例13: createDeleteButtonActionListener

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@NotNull
private ActionListener createDeleteButtonActionListener(final JBList list,
                                                        final Object selectedItem) {
    return actionEvent -> {
        logger.info("Trying to delete folder. @CourseTabFactory");
        if (Messages
                .showYesNoDialog("Are you sure you wish to permanently delete this folder?",
                        "Delete Exercise", Messages.getWarningIcon()) != 0) {
            return;
        }

        try {
            if (selectedItem.getClass() != Exercise.class) {
                FileUtils.deleteDirectory(new File(TmcSettingsManager
                        .get().getProjectBasePath()
                        + File.separator + list.getParent()
                        .getParent().getName() + File.separator
                        + list.getSelectedValue()));
            } else {
                logger.info("Getting TMC project directory "
                        + "from settingsTmc. @CourseTabFactory");
                FileUtils.deleteDirectory(new File(((Exercise) selectedItem)
                        .getExerciseDirectory(TmcSettingsManager
                                .get().getTmcProjectDirectory()).toString()));
            }
            new ProjectListWindow().refreshProjectList();
        } catch (IOException e1) {
            logger.warn("IOException occurred. Something interrupted "
                            + "the mouse action. @CourseTabFactory",
                    e1, e1.getStackTrace());
            new ErrorMessageService().showErrorMessage(e1,
                    "IOException occurred. Something interrupted the mouse action.",
                    true);
        }
    };
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:37,代码来源:CourseTabFactory.java

示例14: contentRemoveQuery

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void contentRemoveQuery(ContentManagerEvent event) {
  if (event.getContent() == myContent) {
    if (myErrorsView != null && myErrorsView.canControlProcess() && !myErrorsView.isProcessStopped()) {
      int result = Messages.showYesNoDialog(
        myContentName + " Running",
        myContentName + " is still running. Close anyway?",
          Messages.getQuestionIcon()
      );
      if (result != Messages.YES) {
        event.consume();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:MessageViewHelper.java

示例15: contentRemoveQuery

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@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,代码行数:16,代码来源:StdErrorReporter.java


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