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


Java PsiMember.getModifierList方法代码示例

本文整理汇总了Java中com.intellij.psi.PsiMember.getModifierList方法的典型用法代码示例。如果您正苦于以下问题:Java PsiMember.getModifierList方法的具体用法?Java PsiMember.getModifierList怎么用?Java PsiMember.getModifierList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.PsiMember的用法示例。


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

示例1: setVisibilityIcon

import com.intellij.psi.PsiMember; //导入方法依赖的package包/类
@Override
protected void setVisibilityIcon(MemberInfo memberInfo, RowIcon icon) {
  PsiMember member = memberInfo.getMember();
  PsiModifierList modifiers = member != null ? member.getModifierList() : null;
  if (modifiers != null) {
    VisibilityIcons.setVisibilityIcon(modifiers, icon);
  }
  else {
    icon.setIcon(IconUtil.getEmptyIcon(true), VISIBILITY_ICON_POSITION);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MemberSelectionTable.java

示例2: setVisibilityIcon

import com.intellij.psi.PsiMember; //导入方法依赖的package包/类
@Override
protected void setVisibilityIcon(GrMemberInfo memberInfo, RowIcon icon) {
  PsiMember member = memberInfo.getMember();
  PsiModifierList modifiers = member != null ? member.getModifierList() : null;
  if (modifiers != null) {
    VisibilityIcons.setVisibilityIcon(modifiers, icon);
  }
  else {
    icon.setIcon(IconUtil.getEmptyIcon(true), VISIBILITY_ICON_POSITION);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GrMemberSelectionTable.java

示例3: addApplicableProcessors

import com.intellij.psi.PsiMember; //导入方法依赖的package包/类
private void addApplicableProcessors(@NotNull PsiMember psiMember, @NotNull Collection<LombokProcessorData> target) {
  final PsiModifierList psiModifierList = psiMember.getModifierList();
  if (null != psiModifierList) {
    for (PsiAnnotation psiAnnotation : psiModifierList.getAnnotations()) {
      for (Processor processor : getProcessors(psiAnnotation)) {
        target.add(new LombokProcessorData(processor, psiAnnotation));
      }
    }
  }
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:11,代码来源:LombokProcessorProvider.java

示例4: fixModifierList

import com.intellij.psi.PsiMember; //导入方法依赖的package包/类
private void fixModifierList(PsiMember member, PsiMember newMember, final UsageInfo[] usages) throws IncorrectOperationException
{
	PsiModifierList modifierList = newMember.getModifierList();

	if(modifierList != null && myTargetClass.isInterface())
	{
		modifierList.setModifierProperty(PsiModifier.PUBLIC, false);
		modifierList.setModifierProperty(PsiModifier.PROTECTED, false);
		modifierList.setModifierProperty(PsiModifier.PRIVATE, false);
		if(newMember instanceof PsiClass)
		{
			modifierList.setModifierProperty(PsiModifier.STATIC, false);
		}
		return;
	}

	if(myNewVisibility == null)
	{
		return;
	}

	final List<UsageInfo> filtered = new ArrayList<UsageInfo>();
	for(UsageInfo usage : usages)
	{
		if(usage instanceof MoveMembersUsageInfo && member == ((MoveMembersUsageInfo) usage).member)
		{
			filtered.add(usage);
		}
	}
	UsageInfo[] infos = filtered.toArray(new UsageInfo[filtered.size()]);
	VisibilityUtil.fixVisibility(UsageViewUtil.toElements(infos), newMember, myNewVisibility);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:33,代码来源:MoveMembersProcessor.java

示例5: insert

import com.intellij.psi.PsiMember; //导入方法依赖的package包/类
@Override
public void insert(@NotNull final PsiClass aClass, @Nullable PsiElement anchor, boolean before) throws IncorrectOperationException
{
	final PsiMember existingMember;
	if(myMember instanceof PsiField)
	{
		existingMember = aClass.findFieldByName(myMember.getName(), false);
	}
	else if(myMember instanceof PsiMethod)
	{
		existingMember = aClass.findMethodBySignature((PsiMethod) myMember, false);
	}
	else
	{
		existingMember = null;
	}
	if(existingMember == null || !myMergeIfExists)
	{
		PsiElement newMember = GenerateMembersUtil.insert(aClass, myMember, anchor, before);
		myMember = (T) JavaCodeStyleManager.getInstance(aClass.getProject()).shortenClassReferences(newMember);
		LOG.assertTrue(myMember.isValid(), myMember);
	}
	else
	{
		final PsiModifierList modifierList = myMember.getModifierList();
		final PsiModifierList existingModifierList = existingMember.getModifierList();
		if(modifierList != null && existingModifierList != null)
		{
			final PsiAnnotation[] psiAnnotations = modifierList.getAnnotations();
			PsiElement annoAnchor = existingModifierList.getAnnotations().length > 0 ? existingModifierList.getAnnotations()[0] : existingModifierList.getFirstChild();
			if(psiAnnotations.length > 0)
			{
				for(PsiAnnotation annotation : psiAnnotations)
				{
					final PsiAnnotation existingAnno = existingModifierList.findAnnotation(annotation.getQualifiedName());
					if(existingAnno != null)
					{
						annoAnchor = existingAnno.replace(annotation);
					}
					else
					{
						existingModifierList.addBefore(annotation, annoAnchor);
					}
				}
			}
		}
		myMember = (T) existingMember;
		if(!myMember.isValid())
		{
			LOG.error("invalid member: " + myMember +
					" existing member: " + existingMember.isValid() +
					" self modified list: " + modifierList +
					" existing modified list: " + existingModifierList);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:57,代码来源:PsiGenerationInfo.java


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