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


Java Messages.showWarningDialog方法代码示例

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


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

示例1: generateProject

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void generateProject(@NotNull final Project project, @NotNull final VirtualFile baseDir) {
  final Course course = getCourse(project);
  if (course == null) {
    LOG.warn("Course is null");
    Messages.showWarningDialog("Some problems occurred while creating the course", "Error in Course Creation");
    return;
  }
  else if (course.isAdaptive() && !StudyUtils.isCourseValid(course)) {
    Messages.showWarningDialog("There is no recommended tasks for this adaptive course", "Error in Course Creation");
    return;
  }
  StudyTaskManager.getInstance(project).setCourse(course);
  ApplicationManager.getApplication().runWriteAction(() -> {
    StudyGenerator.createCourse(course, baseDir);
    StudyUtils.registerStudyToolWindow(course, project);
    StudyUtils.openFirstTask(course, project);
    EduUsagesCollector.projectTypeCreated(course.isAdaptive() ? EduNames.ADAPTIVE : EduNames.STUDY);
  });
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:20,代码来源:StudyProjectGenerator.java

示例2: findItemToAdd

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
protected Object findItemToAdd() {
  String word = Messages.showInputDialog(SpellCheckerBundle.message("enter.simple.word"),
                                         SpellCheckerBundle.message("add.new.word"), null);
  if (word == null) {
    return null;
  }
  else {
    word = word.trim();
  }

  if (Strings.isMixedCase(word)) {
    Messages.showWarningDialog(SpellCheckerBundle.message("entered.word.0.is.mixed.cased.you.must.enter.simple.word", word),
                               SpellCheckerBundle.message("add.new.word"));
    return null;
  }
  if (!manager.hasProblem(word)) {
    Messages.showWarningDialog(SpellCheckerBundle.message("entered.word.0.is.correct.you.no.need.to.add.this.in.list", word),
                               SpellCheckerBundle.message("add.new.word"));
    return null;
  }
  return word;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SpellCheckerSettingsPane.java

示例3: showDiffImpl

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void showDiffImpl(final Project project, @NotNull List<DiffRequestPresentable> changeList, int index,
                                @NotNull final ShowDiffUIContext context) {
  final ChangeDiffRequest request = new ChangeDiffRequest(project, changeList, context.getActionsFactory(), context.isShowFrame());
  final DiffTool tool = DiffManager.getInstance().getDiffTool();
  final DiffRequest simpleRequest;
  try {
    request.quickCheckHaveStuff();
    simpleRequest = request.init(index);
  }
  catch (VcsException e) {
    Messages.showWarningDialog(e.getMessage(), "Show Diff");
    LOG.info(e);
    return;
  }

  if (simpleRequest != null) {
    final DiffNavigationContext navigationContext = context.getDiffNavigationContext();
    if (navigationContext != null) {
      simpleRequest.passForDataContext(DiffTool.SCROLL_TO_LINE, navigationContext);
    }
    tool.show(simpleRequest);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ShowDiffAction.java

示例4: rollbackChanges

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void rollbackChanges(final Project project, final Collection<Change> changes, boolean refreshSynchronously,
                                   final Runnable afterVcsRefreshInAwt) {
  final ChangeListManagerEx manager = (ChangeListManagerEx) ChangeListManager.getInstance(project);

  if (changes.isEmpty()) {
    String operationName = UIUtil.removeMnemonic(RollbackUtil.getRollbackOperationName(project));
    Messages.showWarningDialog(project, VcsBundle.message("commit.dialog.no.changes.detected.text"),
                               VcsBundle.message("changes.action.rollback.nothing", operationName));
    return;
  }

  final ArrayList<Change> validChanges = new ArrayList<Change>();
  final Set<LocalChangeList> lists = new THashSet<LocalChangeList>();
  lists.addAll(manager.getInvolvedListsFilterChanges(changes, validChanges));

  new RollbackChangesDialog(project, ContainerUtil.newArrayList(lists), validChanges, refreshSynchronously, afterVcsRefreshInAwt).show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:RollbackChangesDialog.java

示例5: doAction

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
protected void doAction() {
  if (myParametersTable != null) {
    TableUtil.stopEditing(myParametersTable);
  }
  String message = validateAndCommitData();
  if (message != null) {
    if (message != EXIT_SILENTLY) {
      CommonRefactoringUtil.showErrorMessage(getTitle(), message, getHelpId(), myProject);
    }
    return;
  }
  if (myMethodsToPropagateParameters != null && !mayPropagateParameters()) {
    Messages.showWarningDialog(myProject, RefactoringBundle.message("changeSignature.parameters.wont.propagate"),
                               ChangeSignatureHandler.REFACTORING_NAME);
    myMethodsToPropagateParameters = null;
  }

  myDisposed = true;
  invokeRefactoring(createRefactoringProcessor());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ChangeSignatureDialogBase.java

示例6: consume

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void consume(@Nullable ProjectSettingsStepBase base) {
  if (base == null) return;
  final DirectoryProjectGenerator generator = base.getProjectGenerator();
  final NullableConsumer<ProjectSettingsStepBase> callback = new GenerateProjectCallback();
  if (generator instanceof PythonProjectGenerator && base instanceof ProjectSpecificSettingsStep) {
    final BooleanFunction<PythonProjectGenerator> beforeProjectGenerated = ((PythonProjectGenerator)generator).
      beforeProjectGenerated(((ProjectSpecificSettingsStep)base).getSdk());
    if (beforeProjectGenerated != null) {
      final boolean result = beforeProjectGenerated.fun((PythonProjectGenerator)generator);
      if (result) {
        callback.consume(base);
      }
      else {
        Messages.showWarningDialog("Project can not be generated", "Error in Project Generation");
      }
    }
    else {
      callback.consume(base);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:PyCharmNewProjectStep.java

示例7: isCurrentSchemeValid

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static boolean isCurrentSchemeValid(Project project, FileTemplateSource fileTemplateSource) {
    switch (fileTemplateSource) {
        case PROJECT_ONLY:
        case PROJECT_PRIORITY:
        case DEFAULT_PRIORITY:
            if (FileTemplateHelper.isDefaultScheme(project)) {
                Messages.showWarningDialog(project, Localizer.get("warning.SwitchToProjectScheme"), "Warning Dialog");
                return false;
            }
    }

    return true;
}
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:14,代码来源:FileTemplateHelper.java

示例8: addFavourite

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void addFavourite(String path) {
    if(isDuplicateFavourite(path)){
        Messages.showWarningDialog(Localizer.get("warning.FavouriteAlreadyExists"), "WarningDialog");
        return;
    }

    SaveUtil.editor()
            .addFavourite(new Favourite(path, SaveUtil.reader().getListFavourite().size()))
            .save();

    view.updateFavouritesUI();
}
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:14,代码来源:SelectPackageTemplatePresenterImpl.java

示例9: invokeRefactoring

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
protected void invokeRefactoring(final BaseRefactoringProcessor processor) {
  if (myMethodsToPropagateExceptions != null && !mayPropagateExceptions()) {
    Messages.showWarningDialog(myProject, RefactoringBundle.message("changeSignature.exceptions.wont.propagate"), REFACTORING_NAME);
    myMethodsToPropagateExceptions = null;
  }
  super.invokeRefactoring(processor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaChangeSignatureDialog.java

示例10: showBinaryDiff

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void showBinaryDiff(Project project, Change change) {
  try {
    final SimpleDiffRequest request = createBinaryDiffRequest(project, change);
    if (DiffManager.getInstance().getDiffTool().canShow(request)) {
      DiffManager.getInstance().getDiffTool().show(request);
    }
  }
  catch (VcsException e) {
    Messages.showWarningDialog(e.getMessage(), "Show Diff");
    LOG.info(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ShowDiffAction.java

示例11: updateFields

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void updateFields(boolean initial) {
  if (!initial && myBranchFrom.getItemCount() == 0 && myCreateBranch.isSelected()) {
    Messages.showWarningDialog(myPanel, "Can't create branch if no commit exists.\nCreate a commit first.", "Cannot Create Branch");
    myCreateBranch.setSelected(false);
  }
  myBranchName.setEnabled(myCreateBranch.isSelected());
  myFromLabel.setEnabled(myCreateBranch.isSelected());
  myBranchFrom.setEnabled(myCreateBranch.isSelected());
  myChangelistName.setEnabled(myCreateChangelist.isSelected());
  myTaskStateCombo.setEnabled(myUpdateState.isSelected());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:OpenTaskDialog.java

示例12: testConnection

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
/**
 * Test availability of the connection
 */
private void testConnection() {
  final String executable = getCurrentExecutablePath();
  if (myAppSettings != null) {
    myAppSettings.setPathToGit(executable);
  }
  GitVersion version;
  try {
    version = ProgressManager.getInstance().runProcessWithProgressSynchronously(new ThrowableComputable<GitVersion, Exception>() {
      @Override
      public GitVersion compute() throws Exception {
        return GitVersion.identifyVersion(executable);
      }
    }, "Testing Git Executable...", true, myVcs.getProject());
  }
  catch (ProcessCanceledException pce) {
    return;
  }
  catch (Exception e) {
    Messages.showErrorDialog(myRootPanel, e.getMessage(), GitBundle.getString("find.git.error.title"));
    return;
  }

  if (version.isSupported()) {
    Messages.showInfoMessage(myRootPanel,
                             String.format("<html>%s<br>Git version is %s</html>", GitBundle.getString("find.git.success.title"),
                                           version.toString()),
                             GitBundle.getString("find.git.success.title"));
  } else {
    Messages.showWarningDialog(myRootPanel, GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN),
                               GitBundle.getString("find.git.success.title"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GitVcsPanel.java

示例13: showWarningDialog

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void showWarningDialog(@Nullable Component parent, String message, @NotNull String title) {
  if (parent != null) Messages.showWarningDialog(parent, message, title);
  else showWarningDialog(message, title);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MessagesEx.java

示例14: showWarningDialog

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void showWarningDialog(@Nullable Project project, @NotNull String title, @NotNull String message) {
  LOG.info(title + "; " + message);
  Messages.showWarningDialog(project, message, title);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GithubNotifications.java

示例15: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent event) {
  final DataContext dataContext = event.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    return;
  }
  final VirtualFile[] contextFiles = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);
  if (contextFiles == null || contextFiles.length == 0) {
    return;
  }
  final AntConfiguration antConfiguration = AntConfiguration.getInstance(project);

  final Set<VirtualFile> files = new HashSet<VirtualFile>();
  files.addAll(Arrays.asList(contextFiles));
  for (AntBuildFile buildFile : antConfiguration.getBuildFiles()) {
    files.remove(buildFile.getVirtualFile());
  }
  
  int filesAdded = 0;
  final StringBuilder errors = new StringBuilder();

  for (VirtualFile file : files) {
    try {
      antConfiguration.addBuildFile(file);
      filesAdded++;
    }
    catch (AntNoFileException e) {
      String message = e.getMessage();
      if (message == null || message.length() == 0) {
        message = AntBundle.message("cannot.add.build.files.from.excluded.directories.error.message", e.getFile().getPresentableUrl());
      }
      if (errors.length() > 0) {
        errors.append("\n");
      }
      errors.append(message);
    }
  }

  if (errors.length() > 0) {
    Messages.showWarningDialog(project, errors.toString(), AntBundle.message("cannot.add.build.file.dialog.title"));
  }
  if (filesAdded > 0) {
    ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.ANT_BUILD).activate(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:AddAntBuildFile.java


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