【发布时间】:2019-03-22 14:54:09
【问题描述】:
如何设置 PsiFileNode 或其子节点的背景颜色? 我知道如何更改 PsiFileNode 文件名前景
public class MarkedFile extends PsiFileNode {
private Color backgroundColor;
public MarkedFile(Project project, @NotNull PsiFile value, ViewSettings viewSettings, Color backgroundColor) {
super(project, value, viewSettings);
this.backgroundColor = backgroundColor;
}
public Color getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(Color backgroundColor) {
this.backgroundColor = backgroundColor;
}
@NotNull
@Override
protected PresentationData createPresentation() {
PresentationData presentationData = super.createPresentation();
presentationData.setForcedTextForeground(backgroundColor);
return presentationData;
}
}
但是如何设置文件的背景颜色,因为我们可以在“target”或“out”java目录中看到它
【问题讨论】:
标签: java intellij-idea intellij-plugin