本文整理汇总了Java中com.intellij.openapi.application.ApplicationAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationAdapter类的具体用法?Java ApplicationAdapter怎么用?Java ApplicationAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationAdapter类属于com.intellij.openapi.application包,在下文中一共展示了ApplicationAdapter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startBackgroundListening
import com.intellij.openapi.application.ApplicationAdapter; //导入依赖的package包/类
/** Begins listening on changes in the background. */
public synchronized void startBackgroundListening() {
if (watchTimer == null) {
watchTimer = new Timer("cloud debug watcher", true /* isDaemon */);
watchTimer.schedule(new CloudDebugGlobalPollerTimerTask(this), DELAY_MS, DELAY_MS);
ApplicationManager.getApplication()
.addApplicationListener(
new ApplicationAdapter() {
@Override
public void applicationExiting() {
if (watchTimer != null) {
watchTimer.cancel();
}
}
});
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:19,代码来源:CloudDebugGlobalPoller.java
示例2: watchForEvents
import com.intellij.openapi.application.ApplicationAdapter; //导入依赖的package包/类
static void watchForEvents(Application application) {
AtomicBoolean reported = new AtomicBoolean();
IdeEventQueue.getInstance().addPostprocessor(e -> {
if (application.isWriteAccessAllowed() && reported.compareAndSet(false, true)) {
LOG.error("AWT events are not allowed inside write action: " + e);
}
return true;
}, application);
application.addApplicationListener(new ApplicationAdapter() {
@Override
public void afterWriteActionFinished(@Nonnull Object action) {
reported.set(false);
}
});
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:NoSwingUnderWriteAction.java
示例3: forceWriteActionPriority
import com.intellij.openapi.application.ApplicationAdapter; //导入依赖的package包/类
@NotNull
public static ProgressIndicator forceWriteActionPriority(@NotNull final ProgressIndicator progress, @NotNull final Disposable builder) {
ApplicationManager.getApplication().addApplicationListener(new ApplicationAdapter() {
@Override
public void beforeWriteActionStart(Object action) {
if (progress.isRunning()) {
progress.cancel();
}
}
}, builder);
return progress;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ProgressIndicatorUtils.java
示例4: forceWriteActionPriority
import com.intellij.openapi.application.ApplicationAdapter; //导入依赖的package包/类
@Nonnull
public static ProgressIndicator forceWriteActionPriority(@Nonnull ProgressIndicator progress, @Nonnull Disposable parentDisposable) {
ApplicationManager.getApplication().addApplicationListener(new ApplicationAdapter() {
@Override
public void beforeWriteActionStart(@Nonnull Object action) {
if (progress.isRunning()) {
progress.cancel();
}
}
}, parentDisposable);
return progress;
}
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:ProgressIndicatorUtils.java
示例5: showTextFieldPanel
import com.intellij.openapi.application.ApplicationAdapter; //导入依赖的package包/类
protected void showTextFieldPanel() {
final JLayeredPane layeredPane = getLayeredPane();
final Dimension preferredTextFieldPanelSize = myTextFieldPanel.getPreferredSize();
final int x = (layeredPane.getWidth() - preferredTextFieldPanelSize.width) / 2;
final int paneHeight = layeredPane.getHeight();
final int y = paneHeight / 3 - preferredTextFieldPanelSize.height / 2;
VISIBLE_LIST_SIZE_LIMIT = Math.max
(10, (paneHeight - (y + preferredTextFieldPanelSize.height)) / (preferredTextFieldPanelSize.height / 2) - 1);
ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(myTextFieldPanel, myTextField);
builder.setCancelCallback(new Computable<Boolean>() {
@Override
public Boolean compute() {
myTextPopup = null;
close(false);
return Boolean.TRUE;
}
}).setFocusable(true).setRequestFocus(true).setModalContext(false).setCancelOnClickOutside(false);
Point point = new Point(x, y);
SwingUtilities.convertPointToScreen(point, layeredPane);
Rectangle bounds = new Rectangle(point, new Dimension(preferredTextFieldPanelSize.width + 20, preferredTextFieldPanelSize.height));
myTextPopup = builder.createPopup();
myTextPopup.setSize(bounds.getSize());
myTextPopup.setLocation(bounds.getLocation());
new MnemonicHelper().register(myTextFieldPanel);
if (myProject != null && !myProject.isDefault()) {
DaemonCodeAnalyzer.getInstance(myProject).disableUpdateByTimer(myTextPopup);
}
Disposer.register(myTextPopup, new Disposable() {
@Override
public void dispose() {
cancelCalcElementsThread();
}
});
ApplicationManager.getApplication().addApplicationListener(new ApplicationAdapter() {
@Override
public void beforeWriteActionStart(Object action) {
CalcElementsThread prevThread = cancelCalcElementsThread();
if (prevThread != null) {
prevThread.scheduleRestart();
}
}
}, myTextPopup);
myTextPopup.show(layeredPane);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:50,代码来源:ChooseByNameBase.java
注:本文中的com.intellij.openapi.application.ApplicationAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论