• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NotNullLazyValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: TemplateEngineProvider

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public TemplateEngineProvider(Project project, NotNullLazyValue<ModificationTracker> tracker) {
  super(project);

  this.tracker = tracker;
  for (TemplateEngine engine : TemplateEngine.values()) {
    engines.put("catberry-" + engine, engine);
  }
}
 
开发者ID:catberry,项目名称:catberry-idea-plugin,代码行数:9,代码来源:TemplateEngineProvider.java


示例17: getInitialElements

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static PsiMethodMember[] getInitialElements(PsiMethodMember[] allElements,
                                                    PsiMethodMember[] onlyPrimaryElements,
                                                    NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
                                                    boolean merge,
                                                    boolean toImplement,
                                                    boolean sortByOverriding) {
  final boolean showElementsWithPercents = sortByOverriding && !toImplement;
  final PsiMethodMember[] defaultElements = toImplement || merge ? allElements : onlyPrimaryElements;
  return showElementsWithPercents ? lazyElementsWithPercent.getValue() : defaultElements;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaOverrideImplementMemberChooser.java


示例18: registerDomain

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public void registerDomain(@NotNull String name, @NotNull NotNullLazyValue commands, boolean overridable) {
  if (domains.containsKey(name)) {
    if (overridable) {
      return;
    }
    else {
      throw new IllegalArgumentException(name + " is already registered");
    }
  }

  domains.put(name, commands);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:JsonRpcServer.java


示例19: RelatedItemLineMarkerInfo

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public RelatedItemLineMarkerInfo(@NotNull T element, @NotNull TextRange range, Icon icon, int updatePass,
                                 @Nullable Function<? super T, String> tooltipProvider,
                                 @Nullable GutterIconNavigationHandler<T> navHandler,
                                 @NotNull GutterIconRenderer.Alignment alignment,
                                 @NotNull NotNullLazyValue<Collection<? extends GotoRelatedItem>> targets) {
  super(element, range, icon, updatePass, tooltipProvider, navHandler, alignment);
  myTargets = targets;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RelatedItemLineMarkerInfo.java


示例20: InspectionManagerEx

import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public InspectionManagerEx(final Project project) {
  super(project);
  if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        toolWindowManager.registerToolWindow(ToolWindowId.INSPECTION, true, ToolWindowAnchor.BOTTOM, project);
        return ContentFactory.SERVICE.getInstance().createContentManager(new TabbedPaneContentUI(), true, project);
      }
    };
  }
  else {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.INSPECTION, true, ToolWindowAnchor.BOTTOM, project);
        ContentManager contentManager = toolWindow.getContentManager();
        toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowInspection);
        new ContentManagerWatcher(toolWindow, contentManager);
        return contentManager;
      }
    };
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:InspectionManagerEx.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WKBReader类代码示例发布时间:2022-05-21
下一篇:
Java XmlConfigUtils类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap