本文整理汇总了Java中com.intellij.openapi.util.Conditions.alwaysTrue方法的典型用法代码示例。如果您正苦于以下问题:Java Conditions.alwaysTrue方法的具体用法?Java Conditions.alwaysTrue怎么用?Java Conditions.alwaysTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.Conditions
的用法示例。
在下文中一共展示了Conditions.alwaysTrue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHighlightTryHandler
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
@Nullable
private static HighlightUsagesHandlerBase createHighlightTryHandler(final Editor editor,
final PsiFile file,
final PsiElement target,
final PsiElement parent) {
final PsiTryStatement tryStatement = (PsiTryStatement)parent;
FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.highlight.throws");
final PsiCodeBlock tryBlock = tryStatement.getTryBlock();
if (tryBlock == null) return null;
final Collection<PsiClassType> psiClassTypes = ExceptionUtil.collectUnhandledExceptions(tryBlock, tryBlock);
return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), tryBlock, Conditions.<PsiType>alwaysTrue());
}
示例2: createThrowsHandler
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
@Nullable
private static HighlightUsagesHandlerBase createThrowsHandler(final Editor editor, final PsiFile file, final PsiElement target) {
FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.highlight.throws");
PsiElement grand = target.getParent().getParent();
if (!(grand instanceof PsiMethod)) return null;
PsiMethod method = (PsiMethod)grand;
if (method.getBody() == null) return null;
final Collection<PsiClassType> psiClassTypes = ExceptionUtil.collectUnhandledExceptions(method.getBody(), method.getBody());
return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), method.getBody(), Conditions.<PsiType>alwaysTrue());
}
示例3: InheritanceJavaClassFilterImpl
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public InheritanceJavaClassFilterImpl(PsiClass base,
boolean acceptsSelf,
boolean acceptInner,
@Nullable
Condition<? super PsiClass> additionalCondition) {
myAcceptsSelf = acceptsSelf;
myAcceptsInner = acceptInner;
if (additionalCondition == null) {
additionalCondition = Conditions.alwaysTrue();
}
myAdditionalCondition = additionalCondition;
myBase = base;
}
示例4: getSdkFilter
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
private static Condition<Sdk> getSdkFilter(@Nullable final Condition<SdkTypeId> filter) {
return filter == null ? Conditions.<Sdk>alwaysTrue() : new Condition<Sdk>() {
@Override
public boolean value(Sdk sdk) {
return filter.value(sdk.getSdkType());
}
};
}
示例5: takeNextCommand
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public FinalizableCommand takeNextCommand() {
FinalizableCommand command = myList.remove(0);
if (isEmpty()) {
// memory leak otherwise
myExpireCondition = Conditions.alwaysTrue();
}
return command;
}
示例6: ConsoleExecuteAction
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public ConsoleExecuteAction(@NotNull LanguageConsoleView consoleView,
@NotNull ConsoleExecuteActionHandler executeActionHandler,
@NotNull String emptyExecuteActionId,
@Nullable Condition<LanguageConsoleView> enabledCondition) {
super(null, null, AllIcons.Actions.Execute);
myConsoleView = consoleView;
myExecuteActionHandler = executeActionHandler;
myEnabledCondition = enabledCondition == null ? Conditions.<LanguageConsoleView>alwaysTrue() : enabledCondition;
EmptyAction.setupAction(this, emptyExecuteActionId, null);
}
示例7: FindInProjectTask
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
FindInProjectTask(@NotNull final FindModel findModel, @NotNull final Project project) {
myFindModel = findModel;
myProject = project;
myDirectory = FindInProjectUtil.getDirectory(findModel);
myPsiManager = PsiManager.getInstance(project);
final String moduleName = findModel.getModuleName();
myModule = moduleName == null ? null : ApplicationManager.getApplication().runReadAction(new Computable<Module>() {
@Override
public Module compute() {
return ModuleManager.getInstance(project).findModuleByName(moduleName);
}
});
myProjectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
myFileIndex = myModule == null ? myProjectFileIndex : ModuleRootManager.getInstance(myModule).getFileIndex();
final String filter = findModel.getFileFilter();
final Pattern pattern = FindInProjectUtil.createFileMaskRegExp(filter);
myFileMask = pattern == null ? Conditions.<VirtualFile>alwaysTrue() : new Condition<VirtualFile>() {
@Override
public boolean value(VirtualFile file) {
return file != null && pattern.matcher(file.getName()).matches();
}
};
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
myProgress = progress != null ? progress : new EmptyProgressIndicator();
}
示例8: InheritanceJavaClassFilterImpl
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public InheritanceJavaClassFilterImpl(PsiClass base,
boolean acceptsSelf,
boolean acceptInner,
Condition<? super PsiClass> additionalCondition) {
myAcceptsSelf = acceptsSelf;
myAcceptsInner = acceptInner;
if (additionalCondition == null) {
additionalCondition = Conditions.alwaysTrue();
}
myAdditionalCondition = additionalCondition;
myBase = base;
}
示例9: SearchParameters
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public SearchParameters(Project project,
@NotNull final String aClassQName,
@NotNull SearchScope scope,
final boolean checkDeep,
final boolean checkInheritance,
Function<DotNetTypeDeclaration, DotNetTypeDeclaration> transformer)
{
this(project, aClassQName, scope, checkDeep, checkInheritance, Conditions.<String>alwaysTrue(), transformer);
}
示例10: getFileTypeMaskPattern
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
private static Condition<CharSequence> getFileTypeMaskPattern(@Nullable String mask) {
try {
return FindInProjectUtil.createFileMaskCondition(mask);
} catch (PatternSyntaxException e) {
LOG.info("Error while processing file mask: ", e);
return Conditions.alwaysTrue();
}
}
示例11: ConsoleExecuteAction
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public ConsoleExecuteAction(@Nonnull LanguageConsoleView consoleView,
@Nonnull ConsoleExecuteActionHandler executeActionHandler,
@Nonnull String emptyExecuteActionId,
@Nullable Condition<LanguageConsoleView> enabledCondition) {
super(null, null, AllIcons.Actions.Execute);
myConsoleView = consoleView;
myExecuteActionHandler = executeActionHandler;
myEnabledCondition = enabledCondition == null ? Conditions.<LanguageConsoleView>alwaysTrue() : enabledCondition;
EmptyAction.setupAction(this, emptyExecuteActionId, null);
}
示例12: createFileMaskCondition
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
@Nonnull
public static Condition<CharSequence> createFileMaskCondition(@Nullable String filter) throws PatternSyntaxException {
if (filter == null) {
return Conditions.alwaysTrue();
}
String pattern = "";
String negativePattern = "";
final List<String> masks = StringUtil.split(filter, ",");
for (String mask : masks) {
mask = mask.trim();
if (StringUtil.startsWith(mask, "!")) {
negativePattern += (negativePattern.isEmpty() ? "" : "|") + "(" + PatternUtil.convertToRegex(mask.substring(1)) + ")";
}
else {
pattern += (pattern.isEmpty() ? "" : "|") + "(" + PatternUtil.convertToRegex(mask) + ")";
}
}
if (pattern.isEmpty()) pattern = PatternUtil.convertToRegex("*");
final String finalPattern = pattern;
final String finalNegativePattern = negativePattern;
return new Condition<CharSequence>() {
final Pattern regExp = Pattern.compile(finalPattern, Pattern.CASE_INSENSITIVE);
final Pattern negativeRegExp = StringUtil.isEmpty(finalNegativePattern) ? null : Pattern.compile(finalNegativePattern, Pattern.CASE_INSENSITIVE);
@Override
public boolean value(CharSequence input) {
return regExp.matcher(input).matches() && (negativeRegExp == null || !negativeRegExp.matcher(input).matches());
}
};
}
示例13: completeJavadocReference
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
@NotNull
private List<LookupElement> completeJavadocReference(PsiElement position, PsiJavaReference ref)
{
JavaCompletionProcessor processor = new JavaCompletionProcessor(position, TrueFilter.INSTANCE, JavaCompletionProcessor.Options.CHECK_NOTHING, Conditions.alwaysTrue());
ref.processVariants(processor);
return ContainerUtil.map(processor.getResults(), (completionResult) ->
{
LookupElement item = createReferenceLookupItem(completionResult.getElement());
item.putUserData(JavaCompletionUtil.FORCE_SHOW_SIGNATURE_ATTR, Boolean.TRUE);
return item;
});
}
示例14: SearchParameters
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public SearchParameters(@NotNull SearchScope scope, @NotNull Project project) {
this(scope, project, Conditions.<String>alwaysTrue());
}
示例15: SearchParameters
import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public SearchParameters(@NotNull final PsiClass aClass, @NotNull SearchScope scope, final boolean checkDeep, final boolean checkInheritance, boolean includeAnonymous) {
this(aClass, scope, checkDeep, checkInheritance, includeAnonymous, Conditions.<String>alwaysTrue());
}