本文整理汇总了Java中consulo.dotnet.psi.DotNetFieldDeclaration类的典型用法代码示例。如果您正苦于以下问题:Java DotNetFieldDeclaration类的具体用法?Java DotNetFieldDeclaration怎么用?Java DotNetFieldDeclaration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DotNetFieldDeclaration类属于consulo.dotnet.psi包,在下文中一共展示了DotNetFieldDeclaration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processElementsWithName
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@Override
public void processElementsWithName(
@NotNull String name, @NotNull Processor<NavigationItem> navigationItemProcessor, @NotNull FindSymbolParameters findSymbolParameters)
{
Project project = findSymbolParameters.getProject();
IdFilter idFilter = findSymbolParameters.getIdFilter();
GlobalSearchScope searchScope = findSymbolParameters.getSearchScope();
StubIndex.getInstance().processElements(CSharpIndexKeys.METHOD_INDEX, name, project, searchScope, idFilter,
DotNetLikeMethodDeclaration.class, (Processor) navigationItemProcessor);
StubIndex.getInstance().processElements(CSharpIndexKeys.EVENT_INDEX, name, project, searchScope, idFilter,
DotNetEventDeclaration.class, (Processor) navigationItemProcessor);
StubIndex.getInstance().processElements(CSharpIndexKeys.PROPERTY_INDEX, name, project, searchScope, idFilter,
DotNetPropertyDeclaration.class, (Processor) navigationItemProcessor);
StubIndex.getInstance().processElements(CSharpIndexKeys.FIELD_INDEX, name, project, searchScope, idFilter,
DotNetFieldDeclaration.class, (Processor) navigationItemProcessor);
}
示例2: getFields
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@RequiredReadAction
public static List<DotNetFieldDeclaration> getFields(CSharpTypeDeclaration typeDeclaration)
{
List<DotNetFieldDeclaration> fieldDeclarations = new ArrayList<>(5);
for(DotNetNamedElement dotNetNamedElement : typeDeclaration.getMembers())
{
if(dotNetNamedElement instanceof DotNetFieldDeclaration)
{
DotNetFieldDeclaration fieldDeclaration = (DotNetFieldDeclaration) dotNetNamedElement;
if(CSharpPsiUtilImpl.isNullOrEmpty(fieldDeclaration))
{
continue;
}
fieldDeclarations.add(fieldDeclaration);
}
}
return fieldDeclarations;
}
示例3: isConstant
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@RequiredReadAction
@Override
public boolean isConstant()
{
CSharpVariableDeclStub<DotNetFieldDeclaration> stub = getGreenStub();
if(stub != null)
{
return stub.isConstant();
}
return CSharpStubVariableImplUtil.getConstantKeywordElement(this) != null;
}
示例4: indexStub
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@Override
@RequiredReadAction
public void indexStub(@NotNull CSharpVariableDeclStub<DotNetFieldDeclaration> stub, @NotNull IndexSink indexSink)
{
String name = getName(stub);
if(!StringUtil.isEmpty(name))
{
indexSink.occurrence(CSharpIndexKeys.FIELD_INDEX, name);
}
}
示例5: getPresentableText
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@Nullable
@Override
@RequiredDispatchThread
public String getPresentableText()
{
PsiNamedElement value = getValue();
if(value instanceof DotNetLikeMethodDeclaration)
{
return CSharpElementPresentationUtil.formatMethod((DotNetLikeMethodDeclaration) value, CSharpElementPresentationUtil.METHOD_SCALA_LIKE_FULL);
}
else if(value instanceof DotNetTypeDeclaration)
{
return DotNetElementPresentationUtil.formatTypeWithGenericParameters((DotNetTypeDeclaration)value);
}
else if(value instanceof DotNetFieldDeclaration)
{
return CSharpElementPresentationUtil.formatField((DotNetFieldDeclaration) value);
}
else if(value instanceof DotNetPropertyDeclaration)
{
return CSharpElementPresentationUtil.formatProperty((DotNetPropertyDeclaration) value, CSharpElementPresentationUtil.PROPERTY_SCALA_LIKE_FULL);
}
else if(value instanceof DotNetNamespaceDeclaration)
{
return ((DotNetNamespaceDeclaration) value).getPresentableQName();
}
else
{
return value.getName();
}
}
示例6: formatField
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@NotNull
@RequiredReadAction
public static String formatField(@NotNull DotNetFieldDeclaration fieldDeclaration, int flags)
{
StringBuilder builder = new StringBuilder();
builder.append(fieldDeclaration.getName());
builder.append(":");
CSharpTypeRefPresentationUtil.appendTypeRef(fieldDeclaration, builder, fieldDeclaration.toTypeRef(true), typeRefMask(flags));
return builder.toString();
}
示例7: generatePropertyTextFromField
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@RequiredReadAction
private String generatePropertyTextFromField(String lineIndent, DotNetFieldDeclaration fieldDeclaration)
{
StringBuilder builder = new StringBuilder();
builder.append(lineIndent);
CSharpAccessModifier accessModifier = CSharpAccessModifier.findModifier(fieldDeclaration);
if(accessModifier != CSharpAccessModifier.NONE)
{
builder.append(accessModifier.getPresentableText()).append(" ");
}
if(fieldDeclaration.hasModifier(DotNetModifier.STATIC))
{
builder.append("static ");
}
builder.append(fieldDeclaration.getType().getText()).append(" ");
String fieldName = fieldDeclaration.getName();
builder.append(getPropertyName(fieldDeclaration.getProject(), fieldDeclaration.hasModifier(DotNetModifier.STATIC), fieldName));
builder.append("{get { return ").append(fieldName).append("; }");
if(!myReadonly)
{
builder.append("set { ").append(fieldName).append(" = value; }");
}
builder.append("}");
return builder.toString();
}
示例8: getPresentationText
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@RequiredReadAction
@NotNull
@Override
public String getPresentationText()
{
if(myDeclaration instanceof CSharpFieldDeclaration)
{
return CSharpElementPresentationUtil.formatField((DotNetFieldDeclaration) myDeclaration);
}
else if(myDeclaration instanceof CSharpPropertyDeclaration)
{
return CSharpElementPresentationUtil.formatProperty((CSharpPropertyDeclaration) myDeclaration, CSharpElementPresentationUtil.SCALA_FORMAT);
}
throw new IllegalArgumentException(myDeclaration.getClass().getName());
}
示例9: formatField
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@NotNull
@Deprecated
public static String formatField(@NotNull DotNetFieldDeclaration fieldDeclaration)
{
StringBuilder builder = new StringBuilder();
builder.append(fieldDeclaration.getName());
builder.append(":");
builder.append(fieldDeclaration.toTypeRef(true).getPresentableText());
return builder.toString();
}
示例10: fun
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@NotNull
@Override
@RequiredReadAction
public DotNetTypeRef fun(MsilClassEntryImpl msilClassEntry)
{
DotNetFieldDeclaration value = findFieldByName(msilClassEntry, "__value");
return value != null ? value.toTypeRef(false) : new MsilNativeTypeRefImpl(msilClassEntry, DotNetTypes.System.Int32);
}
示例11: findFieldByName
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@Nullable
private static DotNetFieldDeclaration findFieldByName(@NotNull DotNetTypeDeclaration tp, @NotNull String name)
{
for(DotNetNamedElement element : tp.getMembers())
{
if(element instanceof DotNetFieldDeclaration && Comparing.equal(element.getName(), name))
{
return (DotNetFieldDeclaration) element;
}
}
return null;
}
示例12: CSharpLightFieldDeclaration
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
public CSharpLightFieldDeclaration(DotNetFieldDeclaration original, DotNetTypeRef typeRef)
{
super(original);
myTypeRef = typeRef;
}
示例13: CSharpFieldDeclarationImpl
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
public CSharpFieldDeclarationImpl(@NotNull CSharpVariableDeclStub<DotNetFieldDeclaration> stub)
{
super(stub, CSharpStubElements.FIELD_DECLARATION);
}
示例14: createElement
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@NotNull
@Override
public DotNetFieldDeclaration createElement(@NotNull ASTNode astNode)
{
return new CSharpFieldDeclarationImpl(astNode);
}
示例15: createPsi
import consulo.dotnet.psi.DotNetFieldDeclaration; //导入依赖的package包/类
@Override
public DotNetFieldDeclaration createPsi(@NotNull CSharpVariableDeclStub<DotNetFieldDeclaration> fieldStub)
{
return new CSharpFieldDeclarationImpl(fieldStub);
}