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


Java Disposer.isDisposed方法代码示例

本文整理汇总了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);
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RerunTestsAction.java

示例2: removeNotify

import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void removeNotify() {
  super.removeNotify();
  if (myDisposable != null && !Disposer.isDisposed(myDisposable)) {
    Disposer.dispose(myDisposable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:OnePixelDivider.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EditorComposite.java

示例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);
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RerunTestsAction.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:FindManagerImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:IpnbFilePanel.java

示例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);
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitRepositoryImpl.java

示例8: consume

import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
@Override
public void consume(Object dummy) {
  if (!Disposer.isDisposed(myRepository)) {
    myRepository.update();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:DvcsUtil.java

示例9: processRemoveFromUi

import com.intellij.openapi.util.Disposer; //导入方法依赖的package包/类
public void processRemoveFromUi() {
  if (Disposer.isDisposed(this)) return;

  updateSelection(false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:GridImpl.java


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