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


Java Messages.showInfoMessage方法代码示例

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


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

示例1: createDirectory

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static PsiDirectory createDirectory(Project project, String title, String description) {
    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
    descriptor.setTitle(title);
    descriptor.setShowFileSystemRoots(false);
    descriptor.setDescription(description);
    descriptor.setHideIgnored(true);
    descriptor.setRoots(project.getBaseDir());
    descriptor.setForcedToUseIdeaFileChooser(true);
    VirtualFile file = FileChooser.chooseFile(descriptor, project, project.getBaseDir());
    if(Objects.isNull(file)){
        Messages.showInfoMessage("Cancel " + title, "Error");
        return null;
    }

    PsiDirectory psiDirectory = PsiDirectoryFactory.getInstance(project).createDirectory(file);
    if(PsiDirectoryFactory.getInstance(project).isPackage(psiDirectory)){
        return psiDirectory;
    }else {
        Messages.showInfoMessage("请选择正确的 package 路径。", "Error");
        return createDirectory(project, title, description);
    }
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:23,代码来源:PsiUtil.java

示例2: run

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public boolean run() {
    String filter = arguments.getFilter();
    if (filter == null) {
        System.err.println("Please check your filter!");
        return false;
    }

    String replacement = Matcher.quoteReplacement(File.separator);
    String searchString = Pattern.quote(".");
    filterAsPath = filter.replaceAll(searchString, replacement);
    File projectFolder = getProjectFolder();
    if (projectFolder.exists()) {
        traverseSmaliCode(projectFolder);
        return true;
    } else if (isInstantRunEnabled()) {
        System.err.println("Enabled Instant Run feature detected. We cannot decompile it. Please, disable Instant Run and rebuild your app.");
        Messages.showInfoMessage(Strings.ERROR_INSTANT_RUN_ENABLED, Strings.TITLE_ERROR_INSTANT_RUN_ENABLED);
    } else {
        System.err.println("Smali folder cannot be absent!");
    }
    return false;
}
 
开发者ID:kaygisiz,项目名称:Dependency-Injection-Graph,代码行数:23,代码来源:SmaliAnalyzer.java

示例3: refreshFile

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void refreshFile(@NotNull final StudyState studyState, @NotNull final Project project) {
  final Editor editor = studyState.getEditor();
  final TaskFile taskFile = studyState.getTaskFile();
  if (!resetTaskFile(editor.getDocument(), project, taskFile, studyState.getVirtualFile().getName())) {
    Messages.showInfoMessage("The initial text of task file is unavailable", "Failed to Refresh Task File");
    return;
  }
  WolfTheProblemSolver.getInstance(project).clearProblems(studyState.getVirtualFile());
  taskFile.setHighlightErrors(false);
  StudyUtils.drawAllWindows(editor, taskFile);
  EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile, true);
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      IdeFocusManager.getInstance(project).requestFocus(editor.getContentComponent(), true);
    }
  });

  StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
  showBalloon(project, "You can start again now", MessageType.INFO);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:StudyRefreshTaskFileAction.java

