本文整理汇总了Java中com.intellij.openapi.util.Disposer.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Disposer.isDisposed方法的具体用法?Java Disposer.isDisposed怎么用?Java Disposer.isDisposed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.Disposer
的用法示例。
在下文中一共展示了Disposer.isDisposed方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
List<RunContentDescriptor> descriptors = ContainerUtil.newArrayList(REGISTRY);
for (RunContentDescriptor descriptor : descriptors) {
if (Disposer.isDisposed(descriptor)) {
REGISTRY.remove(descriptor);
}
else {
Project project = e.getProject();
if (project != null) {
RunContentManager runContentManager = ExecutionManager.getInstance(project).getContentManager();
// check if the descriptor belongs to the current project
if (runContentManager.getToolWindowByDescriptor(descriptor) != null) {
ExecutionUtil.restart(descriptor);
}
}
}
}
}
示例2: removeNotify
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void removeNotify() {
super.removeNotify();
if (myDisposable != null && !Disposer.isDisposed(myDisposable)) {
Disposer.dispose(myDisposable);
}
}
示例3: dispose
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void dispose() {
for (FileEditor editor : myEditors) {
if (!Disposer.isDisposed(editor)) {
Disposer.dispose(editor);
}
}
myFocusWatcher.deinstall(myFocusWatcher.getTopComponent());
}
示例4: register
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
public static void register(@NotNull final RunContentDescriptor descriptor) {
if (!Disposer.isDisposed(descriptor) && REGISTRY.add(descriptor)) {
Disposer.register(descriptor, new Disposable() {
@Override
public void dispose() {
REGISTRY.remove(descriptor);
}
});
}
}
示例5: showFindDialog
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void showFindDialog(@NotNull final FindModel model, @NotNull final Runnable okHandler) {
final Consumer<FindModel> handler = new Consumer<FindModel>(){
@Override
public void consume(FindModel findModel) {
String stringToFind = findModel.getStringToFind();
if (!StringUtil.isEmpty(stringToFind)) {
FindSettings.getInstance().addStringToFind(stringToFind);
}
if (!findModel.isMultipleFiles()) {
setFindWasPerformed();
}
if (findModel.isReplaceState()) {
FindSettings.getInstance().addStringToReplace(findModel.getStringToReplace());
}
if (findModel.isMultipleFiles() && !findModel.isProjectScope() && findModel.getDirectoryName() != null) {
FindSettings.getInstance().addDirectory(findModel.getDirectoryName());
myFindInProjectModel.setWithSubdirectories(findModel.isWithSubdirectories());
}
okHandler.run();
}
};
if(myFindDialog==null || Disposer.isDisposed(myFindDialog.getDisposable())){
myFindDialog = new FindDialog(myProject, model, handler) {
@Override
protected void dispose() {
super.dispose();
myFindDialog = null; // avoid strong ref!
}
};
myFindDialog.setModal(true);
}
else if (myFindDialog.getModel().isReplaceState() != model.isReplaceState()) {
myFindDialog.setModel(model);
myFindDialog.setOkHandler(handler);
return;
}
myFindDialog.show();
}
示例6: run
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
public void run() {
final Project project = getProject();
if (project.isDisposed()) {
return;
}
if (Disposer.isDisposed(myParent))
return;
PsiDocumentManager.getInstance(project).commitDocument(myDocument);
final IpnbEditablePanel selectedCell = getSelectedCell();
final int index = myIpnbPanels.indexOf(selectedCell);
myInitialSelection = index >= 0 && index < myIpnbPanels.size() ? index : myIpnbPanels.size() - 1;
removeAll();
readFromFile(false);
}
示例7: notifyListeners
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
private static void notifyListeners(@NotNull final GitRepository repository, @Nullable GitRepoInfo previousInfo, @NotNull GitRepoInfo info) {
if (Disposer.isDisposed(repository.getProject())) {
return;
}
if (!info.equals(previousInfo)) {
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
public void run() {
Project project = repository.getProject();
if (!project.isDisposed()) {
project.getMessageBus().syncPublisher(GIT_REPO_CHANGE).repositoryChanged(repository);
}
}
});
}
}
示例8: consume
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void consume(Object dummy) {
if (!Disposer.isDisposed(myRepository)) {
myRepository.update();
}
}
示例9: processRemoveFromUi
import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
public void processRemoveFromUi() {
if (Disposer.isDisposed(this)) return;
updateSelection(false);
}