private boolean enabledAndGettersFilled(final boolean ignoreEnabled) {
   if ((!ignoreEnabled) && (!Boolean.TRUE.equals(myEnabledHolder.get()))) {
     return false;
   }
   return (myRootGetter.get() != null)
       && (myBranchGetter.get() != null)
       && (myWcPathGetter.get() != null);
 }
 @Override
 public void update(final AnActionEvent e) {
   e.getPresentation()
       .setEnabled(
           getEditorSearchComponent().hasMatches()
               && !StringUtil.isEmpty(myTextField.get().getText()));
 }
  public NextOccurrenceAction(
      EditorSearchComponent editorSearchComponent, Getter<JTextComponent> editorTextField) {
    super(editorSearchComponent);
    myTextField = editorTextField;
    copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_NEXT_OCCURENCE));
    ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>();
    ContainerUtil.addAll(
        shortcuts,
        ActionManager.getInstance()
            .getAction(IdeActions.ACTION_FIND_NEXT)
            .getShortcutSet()
            .getShortcuts());
    if (!editorSearchComponent.getFindModel().isMultiline()) {
      ContainerUtil.addAll(
          shortcuts,
          ActionManager.getInstance()
              .getAction(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN)
              .getShortcutSet()
              .getShortcuts());

      shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null));
    }

    registerShortcutsForComponent(shortcuts, editorTextField.get());
  }
 @Nullable
 public TestFrameworkRunningModel getModel() {
   if (myModel != null) {
     return myModel;
   }
   if (myModelProvider != null) {
     return myModelProvider.get();
   }
   return null;
 }
 private SVNInfo initInfo() {
   if (myInfo == null) {
     final SVNStatusType contentsStatus = getContentsStatus();
     if (contentsStatus == null || SVNStatusType.UNKNOWN.equals(contentsStatus)) {
       return null;
     }
     myInfo = myInfoGetter.get();
   }
   return myInfo;
 }
  @Nullable
  public CommittedChangeListsListener createRefresher(final boolean ignoreEnabled) {
    if (refreshEnabled(ignoreEnabled)) {
      // on awt thread
      final MergeinfoCached state =
          myMergeInfoCache.getCachedState(myRootGetter.get(), myWcPathGetter.get());
      myCachedMap.put(
          createKey(myRootGetter.get(), myBranchGetter.get()),
          (state == null)
              ? new MergeinfoCached()
              : new MergeinfoCached(
                  new HashMap<Long, SvnMergeInfoCache17.MergeCheckResult>(state.getMap()),
                  state.getCopyRevision()));
      myMergeInfoCache.clear(myRootGetter.get(), myWcPathGetter.get());

      return new MyRefresher();
    }
    return null;
  }
 private MergeinfoCached getCurrentCache() {
   return myCachedMap.get(createKey(myRootGetter.get(), myBranchGetter.get()));
 }
 public void updateMixedRevisionsForPanel() {
   myMixedRevisionsConsumer.consume(
       myMergeInfoCache.isMixedRevisions(myRootGetter.get(), myWcPathGetter.get()));
 }
    private void addNestedRoots(final boolean clearState) {
      final List<VirtualFile> basicVfRoots =
          ObjectsConvertor.convert(
              myTopRoots,
              new Convertor<RootUrlInfo, VirtualFile>() {
                public VirtualFile convert(final RootUrlInfo real) {
                  return real.getVirtualFile();
                }
              });

      final ChangeListManager clManager = ChangeListManager.getInstance(myVcs.getProject());

      if (clearState) {
        // clear what was reported before (could be for currently-not-existing roots)
        myGate.get();
      }
      clManager.invokeAfterUpdate(
          new Runnable() {
            public void run() {
              final List<RootUrlInfo> nestedRoots = new ArrayList<RootUrlInfo>();

              final NestedCopiesData data = myGate.get();
              for (NestedCopiesBuilder.MyPointInfo info : data.getSet()) {
                if (NestedCopyType.external.equals(info.getType())
                    || NestedCopyType.switched.equals(info.getType())) {
                  final File infoFile = new File(info.getFile().getPath());
                  boolean copyFound = false;
                  for (RootUrlInfo topRoot : myTopRoots) {
                    if (topRoot.getIoFile().equals(infoFile)) {
                      topRoot.setType(info.getType());
                      copyFound = true;
                      break;
                    }
                  }
                  if (copyFound) {
                    continue;
                  }
                  try {
                    final SVNStatus svnStatus = SvnUtil.getStatus(myVcs, infoFile);
                    if (svnStatus.getURL() == null) continue;
                    info.setUrl(svnStatus.getURL());
                    info.setFormat(WorkingCopyFormat.getInstance(svnStatus.getWorkingCopyFormat()));
                  } catch (Exception e) {
                    continue;
                  }
                }
                for (RootUrlInfo topRoot : myTopRoots) {
                  if (VfsUtil.isAncestor(topRoot.getVirtualFile(), info.getFile(), true)) {
                    final SVNURL repoRoot = myRepositoryRoots.ask(info.getUrl());
                    if (repoRoot != null) {
                      final RootUrlInfo rootInfo =
                          new RootUrlInfo(
                              repoRoot,
                              info.getUrl(),
                              info.getFormat(),
                              info.getFile(),
                              topRoot.getRoot());
                      rootInfo.setType(info.getType());
                      nestedRoots.add(rootInfo);
                    }
                    break;
                  }
                }
              }
              // check those top roots which ARE externals, but that was not detected due to they
              // itself were the status request target
              // new SvnNestedTypeRechecker(myVcs.getProject(), myTopRoots).run();

              myTopRoots.addAll(nestedRoots);
              myApplier.apply(myVcs, myTopRoots, myLonelyRoots);
            }
          },
          InvokeAfterUpdateMode.SILENT_CALLBACK_POOLED,
          null,
          new Consumer<VcsDirtyScopeManager>() {
            public void consume(VcsDirtyScopeManager vcsDirtyScopeManager) {
              if (clearState) {
                vcsDirtyScopeManager.filesDirty(null, basicVfRoots);
              }
            }
          },
          null);
    }