本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.exists方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.exists方法的具体用法?Java ContainerUtil.exists怎么用?Java ContainerUtil.exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.exists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIntentionActionsToShow
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void getIntentionActionsToShow() {
getActionsToShow(myEditor, myFile, myIntentionsInfo, myPassIdToShowIntentionsFor);
if (myFile instanceof IntentionFilterOwner) {
final IntentionFilterOwner.IntentionActionsFilter actionsFilter = ((IntentionFilterOwner)myFile).getIntentionActionsFilter();
if (actionsFilter == null) return;
if (actionsFilter != IntentionFilterOwner.IntentionActionsFilter.EVERYTHING_AVAILABLE) {
myIntentionsInfo.filterActions(actionsFilter);
}
}
if (myIntentionsInfo.isEmpty()) {
return;
}
myShowBulb = !myIntentionsInfo.guttersToShow.isEmpty() ||
ContainerUtil.exists(ContainerUtil.concat(myIntentionsInfo.errorFixesToShow, myIntentionsInfo.inspectionFixesToShow,myIntentionsInfo.intentionsToShow), new Condition<HighlightInfo.IntentionActionDescriptor>() {
@Override
public boolean value(HighlightInfo.IntentionActionDescriptor descriptor) {
return IntentionManagerSettings.getInstance().isShowLightBulb(descriptor.getAction());
}
});
}
示例2: setUpTracking
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void setUpTracking(@NotNull Collection<VcsRef> refs) {
cd(myProjectRoot);
for (final VcsRef ref : refs) {
if (ref.getType() == GitRefManager.LOCAL_BRANCH) {
final String localBranch = ref.getName();
if (ContainerUtil.exists(refs, new Condition<VcsRef>() {
@Override
public boolean value(VcsRef remoteRef) {
return remoteRef.getType() == GitRefManager.REMOTE_BRANCH && remoteRef.getName().replace("origin/", "").equals(localBranch);
}
})) {
git("config branch." + localBranch + ".remote origin");
git("config branch." + localBranch + ".merge refs/heads/" + localBranch);
}
}
}
}
示例3: containsForcePushTarget
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean containsForcePushTarget(@NotNull final String remote, @NotNull final String branch) {
return ContainerUtil.exists(myState.FORCE_PUSH_TARGETS, new Condition<ForcePushTargetInfo>() {
@Override
public boolean value(ForcePushTargetInfo info) {
return info.targetRemoteName.equals(remote) && info.targetBranchName.equals(branch);
}
});
}
示例4: isForcePushEnabled
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean isForcePushEnabled() {
return ContainerUtil.exists(myView2Model.values(), new Condition<MyRepoModel<?, ?, ?>>() {
@Override
public boolean value(MyRepoModel<?, ?, ?> model) {
return model.getSupport().isForcePushEnabled();
}
});
}
示例5: containedInOtherNames
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private boolean containedInOtherNames(@NotNull final Repository except, final String candidate) {
return ContainerUtil.exists(myGlobalRepositoryManager.getRepositories(), new Condition<Repository>() {
@Override
public boolean value(Repository repository) {
return !repository.equals(except) && repository.getRoot().getName().equals(candidate);
}
});
}
示例6: isPushAllowed
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean isPushAllowed(final boolean force) {
JTree tree = myPushLog.getTree();
return !tree.isEditing() &&
ContainerUtil.exists(myPushSupports, new Condition<PushSupport<Repository, PushSource, PushTarget>>() {
@Override
public boolean value(PushSupport<Repository, PushSource, PushTarget> support) {
return isPushAllowed(support, force);
}
});
}
示例7: hasSomethingToPush
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private boolean hasSomethingToPush(Collection<RepositoryNode> nodes) {
return ContainerUtil.exists(nodes, new Condition<RepositoryNode>() {
@Override
public boolean value(@NotNull RepositoryNode node) {
PushTarget target = myView2Model.get(node).getTarget();
//if node is selected target should not be null
return (node.isChecked() || node.isLoading()) && target != null && target.hasSomethingToPush();
}
});
}
示例8: hasGitRoots
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static boolean hasGitRoots(@NotNull Project project, @NotNull Set<VirtualFile> roots) {
final GitRepositoryManager manager = ServiceManager.getService(project, GitRepositoryManager.class);
return ContainerUtil.exists(roots, new Condition<VirtualFile>() {
@Override
public boolean value(VirtualFile root) {
return manager.getRepositoryForRoot(root) != null;
}
});
}
示例9: noChangesAfterCherryPick
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private boolean noChangesAfterCherryPick(@NotNull Collection<Change> originalChanges) {
final Collection<Change> allChanges = myChangeListManager.getAllChanges();
return !ContainerUtil.exists(originalChanges, new Condition<Change>() {
@Override
public boolean value(Change change) {
return allChanges.contains(change);
}
});
}
示例10: getCommonTarget
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Nullable
private static PushTarget getCommonTarget(@NotNull Collection<MyRepoModel<?, ?, ?>> selectedNodes) {
final PushTarget commonTarget = ObjectUtils.assertNotNull(ContainerUtil.getFirstItem(selectedNodes)).getTarget();
return commonTarget != null && !ContainerUtil.exists(selectedNodes, new Condition<MyRepoModel<?, ?, ?>>() {
@Override
public boolean value(MyRepoModel model) {
return !commonTarget.equals(model.getTarget());
}
}) ? commonTarget : null;
}
示例11: isAppliedPatch
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static boolean isAppliedPatch(@NotNull HgRepository repository, @NotNull final VcsFullCommitDetails commitDetails) {
return ContainerUtil.exists(repository.getMQAppliedPatches(), new Condition<HgNameWithHashInfo>() {
@Override
public boolean value(HgNameWithHashInfo info) {
return info.getHash().equals(commitDetails.getId());
}
});
}
示例12: isInTargetPosition
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static boolean isInTargetPosition(@NotNull final PySequenceExpression sequenceLiteral) {
return ContainerUtil.exists(sequenceLiteral.getElements(), new Condition<PyExpression>() {
@Override
public boolean value(PyExpression expression) {
return expression instanceof PyTargetExpression;
}
});
}
示例13: containsCategory
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public boolean containsCategory(int category) {
final int categoryCode = getCategoryCode(category);
Condition<Integer> belongsToCategoryCondition = new Condition<Integer>() {
@Override
public boolean value(Integer code) {
return getCategoryCode(code) == categoryCode;
}
};
return ContainerUtil.exists(errors.keySet(), belongsToCategoryCondition) ||
ContainerUtil.exists(warnings.keySet(), belongsToCategoryCondition);
}
示例14: belongsToSomeMovedElement
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private boolean belongsToSomeMovedElement(@NotNull final PsiElement element) {
return ContainerUtil.exists(myAllMovedElements, new Condition<PsiElement>() {
@Override
public boolean value(PsiElement movedElement) {
final PsiElement movedElementBody = PyMoveModuleMembersHelper.expandNamedElementBody((PsiNamedElement)movedElement);
return PsiTreeUtil.isAncestor(movedElementBody, element, false);
}
});
}
示例15: isForcePushAllowed
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public boolean isForcePushAllowed(@NotNull GitRepository repo, @NotNull GitPushTarget target) {
final String targetBranch = target.getBranch().getNameForRemoteOperations();
return !ContainerUtil.exists(mySharedSettings.getForcePushProhibitedPatterns(), new Condition<String>() {
@Override
public boolean value(String pattern) {
return targetBranch.matches("^" + pattern + "$"); // let "master" match only "master" and not "any-master-here" by default
}
});
}