Package com.intellij.openapi.application

Examples of com.intellij.openapi.application.Application.runReadAction()


    public GenerationItem[] getGenerationItems(CompileContext context) {
        if (JFlex.isCompilationEnabled()) {
            Module[] affectedModules = context.getCompileScope().getAffectedModules();
            if (affectedModules.length > 0) {
                Application application = ApplicationManager.getApplication();
                return application.runReadAction(new PrepareAction(context));
            }
        }
        return EMPTY_GENERATION_ITEM_ARRAY;
    }
View Full Code Here


    public GenerationItem[] generate(CompileContext context, GenerationItem[] items, VirtualFile outputRootDirectory) {
        if (JFlex.isCompilationEnabled()) {
            if (items != null && items.length > 0) {
                Application application = ApplicationManager.getApplication();
                GenerationItem[] generationItems = application.runReadAction(new GenerateAction(context, items, outputRootDirectory, ProjectRootManager.getInstance(context.getProject()).getProjectSdk()));
                for (GenerationItem item : generationItems) {
                    CompilerUtil.refreshIOFile(((JFlexGenerationItem) item).getGeneratedFile());
                }
                return generationItems;
            }
View Full Code Here

    };
    if (application.isDispatchThread()) {
      sort.run();
    }
    else {
      application.runReadAction(sort);
    }
  }
}
View Full Code Here

      myMacroMap = new LinkedHashMap<String, String>();

      // ApplicationManager.getApplication() will return null if executed in ParameterListTest
      final Application application = ApplicationManager.getApplication();
      if (application != null) {
        application.runReadAction(new Runnable() {
          public void run() {
            final PathMacros pathMacros = PathMacros.getInstance();
            final Set<String> names = pathMacros.getAllMacroNames();
              for (String name : names) {
                  myMacroMap.put("${" + name + "}", pathMacros.getValue(name));
View Full Code Here

      if (application.isDispatchThread()) {
        final String url = moduleRootManager.getCompilerOutputPathForTestsUrl();
        outPathUrl = (url != null) ? url : moduleRootManager.getCompilerOutputPathUrl();
      }
      else {
        outPathUrl = application.runReadAction(new Computable<String>() {
          public String compute() {
            final String url = moduleRootManager.getCompilerOutputPathForTestsUrl();
            return (url != null) ? url : moduleRootManager.getCompilerOutputPathUrl();
          }
        });
View Full Code Here

    else { // for ordinary classes
      if (application.isDispatchThread()) {
        outPathUrl = moduleRootManager.getCompilerOutputPathUrl();
      }
      else {
        outPathUrl = application.runReadAction(new Computable<String>() {
          public String compute() {
            return moduleRootManager.getCompilerOutputPathUrl();
          }
        });
      }
View Full Code Here

        final Application application = ApplicationManager.getApplication();
        if (application.isDispatchThread()) {
            findThread.run();
        } else {
            application.runReadAction(findThread);
        }
    }

    public void fileStarted(final AuditEvent auditEvent) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.