本文整理汇总了Java中com.intellij.ide.todo.nodes.SummaryNode类的典型用法代码示例。如果您正苦于以下问题:Java SummaryNode类的具体用法?Java SummaryNode怎么用?Java SummaryNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SummaryNode类属于com.intellij.ide.todo.nodes包,在下文中一共展示了SummaryNode类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTreeCellRendererComponent
import com.intellij.ide.todo.nodes.SummaryNode; //导入依赖的package包/类
@Override
public Component getTreeCellRendererComponent(JTree tree, Object obj, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
Component result;
Object userObject = ((DefaultMutableTreeNode)obj).getUserObject();
if (userObject instanceof SummaryNode) {
myNodeRenderer.getTreeCellRendererComponent(tree, userObject.toString(), selected, expanded, leaf, row, hasFocus);
myNodeRenderer.setFont(UIUtil.getTreeFont().deriveFont(Font.BOLD));
myNodeRenderer.setIcon(null);
result = myNodeRenderer;
}
else if (userObject instanceof NodeDescriptor && userObject instanceof HighlightedRegionProvider) {
NodeDescriptor descriptor = (NodeDescriptor)userObject;
HighlightedRegionProvider regionProvider = (HighlightedRegionProvider)userObject;
myColorTreeCellRenderer.getTreeCellRendererComponent(tree, obj, selected, expanded, leaf, row, hasFocus);
for (HighlightedRegion region : regionProvider.getHighlightedRegions()) {
myColorTreeCellRenderer.addHighlighter(region.startOffset, region.endOffset, region.textAttributes);
}
myColorTreeCellRenderer.setIcon(descriptor.getIcon());
result = myColorTreeCellRenderer;
}
else {
result = myNodeRenderer.getTreeCellRendererComponent(tree, null, selected, expanded, leaf, row, hasFocus);
}
if (result instanceof JComponent) {
((JComponent)result).setOpaque(!selected);
}
return result;
}