com.intellij.ui.RowIcon Java Examples

The following examples show how to use com.intellij.ui.RowIcon. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IconUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static Icon getEmptyIcon(boolean showVisibility) {
  RowIcon baseIcon = new RowIcon(2);
  baseIcon.setIcon(EmptyIcon.create(getDefaultNodeIconSize()), 0);
  if (showVisibility) {
    baseIcon.setIcon(EmptyIcon.create(getDefaultNodeIconSize()), 1);
  }
  return baseIcon;
}
 
Example #2
Source File: BookmarksFavoriteListProvider.java    From consulo with Apache License 2.0 5 votes vote down vote up
@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.getDefaultIcon());
  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(TargetAWT.to(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));
  }
}
 
Example #3
Source File: XQueryIcons.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
private static Icon createRowIcon(Icon icon1, Icon icon2) {
    RowIcon rowIcon = new RowIcon(2);
    rowIcon.setIcon(icon1, 0);
    rowIcon.setIcon(icon2, 1);
    return rowIcon;
}