示例4: showError

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void showError(final Project project, final String message, final boolean error) {
  final Application application = ApplicationManager.getApplication();
  if (application.isUnitTestMode()) {
    return;
  }
  final String title = VcsBundle.message("patch.apply.dialog.title");
  final Runnable messageShower = new Runnable() {
    @Override
    public void run() {
      if (error) {
        Messages.showErrorDialog(project, message, title);
      }
      else {
        Messages.showInfoMessage(project, message, title);
      }
    }
  };
  WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {
      @Override
      public void run() {
        messageShower.run();
      }
    }, null, project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PatchApplier.java

示例5: importWithExtensions

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Nullable
private static AddModuleWizard importWithExtensions(@NotNull VirtualFile file) {
  List<ProjectImportProvider> available = getImportProvidersForTarget(file);
  if (available.isEmpty()) {
    Messages.showInfoMessage((Project) null, "Cannot import anything from " + file.getPath(), "Cannot Import");
    return null;
  }
  String path;
  if (available.size() == 1) {
    path = available.get(0).getPathToBeImported(file);
  }
  else {
    path = ProjectImportProvider.getDefaultPath(file);
  }

  ProjectImportProvider[] availableProviders = available.toArray(new ProjectImportProvider[available.size()]);
  return new AddModuleWizard(null, path, availableProviders);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AndroidImportProjectAction.java

示例6: doConnDB

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void doConnDB (){
    if(isConnect){
        Messages.showInfoMessage("数据库已经连接,无需再次登录", "数据库连接");
        //JOptionPane.showMessageDialog(null, "数据库已经连接,无需再次登录", "数据库连接", JOptionPane.INFORMATION_MESSAGE);
        return;
    }
    String tmpIp = ipText.getText();
    String tmpPort = portText.getText();
    String tmpSchema = schemaText.getText();
    String tmpDBUrl = tmpIp + ":" + tmpPort + "/" + tmpSchema;
    String tmpDBUser = userNameText.getText();
    String tmpDBPasswrd = passwordText.getText();
    DatabaseConnection dbc=new DatabaseConnection(tmpDBUser,tmpDBPasswrd,tmpDBUrl);
    connButton.setEnabled(false);
    if(dbc.testDBConn()) {
        connButton.setText("Dis Conn");
        isConnect = true;
        doEnable(!isConnect);
        listDBTable.setModel(new DefaultComboBoxModel(getTableInfo(tmpSchema, tmpDBUser, tmpDBPasswrd, tmpDBUrl)));
        setDBConfig(tmpIp,tmpPort,tmpSchema,tmpDBUser,tmpDBPasswrd);
    }else {
        Messages.showErrorDialog("数据库连接失败", "数据库连接");
        //JOptionPane.showMessageDialog(null, "数据库连接失败", "数据库连接", JOptionPane.WARNING_MESSAGE);
    }
    connButton.setEnabled(true);

}
 
开发者ID:zeng198821,项目名称:CodeGenerate,代码行数:28,代码来源:GridMain.java

示例7: submit

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
    @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
  log(events, additionalInfo);
  consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
  Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
  return true;
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:9,代码来源:RollbarErrorReportSubmitter.java

示例8: testConnectionButton

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void testConnectionButton(ActionEvent evt) {
    try {
        String[] hostParts = getDatabaseHost().split(";");
        String[] databaseParts = getDatabaseDB().split(";");
        String[] usernameParts = getDatabaseUsername().split(";");
        String[] passwordParts = getDatabasePassword().split(";");
        for (int i = 0; i < hostParts.length; i++) {
            String connUrl;
            if (getDatabaseType().equals(DatabaseAdapterType.POSTGRESQL)) {
                Class.forName("org.postgresql.Driver");
                connUrl = "jdbc:postgresql://" + hostParts[i] + ":" + getDatabasePort() + "/" + databaseParts[i];
            } else if (getDatabaseType().equals(DatabaseAdapterType.MYSQL)) {
                Class.forName("com.mysql.cj.jdbc.Driver");
                connUrl = "jdbc:mysql://" + hostParts[i] + ":" + getDatabasePort() + "/" + databaseParts[i];
            } else {
                throw new UnsupportedOperationException();
            }

            Connection connection = DriverManager.getConnection(connUrl, usernameParts[i], passwordParts[i]);
            connection.close();
            System.out.println("Valid connection settings for database: " + databaseParts[i] + " (Host: " + hostParts[i] + ")");
        }
        Messages.showInfoMessage("Valid connection established!", "Valid Database Connection");
    } catch (Exception ex) {
        Messages.showErrorDialog("Invalid connection!\nReason: " + ex.getMessage(), "Invalid Database Connection");
    }
}
 
开发者ID:BFergerson,项目名称:JNomad-Plugin,代码行数:28,代码来源:JNomadConfigurationPanel.java

示例9: doMove

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void doMove(final Project project,
                   PsiElement[] elements,
                   @Nullable PsiElement targetContainer,
                   @Nullable MoveCallback callback) {
  Messages.showInfoMessage("This move operation can break the course", "Invalid Move Operation");
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:8,代码来源:StudyMoveDelegate.java

示例10: refreshFile

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void refreshFile(@NotNull final StudyState studyState, @NotNull final Project project) {
  final Editor editor = studyState.getEditor();
  final TaskFile taskFile = studyState.getTaskFile();
  final Task task = taskFile.getTask();
  if (task instanceof TaskWithSubtasks) {
    for (AnswerPlaceholder placeholder : taskFile.getActivePlaceholders()) {
      StudySubtaskUtils.refreshPlaceholder(editor, placeholder);
    }
  }
  else {
    if (!resetTaskFile(editor.getDocument(), project, taskFile)) {
      Messages.showInfoMessage("The initial text of task file is unavailable", "Failed to Refresh Task File");
      return;
    }
    if (task instanceof ChoiceTask) {
      final StudyToolWindow window = StudyUtils.getStudyToolWindow(project);
      if (window != null) {
        window.setBottomComponent(new StudyChoiceVariantsPanel((ChoiceTask)task));
      }
    }
  }
  WolfTheProblemSolver.getInstance(project).clearProblems(studyState.getVirtualFile());
  taskFile.setHighlightErrors(false);
  StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
  EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile);
  ApplicationManager.getApplication().invokeLater(
    () -> IdeFocusManager.getInstance(project).requestFocus(editor.getContentComponent(), true));

  StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
  showBalloon(project, MessageType.INFO);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:32,代码来源:StudyRefreshTaskFileAction.java

示例11: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    Project project = anActionEvent.getProject();
    if (project != null) {

        pathHelper = new PathHelper(project);

        if (new File(pathHelper.getAnalyzedJsFile()).exists()) {
            openBrowser();
        } else {
            Messages.showInfoMessage(Strings.ERROR_SHOW_GENERATED_DEPENDENCIES, Strings.TITLE_ERROR_SHOW_GENERATED_DEPENDENCIES);
        }

    }
}
 
开发者ID:kaygisiz,项目名称:Dependency-Injection-Graph,代码行数:16,代码来源:ShowGeneratedDependencies.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: submit

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
                      @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
    EventBuilder eventBuilder = createEvent(events, additionalInfo);
    sentry.sendEvent(eventBuilder);
    consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
    Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
    return true;
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:10,代码来源:SentryBugReporter.java

示例14: preprocessUsages

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
  if (refUsages.get().length == 0) {
    Messages.showInfoMessage(myProject, RefactoringBundle.message("migration.no.usages.found.in.the.project"), REFACTORING_NAME);
    return false;
  }
  setPreviewUsages(true);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MigrationProcessor.java

示例15: preprocessUsages

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
  if (!ApplicationManager.getApplication().isUnitTestMode() && refUsages.get().length == 0) {
    String message = RefactoringBundle.message("no.usages.can.be.replaced", myClass.getQualifiedName(), mySuper.getQualifiedName());
    Messages.showInfoMessage(myProject, message, TurnRefsToSuperHandler.REFACTORING_NAME);
    return false;
  }

  return super.preprocessUsages(refUsages);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TurnRefsToSuperProcessor.java


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