当前位置: 首页>>代码示例>>Java>>正文


Java Conditions.alwaysTrue方法代码示例

本文整理汇总了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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HighlightExceptionsHandlerFactory.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HighlightExceptionsHandlerFactory.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TreeJavaClassChooserDialog.java

示例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());
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JdkComboBox.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CommandProcessor.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ConsoleExecuteAction.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:FindInProjectTask.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:TreeJavaClassChooserDialog.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:10,代码来源:TypeInheritorsSearch.java

示例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();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ReformatCodeAction.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:ConsoleExecuteAction.java

示例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());
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:35,代码来源:FindInProjectUtil.java

示例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;
	});
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:JavaDocCompletionContributor.java

示例14: SearchParameters

import com.intellij.openapi.util.Conditions; //导入方法依赖的package包/类
public SearchParameters(@NotNull SearchScope scope, @NotNull Project project) {
  this(scope, project, Conditions.<String>alwaysTrue());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AllClassesSearch.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ClassInheritorsSearch.java


注:本文中的com.intellij.openapi.util.Conditions.alwaysTrue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。