mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change YAMLKeyValue icon retrieval
This will help delegate to KV's icon easier as well as preserve an ability to overload it in IconProvider
This commit is contained in:
@@ -138,6 +138,12 @@ public class YAMLKeyValueImpl extends YAMLPsiElementImpl implements YAMLKeyValue
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Icon getElementIcon(@IconFlags int flags) {
|
||||
return PlatformIcons.PROPERTY_ICON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemPresentation getPresentation() {
|
||||
final YAMLFile yamlFile = (YAMLFile)getContainingFile();
|
||||
@@ -155,7 +161,7 @@ public class YAMLKeyValueImpl extends YAMLPsiElementImpl implements YAMLKeyValue
|
||||
}
|
||||
|
||||
public Icon getIcon(boolean open) {
|
||||
return PlatformIcons.PROPERTY_ICON;
|
||||
return YAMLKeyValueImpl.this.getIcon(0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.jetbrains.yaml.structureView;
|
||||
|
||||
import com.intellij.ide.structureView.StructureViewTreeElement;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -82,8 +81,8 @@ public class YAMLStructureViewElement implements StructureViewTreeElement {
|
||||
}
|
||||
|
||||
public Icon getIcon(boolean open) {
|
||||
final PsiElement value = kv.getValue();
|
||||
return value instanceof YAMLScalar ? PlatformIcons.PROPERTY_ICON : PlatformIcons.XML_TAG_ICON;
|
||||
final YAMLValue value = kv.getValue();
|
||||
return value instanceof YAMLScalar ? kv.getIcon(0) : PlatformIcons.XML_TAG_ICON;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user