Java Code Examples for com.intellij.openapi.util.Conditions#alwaysFalse()

The following examples show how to use com.intellij.openapi.util.Conditions#alwaysFalse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContainingBranchesGetter.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
public Condition<CommitId> getContainedInBranchCondition(@Nonnull final String branchName, @Nonnull final VirtualFile root) {
  LOG.assertTrue(EventQueue.isDispatchThread());

  DataPack dataPack = myLogData.getDataPack();
  if (dataPack == DataPack.EMPTY) return Conditions.alwaysFalse();

  PermanentGraph<Integer> graph = dataPack.getPermanentGraph();
  VcsLogRefs refs = dataPack.getRefsModel();

  ContainedInBranchCondition condition = myConditions.get(root);
  if (condition == null || !condition.getBranch().equals(branchName)) {
    VcsRef branchRef = ContainerUtil.find(refs.getBranches(),
                                          vcsRef -> vcsRef.getRoot().equals(root) && vcsRef.getName().equals(branchName));
    if (branchRef == null) return Conditions.alwaysFalse();
    condition = new ContainedInBranchCondition(graph.getContainedInBranchCondition(
      Collections.singleton(myLogData.getCommitIndex(branchRef.getCommitHash(), branchRef.getRoot()))), branchName);
    myConditions.put(root, condition);
  }
  return condition;
}
 
Example 2
Source File: CurrentBranchHighlighter.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public VcsCommitStyle getStyle(@Nonnull VcsShortCommitDetails details, boolean isSelected) {
  if (isSelected || !myLogUi.isHighlighterEnabled(Factory.ID)) return VcsCommitStyle.DEFAULT;
  Condition<CommitId> condition = myConditions.get(details.getRoot());
  if (condition == null) {
    VcsLogProvider provider = myLogData.getLogProvider(details.getRoot());
    String currentBranch = provider.getCurrentBranch(details.getRoot());
    if (!HEAD.equals(mySingleFilteredBranch) && currentBranch != null && !(currentBranch.equals(mySingleFilteredBranch))) {
      condition = myLogData.getContainingBranchesGetter().getContainedInBranchCondition(currentBranch, details.getRoot());
      myConditions.put(details.getRoot(), condition);
    }
    else {
      condition = Conditions.alwaysFalse();
    }
  }
  if (condition != null && condition.value(new CommitId(details.getId(), details.getRoot()))) {
    return VcsCommitStyleFactory.background(CURRENT_BRANCH_BG);
  }
  return VcsCommitStyle.DEFAULT;
}
 
Example 3
Source File: TransferToEDTQueue.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static TransferToEDTQueue<Runnable> createRunnableMerger(@Nonnull @NonNls String name, int maxUnitOfWorkThresholdMs) {
  return new TransferToEDTQueue<Runnable>(name, new Processor<Runnable>() {
    @Override
    public boolean process(Runnable runnable) {
      runnable.run();
      return true;
    }
  }, Conditions.alwaysFalse(), maxUnitOfWorkThresholdMs);
}
 
Example 4
Source File: InspectorTreeUI.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public InspectorTreeUI() {
  this(false, Conditions.<Integer>alwaysFalse());
}
 
Example 5
Source File: InspectorTreeUI.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public InspectorTreeUI() {
  this(false, Conditions.<Integer>alwaysFalse());
}
 
Example 6
Source File: QueueProcessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs a QueueProcessor, which will autostart as soon as the first element is added to it.
 */
public QueueProcessor(@Nonnull Consumer<T> processor) {
  this(processor, Conditions.alwaysFalse());
}
 
Example 7
Source File: EmptyPermanentGraph.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Condition<Integer> getContainedInBranchCondition(@Nonnull Collection<Integer> currentBranchHead) {
  return Conditions.alwaysFalse();
}
 
Example 8
Source File: MockComponentManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public Condition getDisposed() {
  return Conditions.alwaysFalse();
}
 
Example 9
Source File: RunAnythingChooseContextAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
public ChooseContextPopupStep(List<PopupFactoryImpl.ActionItem> actions, DataContext dataContext, Runnable updateToolbar) {
  super(actions, IdeBundle.message("run.anything.context.title.working.directory"), () -> dataContext, null, true, Conditions.alwaysFalse(), false, true, null);
  myActions = actions;
  myUpdateToolbar = updateToolbar;
}