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


Java RequiredReadAction类代码示例

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


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

示例1: getAccessModifier

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
private static CSharpAccessModifier getAccessModifier(MsilMethodEntry second)
{
	if(second.hasModifier(MsilTokens.PRIVATE_KEYWORD))
	{
		return CSharpAccessModifier.PRIVATE;
	}
	else if(second.hasModifier(MsilTokens.PUBLIC_KEYWORD))
	{
		return CSharpAccessModifier.PUBLIC;
	}
	else if(second.hasModifier(MsilTokens.ASSEMBLY_KEYWORD) && second.hasModifier(MsilTokens.PROTECTED_KEYWORD))
	{
		return CSharpAccessModifier.PROTECTED_INTERNAL;
	}
	else if(second.hasModifier(MsilTokens.ASSEMBLY_KEYWORD))
	{
		return CSharpAccessModifier.INTERNAL;
	}
	else if(second.hasModifier(MsilTokens.PROTECTED_KEYWORD))
	{
		return CSharpAccessModifier.PROTECTED;
	}
	return CSharpAccessModifier.PUBLIC;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:26,代码来源:MsilPropertyAsCSharpPropertyDeclaration.java

示例2: MsilPropertyAsCSharpPropertyDeclaration

import consulo.annotations.RequiredReadAction; //导入依赖的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: MsilMethodAsCSharpLikeMethodDeclaration

import consulo.annotations.RequiredReadAction; //导入依赖的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

示例4: buildVisitor

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly)
{
	return new CSharpElementVisitor()
	{
		@Override
		@RequiredReadAction
		public void visitEmptyStatement(CSharpEmptyStatementImpl statement)
		{
			PsiElement parent = statement.getParent();
			if(parent instanceof CSharpBlockStatementImpl)
			{
				holder.registerProblem(statement, null, "Unnecessary Semicolon", new RemoveSemicolonFix(statement));
			}
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:UnnecessarySemicolonInspection.java

示例5: getUsingStatements

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
public CSharpUsingListChild[] getUsingStatements()
{
	List<CSharpUsingListChild> listChildren = new SmartList<>();
	for(String usingListChild : myUsingNamespaceChildren)
	{
		GlobalSearchScope resolveScope = myContext.getResolveScope();
		DotNetNamespaceAsElement namespace = DotNetPsiSearcher.getInstance(getProject()).findNamespace(usingListChild, resolveScope);
		if(namespace != null)
		{
			listChildren.add(new CSharpLightUsingNamespaceStatementBuilder(namespace, resolveScope));
		}
	}
	return ContainerUtil.toArray(listChildren, CSharpUsingListChild.ARRAY_FACTORY);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:18,代码来源:CSharpFragmentFileImpl.java

示例6: checkImpl

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public HighlightInfoFactory checkImpl(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull CSharpLocalVariable element)
{
	if(element.getInitializer() != null)
	{
		return null;
	}

	if(isUnused(element))
	{
		CompilerCheckBuilder builder = newBuilder(element.getNameIdentifier(), formatElement(element));
		if(!(element.getParent() instanceof CSharpForeachStatementImpl))
		{
			builder.addQuickFix(new DeleteLocalVariable(element));
		}
		return builder;
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:23,代码来源:CS0168.java

示例7: isConstant

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Contract("null -> false")
public static boolean isConstant(@Nullable PsiElement expression)
{
	if(expression instanceof CSharpConstantExpressionImpl)
	{
		return true;
	}

	if(expression instanceof CSharpPrefixExpressionImpl)
	{
		return ((CSharpPrefixExpressionImpl) expression).getOperatorElement().getOperatorElementType() == CSharpTokens.MINUS && isConstant(((CSharpPrefixExpressionImpl) expression).getExpression
				());
	}

	return false;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:18,代码来源:CSharpConstantUtil.java

示例8: toTypeRefImpl

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
public DotNetTypeRef toTypeRefImpl(boolean resolveFromInitializer)
{
	DotNetTypeRef typeRef = toTypeRefImpl0(resolveFromInitializer);
	if(hasModifier(CSharpModifier.REF))
	{
		return new CSharpRefTypeRef(getProject(), CSharpRefTypeRef.Type.ref, typeRef);
	}
	else if(hasModifier(CSharpModifier.OUT))
	{
		return new CSharpRefTypeRef(getProject(), CSharpRefTypeRef.Type.out, typeRef);
	}
	return typeRef;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:17,代码来源:CSharpLambdaParameterImpl.java

示例9: checkImpl

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public HighlightInfoFactory checkImpl(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull CSharpReferenceExpression element)
{
	CSharpReferenceExpression.ResolveToKind kind = element.kind();
	if(kind == CSharpReferenceExpression.ResolveToKind.TYPE_LIKE || kind == CSharpReferenceExpression.ResolveToKind.THIS)
	{
		return null;
	}
	// qualifier of another expression
	if(element.getParent() instanceof CSharpReferenceExpression)
	{
		return null;
	}
	PsiElement psiElement = element.resolve();
	return psiElement instanceof CSharpTypeDeclaration ? newBuilder(element, formatElement(psiElement)) : null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CS0118.java

示例10: createHighlightUsagesHandler

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@Nullable
@Override
@RequiredReadAction
public HighlightUsagesHandlerBase createHighlightUsagesHandler(Editor editor, PsiFile file)
{
	int offset = TargetElementUtil.adjustOffset(file, editor.getDocument(), editor.getCaretModel().getOffset());
	PsiElement target = file.findElementAt(offset);
	if(target != null && target.getNode().getElementType() == CSharpDocTokenType.XML_NAME)
	{
		CSharpDocTagImpl docTag = PsiTreeUtil.getParentOfType(target, CSharpDocTagImpl.class);
		if(docTag == null)
		{
			return null;
		}
		return new CSharpDocTagHighlightUsagesHandler(editor, file, docTag);
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CSharpDocHighlightUsagesHandlerFactory.java

示例11: resolveResult

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
protected DotNetTypeResolveResult resolveResult()
{
	CSharpLightTypeDeclarationBuilder builder = new CSharpLightTypeDeclarationBuilder(myScope);
	builder.withParentQName("System");
	builder.withName("ArrayImpl[" + CSharpTypeRefPresentationUtil.buildText(myInnerTypeRef, myScope) + "]");
	builder.addModifier(DotNetModifier.PUBLIC);

	builder.addExtendType(new CSharpTypeRefByQName(myScope, "System.Array"));

	if(myDimensions == 0)
	{
		builder.addExtendType(new CSharpGenericWrapperTypeRef(myScope.getProject(), new CSharpTypeRefByQName(myScope, DotNetTypes.System.Collections.Generic.IEnumerable$1), myInnerTypeRef));

		builder.addExtendType(new CSharpGenericWrapperTypeRef(myScope.getProject(), new CSharpTypeRefByQName(myScope, DotNetTypes.System.Collections.Generic.IList$1), myInnerTypeRef));
	}

	addIndexMethodWithType(DotNetTypes.System.Int32, builder, myScope, myDimensions, myInnerTypeRef);
	addIndexMethodWithType(DotNetTypes.System.UInt32, builder, myScope, myDimensions, myInnerTypeRef);
	addIndexMethodWithType(DotNetTypes.System.Int64, builder, myScope, myDimensions, myInnerTypeRef);
	addIndexMethodWithType(DotNetTypes.System.UInt64, builder, myScope, myDimensions, myInnerTypeRef);

	return new ArrayResolveResult(builder, myDimensions, myInnerTypeRef);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:27,代码来源:CSharpArrayTypeRef.java

示例12: getRightExpression

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@Nullable
@RequiredReadAction
public DotNetExpression getRightExpression()
{
	PsiElement operatorElement = getOperatorElement();
	PsiElement nextSibling = operatorElement.getNextSibling();
	while(nextSibling != null)
	{
		if(nextSibling instanceof DotNetExpression)
		{
			return (DotNetExpression) nextSibling;
		}
		nextSibling = nextSibling.getNextSibling();
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:17,代码来源:CSharpBinaryExpressionImpl.java

示例13: resolveTypeForParameter

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@NotNull
@RequiredReadAction
public static DotNetTypeRef resolveTypeForParameter(CSharpLambdaExpressionImpl target, int parameterIndex)
{
	CSharpLambdaResolveResult leftTypeRef = resolveLeftLambdaTypeRef(target);
	if(leftTypeRef == null)
	{
		return DotNetTypeRef.ERROR_TYPE;
	}

	if(leftTypeRef == CSharpUndefinedLambdaResolveResult.INSTANCE)
	{
		return DotNetTypeRef.UNKNOWN_TYPE;
	}
	DotNetTypeRef[] leftTypeParameters = leftTypeRef.getParameterTypeRefs();
	DotNetTypeRef typeRef = ArrayUtil2.safeGet(leftTypeParameters, parameterIndex);
	return ObjectUtil.notNull(typeRef, DotNetTypeRef.ERROR_TYPE);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CSharpLambdaExpressionImplUtil.java

示例14: getParameterName

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
private static String getParameterName(DotNetVariable variable)
{
	if(variable instanceof DotNetParameter)
	{
		return variable.getName();
	}

	String name = variable.getName();
	assert name != null;
	char ch = name.charAt(0);
	if(Character.isUpperCase(ch))
	{
		return StringUtil.decapitalize(name);
	}
	else if(ch == '_')
	{
		return name.substring(1, name.length());
	}
	return name;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:22,代码来源:ConstructorChooseMember.java

示例15: findExtensionMethodGroupByName

import consulo.annotations.RequiredReadAction; //导入依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public CSharpElementGroup<CSharpMethodDeclaration> findExtensionMethodGroupByName(@NotNull String name)
{
	Map<String, CSharpElementGroup<PsiElement>> map = myOtherCollectorValue.getValue().toMap();
	if(map == null)
	{
		return null;
	}
	CSharpElementGroup<PsiElement> elementGroup = map.get(name);
	if(elementGroup == null)
	{
		return null;
	}

	return filterElementGroupToExtensionGroup(elementGroup);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CSharpBaseResolveContext.java


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