當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。