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


Java NotNullLazyValue类代码示例

本文整理汇总了Java中com.intellij.openapi.util.NotNullLazyValue的典型用法代码示例。如果您正苦于以下问题:Java NotNullLazyValue类的具体用法?Java NotNullLazyValue怎么用?Java NotNullLazyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NotNullLazyValue类属于com.intellij.openapi.util包,在下文中一共展示了NotNullLazyValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JavaOverrideImplementMemberChooser

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private JavaOverrideImplementMemberChooser(final PsiMethodMember[] allElements,
                                           final PsiMethodMember[] onlyPrimaryElements,
                                           final NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
                                           final @NotNull Project project,
                                           final boolean isInsertOverrideVisible,
                                           final boolean merge,
                                           final boolean toImplement,
                                           final boolean sortedByOverriding) {
  super(false, true, project, isInsertOverrideVisible, null, null);
  myAllElements = allElements;
  myOnlyPrimaryElements = onlyPrimaryElements;
  myLazyElementsWithPercent = lazyElementsWithPercent;
  myProject = project;
  myMerge = merge;
  myToImplement = toImplement;
  mySortedByOverriding = sortedByOverriding;
  resetElements(getInitialElements(allElements, onlyPrimaryElements, lazyElementsWithPercent, merge, toImplement, sortedByOverriding));
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:JavaOverrideImplementMemberChooser.java

示例2: ExtensibleQueryFactory

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @NotNull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @NotNull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          @NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Extensions.getRootArea().getExtensionPoint(epName);
        }
      };
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ExtensibleQueryFactory.java

