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


Java DumbAwareRunnable类代码示例

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


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

示例1: projectOpened

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void projectOpened(final Project project) {
    StartupManager.getInstance(project).registerPostStartupActivity((DumbAwareRunnable) () -> {
        if (project.isDisposed()) {
            return;
        }
        if (isOldHybrisProject(project)) {
            showNotification(project);
        }
        if (isDiscountTargetGroup()) {
            showDiscountOffer(project);
        }
        final CommonIdeaService commonIdeaService = ServiceManager.getService(CommonIdeaService.class);
        if (!commonIdeaService.isHybrisProject(project)) {
            return;
        }
        if (popupPermissionToSendStatistics(project)) {
            continueOpening(project);
        }
    });
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:22,代码来源:HybrisProjectManagerListener.java

示例2: projectOpened

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void projectOpened() {
  ApplicationManager.getApplication().invokeLater((DumbAwareRunnable)() -> ApplicationManager.getApplication().runWriteAction(
    (DumbAwareRunnable)() -> {
      if (PropertiesComponent.getInstance().getBoolean(ourShowPopup, true)) {
        final String content = "<html>If you'd like to learn more about PyCharm Edu, " +
                               "click <a href=\"https://www.jetbrains.com/pycharm-edu/quickstart/\">here</a> to watch a tutorial</html>";
        final Notification notification = new Notification("Watch Tutorials!", "", content, NotificationType.INFORMATION,
                                                           new NotificationListener.UrlOpeningListener(true));
        StartupManager.getInstance(myProject).registerPostStartupActivity(() -> Notifications.Bus.notify(notification));
        Balloon balloon = notification.getBalloon();
        if (balloon != null) {
          balloon.addListener(new JBPopupAdapter() {
            @Override
            public void onClosed(LightweightWindowEvent event) {
              notification.expire();
            }
          });
        }
        notification.whenExpired(() -> PropertiesComponent.getInstance().setValue(ourShowPopup, false, true));
      }
    }));
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:24,代码来源:PyStudyShowTutorial.java

示例3: setupRootModel

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
    super.setupRootModel(rootModel);

    addListener(new ModuleBuilderListener() {
        @Override
        public void moduleCreated(@NotNull Module module) {
            setMuleFramework(module);
        }
    });

    setMuleFacet(rootModel.getModule());

    final Project project = rootModel.getProject();
    final VirtualFile root = createAndGetContentEntry();
    rootModel.addContentEntry(root);

    //Check if this is a module and has parent
    final MavenId parentId = (this.getParentProject() != null ? this.getParentProject().getMavenId() : null);

    MavenUtil.runWhenInitialized(project, (DumbAwareRunnable) () -> {
        new MuleMavenProjectBuilderHelper().configure(project, getProjectId(), muleVersion, root, parentId);
    });
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:25,代码来源:MuleMavenModuleBuilder.java

示例4: doSetText

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
private void doSetText(final CharSequence text) {
  final TokenProcessor processor = createTokenProcessor(0);
  myLexer.start(text, 0, text.length(),myInitialState);
  mySegments.removeAll();
  int i = 0;
  while (true) {
    final IElementType tokenType = myLexer.getTokenType();
    if (tokenType == null) break;

    int data = packData(tokenType, myLexer.getState());
    processor.addToken(i, myLexer.getTokenStart(), myLexer.getTokenEnd(), data, tokenType);
    i++;
    myLexer.advance();
  }
  processor.finish();

  if(myEditor != null && !ApplicationManager.getApplication().isHeadlessEnvironment()) {
    UIUtil.invokeLaterIfNeeded(new DumbAwareRunnable() {
      @Override
      public void run() {
        myEditor.repaint(0, text.length());
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:LexerEditorHighlighter.java

示例5: hierarchyChanged

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
public void hierarchyChanged(@NotNull HierarchyEvent e) {
  if (isDisposed()) return;

  if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
    final Runnable runnable = new DumbAwareRunnable() {
      public void run() {
        final Component c = myComponent.get();
        if (isDisposed() || c == null) return;

        if (c.isShowing()) {
          showNotify();
        }
        else {
          hideNotify();
        }
      }
    };
    final Application app = ApplicationManager.getApplication();
    if (app != null && app.isDispatchThread()) {
      app.invokeLater(runnable, ModalityState.current());
    } else {
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(runnable);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:UiNotifyConnector.java

示例6: loadState

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void loadState(ExternalDependenciesState state) {
  ArrayList<ProjectExternalDependency> oldDependencies = new ArrayList<ProjectExternalDependency>(myDependencies);
  myDependencies.clear();
  for (DependencyOnPluginState dependency : state.myDependencies) {
    myDependencies.add(new DependencyOnPlugin(dependency.myId, dependency.myMinVersion, dependency.myMaxVersion));
  }
  if (!oldDependencies.equals(myDependencies) && !myDependencies.isEmpty()) {
    StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new DumbAwareRunnable() {
      @Override
      public void run() {
        CheckRequiredPluginsActivity.runCheck(myProject);
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExternalDependenciesManagerImpl.java

示例7: openFileFromCommandLine

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
private static void openFileFromCommandLine(final Project project, final VirtualFile virtualFile, final int line) {
  StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable() {
    public void run() {
      ToolWindowManager.getInstance(project).invokeLater(new Runnable() {
        public void run() {
          ToolWindowManager.getInstance(project).invokeLater(new Runnable() {
            public void run() {
              if (!virtualFile.isDirectory()) {
                if (line > 0) {
                  new OpenFileDescriptor(project, virtualFile, line-1, 0).navigate(true);
                }
                else {
                  new OpenFileDescriptor(project, virtualFile).navigate(true);
                }
              }
            }
          });
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:PlatformProjectOpenProcessor.java

示例8: setProjectName

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void setProjectName(@NotNull String projectName) {
  if (!projectName.equals(myName)) {
    myOldName = myName;
    myName = projectName;
    StartupManager.getInstance(this).runWhenProjectIsInitialized(new DumbAwareRunnable() {
      @Override
      public void run() {
        if (isDisposed()) return;

        JFrame frame = WindowManager.getInstance().getFrame(ProjectImpl.this);
        String title = FrameTitleBuilder.getInstance().getProjectTitle(ProjectImpl.this);
        if (frame != null && title != null) {
          frame.setTitle(title);
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ProjectImpl.java

示例9: setupCloseAction

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
static void setupCloseAction(final JFrame frame) {
  frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  frame.addWindowListener(
    new WindowAdapter() {
      public void windowClosing(final WindowEvent e) {
        frame.dispose();

        final Application app = ApplicationManager.getApplication();
        app.invokeLater(new DumbAwareRunnable() {
          public void run() {
            if (app.isDisposed()) {
              ApplicationManagerEx.getApplicationEx().exit();
              return;
            }

            final Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
            if (openProjects.length == 0) {
              ApplicationManagerEx.getApplicationEx().exit();
            }
          }
        }, ModalityState.NON_MODAL);
      }
    }
  );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:WelcomeFrame.java

示例10: fileStatusesChanged

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void fileStatusesChanged() {
  if (myProject.isDisposed()) {
    return;
  }
  if (!ApplicationManager.getApplication().isDispatchThread()) {
    ApplicationManager.getApplication().invokeLater(new DumbAwareRunnable() {
      @Override
      public void run() {
        fileStatusesChanged();
      }
    }, ModalityState.NON_MODAL);
    return;
  }

  myCachedStatuses.clear();
  myWhetherExactlyParentToChanged.clear();

  for (FileStatusListener listener : myListeners) {
    listener.fileStatusesChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FileStatusManagerImpl.java

示例11: createAndCommitIfNeeded

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@NotNull
public Module createAndCommitIfNeeded(@NotNull Project project, @Nullable ModifiableModuleModel model, boolean runFromProjectWizard)
  throws InvalidDataException, ConfigurationException, IOException, JDOMException, ModuleWithNameAlreadyExists {
  final ModifiableModuleModel moduleModel = model != null ? model : ModuleManager.getInstance(project).getModifiableModel();
  final Module module = createModule(moduleModel);
  if (model == null) moduleModel.commit();

  if (runFromProjectWizard) {
    StartupManager.getInstance(module.getProject()).runWhenProjectIsInitialized(new DumbAwareRunnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            onModuleInitialized(module);
          }
        });
      }
    });
  }
  else {
    onModuleInitialized(module);
  }
  return module;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ModuleBuilder.java

示例12: updateBreakpointsUI

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
public void updateBreakpointsUI() {
  if (myProject.isDefault()) return;

  Runnable runnable = new DumbAwareRunnable() {
    @Override
    public void run() {
      for (XLineBreakpointImpl breakpoint : myBreakpoints.keySet()) {
        breakpoint.updateUI();
      }
    }
  };

  if (ApplicationManager.getApplication().isUnitTestMode() || myStartupManager.startupActivityPassed()) {
    runnable.run();
  }
  else {
    myStartupManager.registerPostStartupActivity(runnable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XLineBreakpointManager.java

示例13: projectOpened

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void projectOpened() {
  StartupManager.getInstance(myProject).registerPostStartupActivity(new DumbAwareRunnable() {
    @Override
    public void run() {
      if (myUpdateInfo != null && !myUpdateInfo.isEmpty() && ProjectReloadState.getInstance(myProject).isAfterAutomaticReload()) {
        ActionInfo actionInfo = myUpdateInfo.getActionInfo();
        if (actionInfo != null) {
          ProjectLevelVcsManagerEx.getInstanceEx(myProject).showUpdateProjectInfo(myUpdateInfo.getFileInformation(),
                                                                                  VcsBundle.message("action.display.name.update"), actionInfo,
                                                                                  false);
          CommittedChangesCache.getInstance(myProject).refreshIncomingChangesAsync();
        }
      }
      myUpdateInfo = null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RestoreUpdateTree.java

示例14: VcsInitialization

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
public VcsInitialization(@NotNull final Project project) {
  myLock = new Object();

  StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable() {
    @Override
    public void run() {
      if (project.isDisposed()) return;
      myFuture = ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        @Override
        public void run() {
          if (!project.isDisposed()) {
            execute();
          }
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:VcsInitialization.java

示例15: projectOpened

import com.intellij.openapi.project.DumbAwareRunnable; //导入依赖的package包/类
@Override
public void projectOpened() {
  initializeForNewProject();

  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    myUpdater.initialized();
    vcsManager.addVcsListener(myVcsListener);
  }
  else {
    ((ProjectLevelVcsManagerImpl)vcsManager).addInitializationRequest(
      VcsInitObject.CHANGE_LIST_MANAGER, new DumbAwareRunnable() {
        @Override
        public void run() {
          myUpdater.initialized();
          broadcastStateAfterLoad();
          vcsManager.addVcsListener(myVcsListener);
        }
      });

    myConflictTracker.startTracking();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ChangeListManagerImpl.java


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