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


Java Iconable.ICON_FLAG_VISIBILITY属性代码示例

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


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

示例1: update

@Override
public void update(PresentationData data) {
  final PsiElement value = getPsiElement();
  if (value == null || !value.isValid()) {
    setValue(null);
  }
  if (getPsiElement() == null) return;

  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()) {
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }

  LOG.assertTrue(value.isValid());

  Icon icon = value.getIcon(flags);
  data.setIcon(icon);
  data.setPresentableText(myName);
  if (isDeprecated()) {
    data.setAttributesKey(CodeInsightColors.DEPRECATED_ATTRIBUTES);
  }
  updateImpl(data);
  for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME, myProject)) {
    decorator.decorate(this, data);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:BaseSmartPointerPsiNode.java

示例2: update

@Override
public void update(PresentationData data) {
  final PsiElement value = getPsiElement();
  if (value == null || !value.isValid()) {
    setValue(null);
  }
  if (getPsiElement() == null) return;

  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()) {
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }

  LOG.assertTrue(value.isValid());

  Icon icon = IconDescriptorUpdaters.getIcon(value, flags);
  data.setIcon(icon);
  data.setPresentableText(myName);
  if (isDeprecated()) {
    data.setAttributesKey(CodeInsightColors.DEPRECATED_ATTRIBUTES);
  }
  updateImpl(data);
  for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME, myProject)) {
    decorator.decorate(this, data);
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:BaseSmartPointerPsiNode.java

示例3: customize

@Override
public void customize(JList list, PsiClass aClass, int index, boolean selected, boolean hasFocus) {
  if (aClass != null) {
    setText(getClassText(aClass));

    int flags = Iconable.ICON_FLAG_VISIBILITY;
    if (myShowReadOnly) {
      flags |= Iconable.ICON_FLAG_READ_STATUS;
    }
    Icon icon = aClass.getIcon(flags);
    if (icon != null) {
      setIcon(icon);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ClassCellRenderer.java

示例4: getIcon

@Override
public Icon getIcon(boolean open) {
  final PsiElement element = getElement();
  if (element != null) {
    int flags = Iconable.ICON_FLAG_READ_STATUS;
    if (!(element instanceof PsiFile) || !element.isWritable()) flags |= Iconable.ICON_FLAG_VISIBILITY;
    return element.getIcon(flags);
  }
  else {
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PsiTreeElementBase.java

示例5: getIconableFlags

@Iconable.IconFlags
protected int getIconableFlags() {
  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()) {
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  return flags;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AbstractPsiBasedNode.java

示例6: update

@Override
public boolean update() {
  PsiElement element = mySmartPointer.getElement();
  if (element == null) return true;
  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()){
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  Icon icon = null;
  try {
    icon = element.getIcon(flags);
  }
  catch (IndexNotReadyException ignored) {
  }
  Color color = null;

  if (isMarkModified() ){
    VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
    if (virtualFile != null) {
      color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
    }
  }
  if (CopyPasteManager.getInstance().isCutElement(element)) {
    color = CopyPasteManager.CUT_COLOR;
  }

  boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
  setIcon(icon);
  myColor = color;
  return changes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SmartElementDescriptor.java

示例7: customizeRenderer

public void customizeRenderer(ColoredTreeCellRenderer renderer) {
  if (myMethod == null) return;
  int flags = Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS;
  renderer.setIcon(myMethod.getIcon(flags));

  customizeRendererText(renderer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:MethodNodeBase.java

示例8: customizeRenderer

public JLabel customizeRenderer(final Object value, final boolean showReadOnly) {
  PyClass aClass = (PyClass) value;
  setText(getClassText(aClass));

  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (showReadOnly) {
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  Icon icon = aClass.getIcon(flags);
  if(icon != null) {
    setIcon(icon);
  }
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PyClassCellRenderer.java

示例9: update

@Override
public boolean update() {
  myElement = mySmartPointer.getElement();
  if (myElement == null) return true;
  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()){
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  Icon icon = null;
  try {
    icon = myElement.getIcon(flags);
  }
  catch (IndexNotReadyException e) {
  }
  Color color = null;

  if (isMarkModified() ){
    VirtualFile virtualFile = PsiUtilBase.getVirtualFile(myElement);
    if (virtualFile != null) {
      color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
    }
  }
  if (CopyPasteManager.getInstance().isCutElement(myElement)) {
    color = CopyPasteManager.CUT_COLOR;
  }

  boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
  setIcon(icon);
  myColor = color;
  return changes;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:SmartElementDescriptor.java

示例10: computeBaseIcon

@Nonnull
private static Icon computeBaseIcon(@Nonnull PsiElement element, int flags) {
  Icon icon = computeBaseIcon(element);
  if ((flags & Iconable.ICON_FLAG_VISIBILITY) > 0) {
    return new RowIcon(icon, ourVisibilityIconPlaceholder.getValue());
  }
  return icon;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:IconDescriptorUpdaters.java

示例11: getIcon

@Override
public Icon getIcon(boolean open) {
  final PsiElement element = getElement();
  if (element != null) {
    int flags = Iconable.ICON_FLAG_READ_STATUS;
    if (!(element instanceof PsiFile) || !element.isWritable()) flags |= Iconable.ICON_FLAG_VISIBILITY;
    return IconDescriptorUpdaters.getIcon(element, flags);
  }
  else {
    return null;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:PsiTreeElementBase.java

示例12: update

@RequiredDispatchThread
@Override
public boolean update() {
  PsiElement element = mySmartPointer.getElement();
  if (element == null) return true;
  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()){
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  Icon icon = null;
  try {
    icon = IconDescriptorUpdaters.getIcon(element, flags);
  }
  catch (IndexNotReadyException ignored) {
  }
  Color color = null;

  if (isMarkModified() ){
    VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
    if (virtualFile != null) {
      color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
    }
  }
  if (CopyPasteManager.getInstance().isCutElement(element)) {
    color = CopyPasteManager.CUT_COLOR;
  }

  boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
  setIcon(icon);
  myColor = color;
  return changes;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:SmartElementDescriptor.java

示例13: customizeRenderer

public void customizeRenderer(ColoredTreeCellRenderer renderer) {
  if (myMethod == null) return;
  int flags = Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS;
  renderer.setIcon(IconDescriptorUpdaters.getIcon(myMethod, flags));

  customizeRendererText(renderer);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:MethodNodeBase.java

示例14: processModifierList

public static void processModifierList(PsiElement element, IconDescriptor iconDescriptor, int flags)
{
	PsiModifierListOwner owner = (PsiModifierListOwner) element;

	if(owner.hasModifierProperty(PsiModifier.FINAL))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.FinalMark);
	}

	if(owner.hasModifierProperty(PsiModifier.STATIC))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.StaticMark);
	}

	if((flags & Iconable.ICON_FLAG_VISIBILITY) != 0)
	{
		if(owner.hasModifierProperty(PsiModifier.PUBLIC))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_public);
		}
		else if(owner.hasModifierProperty(PsiModifier.PRIVATE))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_private);
		}
		else if(owner.hasModifierProperty(PsiModifier.PROTECTED))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_protected);
		}
		else if(owner.hasModifierProperty(PsiModifier.PACKAGE_LOCAL))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_plocal);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:34,代码来源:JavaIconDescriptorUpdater.java

示例15: customize

@Override
public void customize(JList list, PsiClass aClass, int index, boolean selected, boolean hasFocus) {
  if (aClass != null) {
    setText(getClassText(aClass));

    int flags = Iconable.ICON_FLAG_VISIBILITY;
    if (myShowReadOnly) {
      flags |= Iconable.ICON_FLAG_READ_STATUS;
    }
    Icon icon = IconDescriptorUpdaters.getIcon(aClass, flags);
    if (icon != null) {
      setIcon(icon);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:ClassCellRenderer.java


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