本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
示例5: getIconableFlags
@Iconable.IconFlags
protected int getIconableFlags() {
int flags = Iconable.ICON_FLAG_VISIBILITY;
if (isMarkReadOnly()) {
flags |= Iconable.ICON_FLAG_READ_STATUS;
}
return flags;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}