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


Java Messages类代码示例

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


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

示例1: actionPerformed

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

    if (project != null) {

        String packageName = Messages.showInputDialog(
                Strings.MESSAGE_ASK_PACKAGE_NAME_TO_FILTER,
                Strings.TITLE_ASK_PACKAGE_NAME_TO_FILTER,
                Messages.getQuestionIcon(),
                PropertiesManager.getData(project, PropertyKeys.PACKAGE_NAME),
                new NonEmptyInputValidator());

        if (!TextUtils.isEmpty(packageName)) {
            PropertiesManager.putData(project, PropertyKeys.PACKAGE_NAME, packageName);
        }
    }
}
 
开发者ID:kaygisiz,项目名称:Dependency-Injection-Graph,代码行数:19,代码来源:SetPackageFilter.java

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

示例3: TemplateEditPane

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
public TemplateEditPane(CodeMakerSettings settings, String template,
                        CodeMakerConfiguration parentPane) {
    CodeTemplate codeTemplate = settings.getCodeTemplate(template);
    if (codeTemplate == null) {
        codeTemplate = CodeTemplate.EMPTY_TEMPLATE;
    }

    templateNameText.setText(codeTemplate.getName());
    classNumberText.setText(String.valueOf(codeTemplate.getClassNumber()));
    classNameText.setText(codeTemplate.getClassNameVm());
    addVmEditor(codeTemplate.getCodeTemplate());
    deleteTemplateButton.addActionListener(e -> {
        int result = Messages.showYesNoDialog("删除模板?", "删除", null);
        if (result == Messages.OK) {
            settings.removeCodeTemplate(template);
            parentPane.refresh(settings);
        }
    });
}
 
开发者ID:zeng198821,项目名称:CodeGenerate,代码行数:20,代码来源:TemplateEditPane.java

示例4: send

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
public static void send()
{
    SourcetrailOptions options = SourcetrailOptions.getInstance();
    try
    {
        String text = "ping>>" + ApplicationNamesInfo.getInstance().getFullProductName() + "<EOM>";
        Socket socket = new Socket(options.getIp(), options.getSourcetrailPort());
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        writer.write(text);
        writer.flush();
        socket.close();
    }
    catch(Exception e)
    {
        String errorMsg =
                "No connection to a Sourcetrail instance\n\n Make sure Sourcetrail is running and the right address is used("
                        + options.getIp() + ":" + options.getSourcetrailPort() + ")";
        Messages.showMessageDialog(errorMsg, "SourcetrailPluginError", Messages.getErrorIcon());
        e.printStackTrace();

    }

}
 
开发者ID:CoatiSoftware,项目名称:idea-sourcetrail,代码行数:24,代码来源:Ping.java

示例5: actionPerformed

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

    final Project project = getEventProject(event);
    if (project == null) {
        this.setStatus(event, false);
        return;
    }

    PsiDirectory bundleDirContext = ExtensionUtility.getExtensionDirectory(event);
    if (bundleDirContext == null) {
        return;
    }

    String className = Messages.showInputDialog(project, "New class name:", "New File", TYPO3CMSIcons.TYPO3_ICON);
    if (StringUtils.isBlank(className)) {
        return;
    }

    if (!PhpNameUtil.isValidClassName(className)) {
        JOptionPane.showMessageDialog(null, "Invalid class name");
        return;
    }

    write(project, bundleDirContext, className);
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:27,代码来源:NewExtensionFileAction.java

示例6: actionPerformed

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
    this.project = e.getData(CommonDataKeys.PROJECT);

    String description = this.showInputDialog(SlackChannel.getIdDescription(), null);

    if (!isValidField(description)) {
        errorMessage();
        return;
    }

    String token = this.showInputDialog(SlackChannel.getTokenDescription(), null);

    if (!isValidField(token)) {
        errorMessage();
        return;
    }

    String channel = this.showInputDialog(SlackChannel.getChanneNameDescription(), "");

    SlackStorage.getInstance().registerChannel(new SlackChannel(token, description, channel));
    Messages.showMessageDialog(this.project, "Settings Saved.", "Information", Messages.getInformationIcon());
}
 
开发者ID:chakki-works,项目名称:watchMe,代码行数:23,代码来源:SlackSettings.java

