本文整理汇总了Java中com.intellij.ui.ColoredTreeCellRenderer.getIcon方法的典型用法代码示例。如果您正苦于以下问题:Java ColoredTreeCellRenderer.getIcon方法的具体用法?Java ColoredTreeCellRenderer.getIcon怎么用?Java ColoredTreeCellRenderer.getIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.ColoredTreeCellRenderer
的用法示例。
在下文中一共展示了ColoredTreeCellRenderer.getIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customizeRenderer
import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer,
JTree tree,
@NotNull Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
renderer.clear();
renderer.setIcon(Bookmark.DEFAULT_ICON);
if (value instanceof Bookmark) {
Bookmark bookmark = (Bookmark)value;
BookmarkItem.setupRenderer(renderer, myProject, bookmark, selected);
if (renderer.getIcon() != null) {
renderer.setIcon(LayeredIcon.createHorizontalIcon(bookmark.getIcon(), renderer.getIcon()));
}
else {
renderer.setIcon(bookmark.getIcon());
}
}
else {
renderer.append(getListName(myProject));
}
}
示例2: customizeRenderer
import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer,
JTree tree,
@Nonnull Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
renderer.clear();
renderer.setIcon(Bookmark.DEFAULT_ICON);
if (value instanceof Bookmark) {
Bookmark bookmark = (Bookmark)value;
BookmarkItem.setupRenderer(renderer, myProject, bookmark, selected);
if (renderer.getIcon() != null) {
RowIcon icon = new RowIcon(3, RowIcon.Alignment.CENTER);
icon.setIcon(bookmark.getIcon(), 0);
icon.setIcon(JBUI.scale(EmptyIcon.create(1)), 1);
icon.setIcon(renderer.getIcon(), 2);
renderer.setIcon(icon);
}
else {
renderer.setIcon(bookmark.getIcon());
}
}
else {
renderer.append(getListName(myProject));
}
}