本文整理汇总了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));
}
}));
}
示例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);
});
}
示例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());
}
});
}
}
示例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);
}
}
}
示例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);
}
});
}
}
示例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);
}
}
}
});
}
});
}
});
}
示例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);
}
}
});
}
}
示例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);
}
}
);
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例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;
}
});
}
示例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();
}
}
});
}
});
}
示例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();
}
}