示例7: actionPerformed

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    cacheFile = new File(Constant.CACHE_PATH);
    if (!cacheFile.exists()) {
        cacheFile.mkdirs();
    }
    long size = FileUtils.sizeOfDirectory(cacheFile);
    DialogBuilder builder = new DialogBuilder();
    builder.setTitle(Constant.TITLE);
    builder.resizable(false);
    builder.setCenterPanel(new JLabel(String.format("Currently occupy storage %.2fM, "
            + "Clean Cache immediately?", size/1024.0/1024.0),
            Messages.getInformationIcon(), SwingConstants.CENTER));
    builder.addOkAction().setText("Clean Now");
    builder.addCancelAction().setText("Cancel");
    builder.setButtonsAlignment(SwingConstants.RIGHT);
    if (builder.show() == 0) {
        clean();
    }
}
 
开发者ID:pengwei1024,项目名称:AndroidSourceViewer,代码行数:21,代码来源:CleanAction.java

示例8: shouldContinue

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
@Override
public boolean shouldContinue(final List<File> t) {
    if (!t.isEmpty()) {
        ApplicationManager.getApplication().invokeLater(new Runnable() {

            @Override
            public void run() {
                Messages.showErrorDialog(
                    HybrisI18NBundleUtils.message("hybris.project.import.scan.failed", t),
                    HybrisI18NBundleUtils.message("hybris.project.error")
                );
            }
        });
    }

    return false;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:18,代码来源:DirectoriesScannerErrorsProcessor.java

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

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

示例11: actionPerformed

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  final IdeView view = e.getData(LangDataKeys.IDE_VIEW);
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (view == null || project == null) {
    return;
  }
  final String courseId = Messages.showInputDialog("Please, enter course id", "Get Course From Stepik", null);
  if (StringUtil.isNotEmpty(courseId)) {
    ProgressManager.getInstance().run(new Task.Modal(project, "Creating Course", true) {
      @Override
      public void run(@NotNull final ProgressIndicator indicator) {
        createCourse(project, courseId);
      }
    });
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:18,代码来源:CCGetCourseFromStepic.java

示例12: packCourse

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
private static void packCourse(@NotNull final VirtualFile baseDir, String locationDir, String zipName, boolean showMessage) {
  try {
    final File zipFile = new File(locationDir, zipName + ".zip");
    ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
    VirtualFile[] courseFiles = baseDir.getChildren();
    for (VirtualFile file : courseFiles) {
      ZipUtil.addFileOrDirRecursively(zos, null, new File(file.getPath()), file.getName(), null, null);
    }
    zos.close();
    if (showMessage) {
      ApplicationManager.getApplication().invokeLater(
        () -> Messages.showInfoMessage("Course archive was saved to " + zipFile.getPath(),
                                       "Course Archive Was Created Successfully"));

    }
  }
  catch (IOException e1) {
    LOG.error(e1);
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:21,代码来源:CCCreateCourseArchive.java

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

示例14: doSearch

import com.intellij.openapi.ui.Messages; //导入依赖的package包/类
private void doSearch(String keyword, AnActionEvent actionEvent) {
    getRepositories(keyword)
            .thenAcceptAsync(mavenSearchResponse -> {
                        SwingUtilities.invokeLater(() -> {
                            if (!mavenSearchResponse.getBody().getNumFound().equals("0")) {
                                SelectFromListDialog dialog = initSelectFromListDialog(actionEvent.getProject(), Strings.TITLE_SELECT_REPOSITORY, ArrayHelper.docListToStringArray(mavenSearchResponse.getBody().getDocList()), toStringAspect);
                                boolean isOk = dialog.showAndGet();
                                if (isOk) {
                                    gradleManager.addDependency(String.valueOf(dialog.getSelection()[0]), actionEvent);
                                }
                            } else if (mavenSearchResponse.getSpellcheck().getSuggestion().size() > 0) {
                                Messages.showInfoMessage(Strings.MESSAGE_SUGGESTIONS + String.join(",", ArrayHelper.objectListToStringArray(mavenSearchResponse.getSpellcheck().getSuggestion())), Strings.TITLE_NOT_FOUND);
                            } else {
                                Messages.showInfoMessage("", Strings.TITLE_NOT_FOUND);
                            }
                        });
                    }
            ).exceptionally(throwable -> {
        SwingUtilities.invokeLater(() -> {
            Messages.showInfoMessage(throwable.getMessage(), Strings.ERROR_TITLE_MAVEN_SEARCH);
        });

        return null;
    });
}
 
开发者ID:kaygisiz,项目名称:Gradle-External-Library-Helper,代码行数:26,代码来源:SearchAction.java

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


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