本文整理匯總了Java中consulo.dotnet.psi.DotNetModifierListOwner.getModifierList方法的典型用法代碼示例。如果您正苦於以下問題:Java DotNetModifierListOwner.getModifierList方法的具體用法?Java DotNetModifierListOwner.getModifierList怎麽用?Java DotNetModifierListOwner.getModifierList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類consulo.dotnet.psi.DotNetModifierListOwner
的用法示例。
在下文中一共展示了DotNetModifierListOwner.getModifierList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRequiredOverrideModifier
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@RequiredReadAction
public static CSharpModifier getRequiredOverrideModifier(@NotNull DotNetModifierListOwner modifierListOwner)
{
DotNetModifierList modifierList = modifierListOwner.getModifierList();
if(modifierList == null)
{
return null;
}
if(modifierList.hasModifier(CSharpModifier.INTERFACE_ABSTRACT))
{
return null;
}
if(modifierList.hasModifierInTree(CSharpModifier.ABSTRACT) || modifierList.hasModifierInTree(CSharpModifier.VIRTUAL) || modifierList.hasModifierInTree(CSharpModifier.OVERRIDE))
{
return CSharpModifier.OVERRIDE;
}
return CSharpModifier.NEW;
}
示例2: invoke
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@Override
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException
{
DotNetModifierListOwner owner = CSharpIntentionUtil.findOwner(element);
if(owner == null || !owner.isWritable())
{
return;
}
DotNetModifierList modifierList = owner.getModifierList();
if(modifierList == null)
{
return;
}
beforeAdd(modifierList);
for(CSharpModifier modifier : ArrayUtil.reverseArray(myModifiers))
{
modifierList.addModifier(modifier);
}
}
示例3: getModifierList
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@Nullable
private DotNetModifierList getModifierList()
{
DotNetModifierListOwner element = myModifierElementOwnerPointer.getElement();
if(element == null)
{
return null;
}
return element.getModifierList();
}
示例4: check
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@RequiredReadAction
@NotNull
@Override
public List<CompilerCheckBuilder> check(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull DotNetModifierListOwner element)
{
DotNetModifierList modifierList = element.getModifierList();
if(modifierList == null)
{
return Collections.emptyList();
}
List<CompilerCheckBuilder> results = new SmartList<CompilerCheckBuilder>();
for(CSharpModifier modifier : CSharpModifier.values())
{
List<PsiElement> modifierElements = modifierList.getModifierElements(modifier);
if(modifierElements.size() <= 1)
{
continue;
}
for(PsiElement modifierElement : modifierElements)
{
results.add(newBuilder(modifierElement, modifier.getPresentableText()).addQuickFix(new RemoveModifierFix(modifier, element)));
}
}
return results;
}
示例5: check
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@RequiredReadAction
@NotNull
@Override
public List<CompilerCheckBuilder> check(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull DotNetModifierListOwner element)
{
DotNetModifierList modifierList = element.getModifierList();
if(modifierList == null)
{
return Collections.emptyList();
}
List<CompilerCheckBuilder> list = Collections.emptyList();
Owners owners = toOwners(element);
DotNetModifier[] modifiers = modifierList.getModifiers();
if(modifiers.length == 0)
{
return list;
}
for(DotNetModifier modifier : modifiers)
{
if(!owners.isValidModifier(modifier))
{
PsiElement modifierElement = modifierList.getModifierElement(modifier);
if(modifierElement == null)
{
continue;
}
if(list.isEmpty())
{
list = new ArrayList<CompilerCheckBuilder>(2);
}
list.add(newBuilder(modifierElement, modifier.getPresentableText()).addQuickFix(new RemoveModifierFix(modifier, element)));
}
}
return list;
}
示例6: check
import consulo.dotnet.psi.DotNetModifierListOwner; //導入方法依賴的package包/類
@RequiredReadAction
@NotNull
@Override
public List<CompilerCheckBuilder> check(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull DotNetModifierListOwner element)
{
DotNetModifierList modifierList = element.getModifierList();
if(modifierList == null)
{
return Collections.emptyList();
}
Map<CSharpAccessModifier, Map<CSharpModifier, PsiElement>> map = new LinkedHashMap<CSharpAccessModifier, Map<CSharpModifier, PsiElement>>(5);
for(CSharpAccessModifier value : CSharpAccessModifier.VALUES)
{
collectModifierElements(value, modifierList, map);
}
if(map.size() <= 1)
{
return Collections.emptyList();
}
List<CompilerCheckBuilder> list = new ArrayList<CompilerCheckBuilder>(map.size());
for(Map.Entry<CSharpAccessModifier, Map<CSharpModifier, PsiElement>> entry : map.entrySet())
{
RemoveModifierFix modifierFix = new RemoveModifierFix(entry.getValue().keySet().toArray(CSharpModifier.EMPTY_ARRAY), element);
for(Map.Entry<CSharpModifier, PsiElement> psiElement : entry.getValue().entrySet())
{
list.add(newBuilder(psiElement.getValue()).addQuickFix(modifierFix));
}
}
return list;
}