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


Java Messages.showErrorDialog方法代码示例

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


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

示例1: unpackCourseArchive

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void unpackCourseArchive(final Project project) {
  FileChooserDescriptor descriptor =
    new FileChooserDescriptor(true, true, true, true, true, false);

  final VirtualFile virtualFile = FileChooser.chooseFile(descriptor, project, null);
  if (virtualFile == null) {
    return;
  }
  final String basePath = project.getBasePath();
  if (basePath == null) return;

  Course course = StudyProjectGenerator.getCourse(virtualFile.getPath());
  if (course == null) {
    Messages.showErrorDialog("This course is incompatible with current version", "Failed to Unpack Course");
    return;
  }
  generateFromStudentCourse(project, course);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:19,代码来源:CCFromCourseArchive.java

示例2: actionPerformed

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

    if (project == null) {
        return;
    }
    removeOldProjectData(project);

    try {
        collectStatistics();
        final AddModuleWizard wizard = getWizard(project);
        final ProjectBuilder projectBuilder = wizard.getProjectBuilder();

        if (projectBuilder instanceof AbstractHybrisProjectImportBuilder) {
            ((AbstractHybrisProjectImportBuilder) projectBuilder).setRefresh(true);
        }
        projectBuilder.commit(project, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
    } catch (ConfigurationException e) {
        Messages.showErrorDialog(
            anActionEvent.getProject(),
            e.getMessage(),
            HybrisI18NBundleUtils.message("hybris.project.import.error.unable.to.proceed")
        );
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:ProjectRefreshAction.java

示例3: generateJson

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
private static void generateJson(VirtualFile parentDir, Course course) {
  final Gson gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().
    registerTypeAdapter(Task.class, new StudySerializationUtils.Json.TaskAdapter()).create();
  final String json = gson.toJson(course);
  final File courseJson = new File(parentDir.getPath(), EduNames.COURSE_META_FILE);
  OutputStreamWriter outputStreamWriter = null;
  try {
    outputStreamWriter = new OutputStreamWriter(new FileOutputStream(courseJson), "UTF-8");
    outputStreamWriter.write(json);
  }
  catch (Exception e) {
    Messages.showErrorDialog(e.getMessage(), "Failed to Generate Json");
    LOG.info(e);
  }
  finally {
    try {
      if (outputStreamWriter != null) {
        outputStreamWriter.close();
      }
    }
    catch (IOException e1) {
      //close silently
    }
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:27,代码来源:CCCreateCourseArchive.java

示例4: execute

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
protected void execute(@NotNull Project project) {
  File projectDirPath = getBaseDirPath(project);
  try {
    createGradleWrapper(projectDirPath);
    GradleProjectSettings settings = getGradleProjectSettings(project);
    if (settings != null) {
      settings.setDistributionType(DEFAULT_WRAPPED);
    }
    GradleProjectImporter.getInstance().requestProjectSync(project, null);
  }
  catch (IOException e) {
    // Unlikely to happen.
    Messages.showErrorDialog(project, "Failed to create Gradle wrapper: " + e.getMessage(), "Quick Fix");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CreateGradleWrapperHyperlink.java

示例5: fixLanguageSupport

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void fixLanguageSupport(Project project, boolean removeWorkspaceType) {
  ProjectViewEdit edit =
      ProjectViewEdit.editLocalProjectView(
          project,
          builder -> {
            if (removeWorkspaceType) {
              removePythonWorkspaceType(builder);
            }
            removeFromAdditionalLanguages(builder);
            return true;
          });
  if (edit == null) {
    Messages.showErrorDialog(
        "Could not modify project view. Check for errors in your project view and try again",
        "Error");
    return;
  }
  edit.apply();

  BlazeSyncManager.getInstance(project)
      .requestProjectSync(
          new BlazeSyncParams.Builder("Sync", BlazeSyncParams.SyncMode.INCREMENTAL)
              .addProjectViewTargets(true)
              .addWorkingSet(BlazeUserSettings.getInstance().getExpandSyncToWorkingSet())
              .build());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:27,代码来源:BlazePythonSyncPlugin.java

示例6: saveAndroidNdkPath

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void saveAndroidNdkPath() {
  if(myProject == null || myProject.isDefault()) {
    return;
  }

  try {
    LocalProperties localProperties = new LocalProperties(myProject);
    localProperties.setAndroidNdkPath(getNdkLocation());
    localProperties.save();
  }
  catch (IOException e) {
    LOG.info(String.format("Unable to update local.properties file in project '%1$s'.", myProject.getName()), e);
    String cause = e.getMessage();
    if (isNullOrEmpty(cause)) {
      cause = "[Unknown]";
    }
    String msg = String.format("Unable to update local.properties file in project '%1$s'.\n\n" +
                               "Cause: %2$s\n\n" +
                               "Please manually update the file's '%3$s' property value to \n" +
                               "'%4$s'\n" +
                               "and sync the project with Gradle files.", myProject.getName(), cause,
                               NDK_DIR_PROPERTY, getNdkLocation().getPath());
    Messages.showErrorDialog(myProject, msg, "Android Ndk Update");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DefaultSdksConfigurable.java

示例7: show

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public static void show(@Nullable final Project project,
                        @NotNull final MergeRequest request) {
  try {
    if (canShow(request)) {
      showRequest(project, request);
    }
    else {
      DiffManagerEx.getInstance().showMergeBuiltin(project, request);
    }
  }
  catch (ProcessCanceledException ignore) {
  }
  catch (Throwable e) {
    LOG.error(e);
    Messages.showErrorDialog(project, e.getMessage(), "Can't Show Merge In External Tool");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ExternalMergeTool.java

示例8: chooseLibraryAndDownload

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Nullable
public static NewLibraryConfiguration chooseLibraryAndDownload(final @NotNull Project project,
                                                               final @Nullable String initialFilter,
                                                               JComponent parentComponent) {
  RepositoryAttachDialog dialog = new RepositoryAttachDialog(project, initialFilter);
  dialog.setTitle("Download Library From Maven Repository");
  dialog.show();
  if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
    return null;
  }

  String copyTo = dialog.getDirectoryPath();
  String coord = dialog.getCoordinateText();
  boolean attachJavaDoc = dialog.getAttachJavaDoc();
  boolean attachSources = dialog.getAttachSources();
  List<MavenRepositoryInfo> repositories = dialog.getRepositories();
  NewLibraryConfiguration configuration = resolveAndDownload(project, coord, attachJavaDoc, attachSources, copyTo, repositories);
  if (configuration == null) {
    Messages.showErrorDialog(parentComponent, ProjectBundle.message("maven.downloading.failed", coord), CommonBundle.getErrorTitle());
  }
  return configuration;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:RepositoryAttachHandler.java

示例9: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);

  final T checker = createChecker();
  checker.execute(e);

  if (! checker.isValid()) {
    Messages.showErrorDialog(SvnBundle.message("action.Subversion.integrate.changes.error.no.available.files.text"),
                             SvnBundle.message("action.Subversion.integrate.changes.messages.title"));
    return;
  }

  final SvnIntegrateChangesActionPerformer changesActionPerformer =
    new SvnIntegrateChangesActionPerformer(project, checker.getSameBranch(), createMergerFactory(checker));

  final String selectedBranchUrl = getSelectedBranchUrl(checker);
  if (selectedBranchUrl == null) {
    SelectBranchPopup.showForBranchRoot(project, checker.getRoot(), changesActionPerformer,
                                        SvnBundle.message("action.Subversion.integrate.changes.select.branch.text"));
  } else {
    changesActionPerformer.onBranchSelected(selectedBranchUrl, getSelectedBranchLocalPath(checker), getDialogTitle());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AbstractIntegrateChangesAction.java

示例10: createRefactoringProcessor

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
protected BaseRefactoringProcessor createRefactoringProcessor(Project project,
                                                              PsiDirectory directory,
                                                              PsiPackage aPackage,
                                                              boolean searchInComments,
                                                              boolean searchForTextOccurences) {
  final VirtualFile sourceRoot = ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(directory.getVirtualFile());
  if (sourceRoot == null) {
    Messages.showErrorDialog(project, RefactoringBundle.message("destination.directory.does.not.correspond.to.any.package"),
                             RefactoringBundle.message("cannot.move"));
    return null;
  }
  final JavaRefactoringFactory factory = JavaRefactoringFactory.getInstance(project);
  final MoveDestination destination = myPreserveSourceRoot.isSelected() && myPreserveSourceRoot.isVisible()
                                      ? factory.createSourceFolderPreservingMoveDestination(aPackage.getQualifiedName())
                                      : factory.createSourceRootMoveDestination(aPackage.getQualifiedName(), sourceRoot);

  MoveClassesOrPackagesProcessor processor = createMoveClassesOrPackagesProcessor(myDirectory.getProject(), myElementsToMove, destination,
      searchInComments, searchForTextOccurences, myMoveCallback);
  
  processor.setOpenInEditor(isOpenInEditor());
  if (processor.verifyValidPackageName()) {
    return processor;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:MoveClassesOrPackagesToNewDirectoryDialog.java

示例11: 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

示例12: generateProject

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @NotNull GithubTagInfo tag, @NotNull Module module) {
    super.generateProject(project, baseDir, tag, module);

    try {
        ActionRunner.runInsideWriteAction(() -> {
            final VirtualFile extDir = VfsUtil.createDirectoryIfMissing(baseDir, "typo3conf/ext");
        });

    } catch (Exception e) {
        Messages.showErrorDialog("There was an error when trying to create additional project files", "Error Creating Additional Files");
    }
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:14,代码来源:TYPO3CMSClassicLayoutDirectoryProjectGenerator.java

示例13: actionPerformed

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

    Project project = anActionEvent.getProject();
    if (project == null) {
        return;
    }

    ToolWindow toolWindow = anActionEvent.getData(PlatformDataKeys.TOOL_WINDOW);
    if (toolWindow == null) {
        return;
    }

    PsiDirectory[] psiDirectories = ActionUtil.findDirectoryFromActionEvent(anActionEvent);
    if (psiDirectories.length == 0) {
        return;
    }

    TYPO3ExtensionDefinition extensionDefinition = TYPO3ExtensionUtil.findContainingExtension(psiDirectories);
    if (extensionDefinition == null) {
        Messages.showErrorDialog(
                "Could not extract extension from working directory. Does your extension contain a composer manifest?",
                "Error While Trying to Find Extension"
        );
        return;
    }

    GenerateFscElementForm.create(toolWindow.getComponent(), project, extensionDefinition);
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:30,代码来源:GenerateFscElementAction.java

示例14: actionPerformed

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    try {
        com.intellij.openapi.actionSystem.DataContext dataContext = e.getDataContext();
        PsiJavaFile javaFile = (PsiJavaFile) ((PsiFile) DataKeys.PSI_FILE.getData(dataContext)).getContainingFile();
        String sourceName = javaFile.getName();
        Module module = (Module) DataKeys.MODULE.getData(dataContext);
        String compileRoot = CompilerModuleExtension.getInstance(module).getCompilerOutputPath().getPath();
        getVirtualFile(sourceName, CompilerModuleExtension.getInstance(module).getCompilerOutputPath().getChildren(), compileRoot);
        VirtualFileManager.getInstance().syncRefresh();
    } catch (Exception ex) {
        ex.printStackTrace();
        Messages.showErrorDialog("Please build your module or project!!!", "error");
    }
}
 
开发者ID:serical,项目名称:patcher,代码行数:16,代码来源:ClassesExportAction.java

示例15: addConnectionButton

import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private void addConnectionButton(ActionEvent evt) {
    if (getDatabaseHost().isEmpty()) {
        Messages.showErrorDialog("Missing database host!",
                "Invalid Database Connection");
        return;
    } else if (getDatabaseDB().isEmpty()) {
        Messages.showErrorDialog("Missing database!",
                "Invalid Database Connection");
        return;
    } else if (getDatabasePort() == -1) {
        Messages.showErrorDialog("Invalid database port: " + databasePortTextField.getText(),
                "Invalid Database Connection");
        return;
    }

    //save database connection to environment settings
    JNomadPluginConfiguration.DBEnvironment env = environmentList.getSelectedValue();
    JNomadPluginConfiguration.DBConnection conn = new JNomadPluginConfiguration.DBConnection();
    conn.setHost(getDatabaseHost());
    conn.setPort(getDatabasePort());
    conn.setDatabase(getDatabaseDB());
    conn.setUsername(getDatabaseUsername());
    conn.setPassword(getDatabasePassword());
    conn.setDatabaseType(getDatabaseType());
    env.getConnectionList().add(conn);
    databaseListModel.addElement(conn);

    //reset for another connection
    databaseHostTextField.setText("");
    databasePortTextField.setText("");
    databaseDBTextField.setText("");
    databaseUsernameTextField.setText("");
    databasePasswordTextField.setText("");
}
 
开发者ID:BFergerson,项目名称:JNomad-Plugin,代码行数:35,代码来源:JNomadConfigurationPanel.java


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