示例3: getValue

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@NotNull
public NotNullLazyValue<?> getValue() {
  if (value == null) {
    value = new AtomicNotNullLazyValue<Object>() {
      @NotNull
      @Override
      protected Object compute() {
        try {
          if (service == null) {
            Class<Object> aClass = findClass(implementation);
            return asInstance ? instantiate(aClass, ApplicationManager.getApplication().getPicoContainer(), true) : aClass;
          }
          else {
            return ServiceManager.getService(findClass(service));
          }
        }
        catch (ClassNotFoundException e) {
          throw new RuntimeException(e);
        }
      }
    };
  }
  return value;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JsonRpcDomainBean.java

示例4: ProjectDataManager

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public ProjectDataManager() {
  myServices = new NotNullLazyValue<Map<Key<?>, List<ProjectDataService<?, ?>>>>() {
    @NotNull
    @Override
    protected Map<Key<?>, List<ProjectDataService<?, ?>>> compute() {
      Map<Key<?>, List<ProjectDataService<?, ?>>> result = ContainerUtilRt.newHashMap();
      for (ProjectDataService<?, ?> service : ProjectDataService.EP_NAME.getExtensions()) {
        List<ProjectDataService<?, ?>> services = result.get(service.getTargetDataKey());
        if (services == null) {
          result.put(service.getTargetDataKey(), services = ContainerUtilRt.newArrayList());
        }
        services.add(service);
      }

      for (List<ProjectDataService<?, ?>> services : result.values()) {
        ExternalSystemApiUtil.orderAwareSort(services);
      }
      return result;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ProjectDataManager.java

示例5: collectFields

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@NotNull final Class<?> clazz) {
  return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
    @NotNull
    @Override
    protected Set<ArrangementSettingsToken> compute() {
      Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
      for (Field field : clazz.getFields()) {
        if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
          try {
            result.add((ArrangementSettingsToken)field.get(null));
          }
          catch (IllegalAccessException e) {
            assert false : e;
          }
        }
      }
      return result;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:StdArrangementTokens.java

示例6: createPointersThunk

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static <T> NotNullLazyValue<List<SmartPsiElementPointer>> createPointersThunk(boolean lazy,
                                                                                      final Project project,
                                                                                      final Factory<Collection<T>> targets,
                                                                                      final NotNullFunction<T, Collection<? extends PsiElement>> converter) {
  if (!lazy) {
    return NotNullLazyValue.createConstantValue(calcPsiTargets(project, targets.create(), converter));
  }

  return new NotNullLazyValue<List<SmartPsiElementPointer>>() {
    @Override
    @NotNull
    public List<SmartPsiElementPointer> compute() {
      return calcPsiTargets(project, targets.create(), converter);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NavigationGutterIconBuilder.java

示例7: collectFields

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@NotNull final Class<?> clazz) {
  return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
    @NotNull
    @Override
    protected Set<ArrangementSettingsToken> compute() {
      Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
      for (Field field : clazz.getFields()) {
        if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
          try {
            result.add((ArrangementSettingsToken)field.get(null));
          }
          catch (IllegalAccessException e) {
            assert false : e;
          }
        }
      } 
      return result;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:StdArrangementTokens.java

示例8: createLineMarkerInfo

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@NotNull PsiElement element) {
  final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
  final String tooltip = renderer.getTooltipText();
  NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
    @NotNull
    @Override
    protected Collection<? extends GotoRelatedItem> compute() {
      if (myGotoRelatedItemProvider != null) {
        return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
      }
      return Collections.emptyList();
    }
  };
  return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.UPDATE_OVERRIDEN_MARKERS,
                                                   tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
                                                   renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
                                                   gotoTargets);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:NavigationGutterIconBuilder.java

示例9: addParameterExpression

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public void addParameterExpression(Object o)
{
	if(myCallArguments.isEmpty())
	{
		myCallArguments = new SmartList<>();
	}

	myCallArguments.add(NotNullLazyValue.createValue(() ->
	{
		Object value = o;

		if(value instanceof String)
		{
			value = StringUtil.QUOTER.fun((String) value);
		}

		return new CSharpLightCallArgument(CSharpFileFactory.createExpression(getProject(), String.valueOf(value)));
	}));
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:20,代码来源:CSharpAbstractLightAttributeBuilder.java

示例10: LambdaResult

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@RequiredReadAction
public LambdaResult(@NotNull PsiElement scope, @NotNull CSharpMethodDeclaration element, @NotNull DotNetGenericExtractor extractor)
{
	super(element, extractor);
	myScope = scope;
	myParameterInfosValue = NotNullLazyValue.createValue(() ->
	{
		CSharpSimpleParameterInfo[] parameterInfos = myElement.getParameterInfos();
		if(myExtractor == DotNetGenericExtractor.EMPTY)
		{
			return parameterInfos;
		}
		CSharpSimpleParameterInfo[] temp = new CSharpSimpleParameterInfo[parameterInfos.length];
		for(int i = 0; i < parameterInfos.length; i++)
		{
			CSharpSimpleParameterInfo parameterInfo = parameterInfos[i];
			DotNetTypeRef typeRef = GenericUnwrapTool.exchangeTypeRef(parameterInfo.getTypeRef(), getGenericExtractor(), myScope);
			temp[i] = new CSharpSimpleParameterInfo(parameterInfo.getIndex(), parameterInfo.getName(), parameterInfo.getElement(), typeRef);
		}
		return temp;
	});
	myElementValue = NotNullLazyValue.createValue(() -> CSharpLambdaResolveResultUtil.createTypeFromDelegate(myElement, myExtractor));
	myReturnTypRefValue = NotNullLazyValue.createValue(() -> GenericUnwrapTool.exchangeTypeRef(myElement.getReturnTypeRef(), getGenericExtractor(), scope));
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:CSharpUserTypeRef.java

示例11: MsilMethodAsCSharpLikeMethodDeclaration

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilMethodAsCSharpLikeMethodDeclaration(PsiElement parent, @NotNull CSharpModifier[] modifiers, MsilMethodEntry methodEntry)
{
	super(parent, methodEntry);
	myModifierList = new MsilModifierListToCSharpModifierList(modifiers, this, methodEntry.getModifierList());

	myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getReturnTypeRef(), myOriginal));
	myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
	{
		DotNetTypeRef[] parameters = myOriginal.getParameterTypeRefs();
		DotNetTypeRef[] refs = new DotNetTypeRef[parameters.length];
		for(int i = 0; i < parameters.length; i++)
		{
			refs[i] = MsilToCSharpUtil.extractToCSharp(parameters[i], myOriginal);
		}
		return refs;
	});
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:MsilMethodAsCSharpLikeMethodDeclaration.java

示例12: ExtensibleQueryFactory

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @Nonnull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @Nonnull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          @NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Extensions.getRootArea().getExtensionPoint(epName);
        }
      };
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:ExtensibleQueryFactory.java

示例13: collectFields

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@Nonnull final Class<?> clazz) {
  return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
    @Nonnull
    @Override
    protected Set<ArrangementSettingsToken> compute() {
      Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
      for (Field field : clazz.getFields()) {
        if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
          try {
            result.add((ArrangementSettingsToken)field.get(null));
          }
          catch (IllegalAccessException e) {
            assert false : e;
          }
        }
      }
      return result;
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:StdArrangementTokens.java

示例14: createLineMarkerInfo

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@Nonnull PsiElement element) {
  final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
  final String tooltip = renderer.getTooltipText();
  NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
    @Nonnull
    @Override
    protected Collection<? extends GotoRelatedItem> compute() {
      if (myGotoRelatedItemProvider != null) {
        return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
      }
      return Collections.emptyList();
    }
  };
  return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.LINE_MARKERS,
                                                   tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
                                                   renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
                                                   gotoTargets);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:NavigationGutterIconBuilder.java

示例15: JavaOverrideImplementMemberChooser

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private JavaOverrideImplementMemberChooser(final PsiMethodMember[] allElements,
		final PsiMethodMember[] onlyPrimaryElements,
		final NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
		final @NotNull Project project,
		final boolean isInsertOverrideVisible,
		final boolean merge,
		final boolean toImplement,
		final boolean sortedByOverriding)
{
	super(false, true, project, isInsertOverrideVisible, null, null);
	myAllElements = allElements;
	myOnlyPrimaryElements = onlyPrimaryElements;
	myLazyElementsWithPercent = lazyElementsWithPercent;
	myProject = project;
	myMerge = merge;
	myToImplement = toImplement;
	mySortedByOverriding = sortedByOverriding;
	resetElements(getInitialElements(allElements, onlyPrimaryElements, lazyElementsWithPercent, merge, toImplement, sortedByOverriding));
	init();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:21,代码来源:JavaOverrideImplementMemberChooser.java


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