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

Java NullableLazyValue类代码示例

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

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



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

示例1: lookupElementForFile

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public FilePathLookupElement lookupElementForFile(
    Project project, VirtualFile file, @Nullable WorkspacePath workspacePath) {
  NullableLazyValue<Icon> icon =
      new NullableLazyValue<Icon>() {
        @Override
        protected Icon compute() {
          if (file.findChild("BUILD") != null) {
            return BlazeIcons.BuildFile;
          }
          if (file.isDirectory()) {
            return PlatformIcons.FOLDER_ICON;
          }
          PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
          return psiFile != null ? psiFile.getIcon(0) : AllIcons.FileTypes.Any_type;
        }
      };
  String fullLabel =
      workspacePath != null ? getFullLabel(workspacePath.relativePath()) : file.getPath();
  String itemText = workspacePath != null ? getItemText(workspacePath.relativePath()) : fullLabel;
  return new FilePathLookupElement(fullLabel, itemText, quoteType, icon);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:FileLookupData.java


示例2: MsilPropertyAsCSharpPropertyDeclaration

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilPropertyAsCSharpPropertyDeclaration(PsiElement parent, MsilPropertyEntry variable, List<Pair<DotNetXXXAccessor, MsilMethodEntry>> pairs)
{
	super(parent, getAdditionalModifiers(variable, pairs), variable);
	myAccessors = buildAccessors(this, pairs);

	myTypeForImplementValue = NullableLazyValue.of(() ->
	{
		String nameFromBytecode = getVariable().getNameFromBytecode();
		String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
		SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
		if(someType != null)
		{
			return new DummyType(getProject(), MsilPropertyAsCSharpPropertyDeclaration.this, someType);
		}
		return null;
	});
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:MsilPropertyAsCSharpPropertyDeclaration.java


示例3: MsilEventAsCSharpEventDeclaration

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilEventAsCSharpEventDeclaration(PsiElement parent, MsilEventEntry variable, List<Pair<DotNetXXXAccessor, MsilMethodEntry>> pairs)
{
	super(parent, MsilPropertyAsCSharpPropertyDeclaration.getAdditionalModifiers(variable, pairs), variable);
	myAccessors = MsilPropertyAsCSharpPropertyDeclaration.buildAccessors(this, pairs);

	myTypeForImplementValue = NullableLazyValue.of(() ->
	{
		String nameFromBytecode = getVariable().getNameFromBytecode();
		String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
		SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
		if(someType != null)
		{
			return new DummyType(getProject(), MsilEventAsCSharpEventDeclaration.this, someType);
		}
		return null;
	});
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:MsilEventAsCSharpEventDeclaration.java


示例4: MsilMethodAsCSharpMethodDeclaration

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilMethodAsCSharpMethodDeclaration(PsiElement parent, @Nullable MsilClassEntry declaration, @NotNull GenericParameterContext genericParameterContext, @NotNull MsilMethodEntry methodEntry)
{
	super(parent, CSharpModifier.EMPTY_ARRAY, methodEntry);
	myDelegate = declaration;

	setGenericParameterList(declaration != null ? declaration : methodEntry, genericParameterContext);

	myTypeForImplementValue = NullableLazyValue.of(() ->
	{
		String nameFromBytecode = myOriginal.getNameFromBytecode();
		String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
		SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
		if(someType != null)
		{
			return new DummyType(getProject(), MsilMethodAsCSharpMethodDeclaration.this, someType);
		}
		return null;
	});
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:21,代码来源:MsilMethodAsCSharpMethodDeclaration.java


示例5: MsilModifierListToCSharpModifierList

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilModifierListToCSharpModifierList(@NotNull CSharpModifier[] additional, @NotNull PsiElement parent, @NotNull DotNetModifierList modifierList)
{
	super(parent, modifierList);
	myAdditional = additional;
	myModifierList = modifierList;

	if(myModifierList.hasModifier(MsilTokens.SERIALIZABLE_KEYWORD))
	{
		addAdditionalAttribute(new CSharpLightAttributeBuilder(myModifierList, DotNetTypes.System.Serializable));
	}

	if(myModifierList.hasModifier(MsilTokens.BRACKET_OUT_KEYWORD))
	{
		addAdditionalAttribute(new CSharpLightAttributeBuilder(myModifierList, DotNetTypes2.System.Runtime.InteropServices.OutAttribute));
	}

	if(myModifierList.hasModifier(MsilTokens.BRACKET_IN_KEYWORD))
	{
		addAdditionalAttribute(new CSharpLightAttributeBuilder(myModifierList, DotNetTypes2.System.Runtime.InteropServices.InAttribute));
	}

	myAttributeHolderValue = NullableLazyValue.of(() -> ExternalAttributesUtil.findHolder(myModifierList));
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:MsilModifierListToCSharpModifierList.java


示例6: EvaluationContextImpl

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public EvaluationContextImpl(@NotNull SuspendContextImpl suspendContext, @NotNull StackFrameProxyImpl frameProxy)
{
	myThisObject = NullableLazyValue.of(() ->
	{
		try
		{
			return frameProxy.thisObject();
		}
		catch(EvaluateException ignore)
		{
		}
		return null;
	});
	myFrameProxy = frameProxy;
	mySuspendContext = suspendContext;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:EvaluationContextImpl.java


示例7: findMappingList

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@Nullable
public MappingList findMappingList(@NotNull List<Url> sourceUrls, @Nullable VirtualFile sourceFile, @Nullable NullableLazyValue<SourceResolver.Resolver> resolver) {
  MappingList mappings = sourceResolver.findMappings(sourceUrls, this, sourceFile);
  if (mappings == null && resolver != null) {
    SourceResolver.Resolver resolverValue = resolver.getValue();
    if (resolverValue != null) {
      mappings = sourceResolver.findMappings(sourceFile, this, resolverValue);
    }
  }
  return mappings;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SourceMap.java


示例8: processMappingsInLine

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public boolean processMappingsInLine(@NotNull List<Url> sourceUrls,
                                     int sourceLine,
                                     @NotNull MappingList.MappingsProcessorInLine mappingProcessor,
                                     @Nullable VirtualFile sourceFile,
                                     @Nullable NullableLazyValue<SourceResolver.Resolver> resolver) {
  MappingList mappings = findMappingList(sourceUrls, sourceFile, resolver);
  return mappings != null && mappings.processMappingsInLine(sourceLine, mappingProcessor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SourceMap.java


示例9: PathReference

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public PathReference(@NotNull String path, final @NotNull Function<PathReference, Icon> icon) {
  myPath = path;
  myIcon = new NullableLazyValue<Icon>() {
    @Override
    protected Icon compute() {
      return icon.fun(PathReference.this);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PathReference.java


示例10: setGenericParameterList

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
protected void setGenericParameterList(@NotNull DotNetGenericParameterListOwner owner, @NotNull GenericParameterContext genericParameterContext)
{
	DotNetGenericParameterList genericParameterList = owner.getGenericParameterList();
	myGenericParameterList = MsilGenericParameterListAsCSharpGenericParameterList.build(this, genericParameterList, genericParameterContext);
	myGenericConstraintListValue = new NullableLazyValue<CSharpLightGenericConstraintList>()
	{
		@Nullable
		@Override
		@RequiredReadAction
		protected CSharpLightGenericConstraintList compute()
		{
			return MsilAsCSharpBuildUtil.buildConstraintList(myGenericParameterList);
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:16,代码来源:MsilMethodAsCSharpLikeMethodDeclaration.java


示例11: PathReference

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public PathReference(@Nonnull String path, final @Nonnull Function<PathReference, Icon> icon) {
  myPath = path;
  myIcon = new NullableLazyValue<Icon>() {
    @Override
    protected Icon compute() {
      return icon.fun(PathReference.this);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:PathReference.java


示例12: getIcon

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public NullableLazyValue<Icon> getIcon() {
  return myIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TypeIconEP.java


示例13: getTypeName

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public NullableLazyValue<String> getTypeName() {
  return myName;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TypeNameEP.java


示例14: FilePathLookupElement

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
public FilePathLookupElement(
    String fullLabel, String itemText, QuoteType quoteWrapping, NullableLazyValue<Icon> icon) {
  super(fullLabel, quoteWrapping);
  this.itemText = itemText;
  this.icon = icon;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:7,代码来源:FilePathLookupElement.java


示例15: MsilPropertyAsCSharpIndexMethodDeclaration

import com.intellij.openapi.util.NullableLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilPropertyAsCSharpIndexMethodDeclaration(PsiElement parent, MsilPropertyEntry propertyEntry, List<Pair<DotNetXXXAccessor, MsilMethodEntry>> pairs)
{
	super(parent, propertyEntry);

	myAccessors = MsilPropertyAsCSharpPropertyDeclaration.buildAccessors(this, pairs);
	myModifierList = new MsilModifierListToCSharpModifierList(MsilPropertyAsCSharpPropertyDeclaration.getAdditionalModifiers(propertyEntry, pairs), this, propertyEntry.getModifierList());

	String name = getName();
	if(!Comparing.equal(name, DotNetPropertyDeclaration.DEFAULT_INDEX_PROPERTY_NAME))
	{
		CSharpLightAttributeBuilder attribute = new CSharpLightAttributeBuilder(propertyEntry, DotNetTypes.System.Runtime.CompilerServices.IndexerName);

		attribute.addParameterExpression(name);

		myModifierList.addAdditionalAttribute(attribute);
	}
	Pair<DotNetXXXAccessor, MsilMethodEntry> p = pairs.get(0);

	DotNetParameter firstParameter = p.getSecond().getParameters()[0];
	myParameters = new DotNetParameter[]{new MsilParameterAsCSharpParameter(this, firstParameter, this, 0)};

	myTypeForImplementValue = NullableLazyValue.of(() ->
	{
		String nameFromBytecode = myOriginal.getNameFromBytecode();
		String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
		SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
		if(someType != null)
		{
			return new DummyType(getProject(), MsilPropertyAsCSharpIndexMethodDeclaration.this, someType);
		}
		return null;
	});

	myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.toTypeRef(false), myOriginal));
	myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
	{
		DotNetParameter[] parameters = getParameters();
		DotNetTypeRef[] typeRefs = new DotNetTypeRef[parameters.length];
		for(int i = 0; i < parameters.length; i++)
		{
			DotNetParameter parameter = parameters[i];
			typeRefs[i] = parameter.toTypeRef(false);
		}
		return typeRefs;
	});
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:48,代码来源:MsilPropertyAsCSharpIndexMethodDeclaration.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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