in idea-plugin/src/main/java/com/jetbrains/ide/streamdeck/customization/CustomizableActionsPanel.java [62:126]
public CustomizableActionsPanel() {
//noinspection HardCodedStringLiteral
@SuppressWarnings("DialogTitleCapitalization")
Group rootGroup = new Group("root");
final DefaultMutableTreeNode root = new DefaultMutableTreeNode(rootGroup);
DefaultTreeModel model = new DefaultTreeModel(root);
myActionsTree = new Tree(model){
@Override
public void paint(Graphics g) {
super.paint(g);
Rectangle visibleRect = getVisibleRect();
Insets insets = getInsets();
if (insets != null && insets.right > 0) {
visibleRect.width -= JBUIScale.scale(9);
}
Rectangle clip = g.getClipBounds();
for (int row = 0; row < getRowCount(); row++) {
Rectangle rowBounds = getRowBounds(row);
rowBounds.x = 0;
rowBounds.width = Integer.MAX_VALUE;
if (rowBounds.intersects(clip)) {
Object node = getPathForRow(row).getLastPathComponent();
if (node instanceof DefaultMutableTreeNode) {
Object data = ((DefaultMutableTreeNode)node).getUserObject();
if (!(data instanceof Hyperlink)) {
Rectangle fullRowRect = new Rectangle(visibleRect.x, rowBounds.y, visibleRect.width, rowBounds.height);
paintRowData(this, data, fullRowRect, (Graphics2D)g);
}
}
}
}
}
// @Override
// public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
// if (value instanceof DefaultMutableTreeNode) {
// String path = ActionsTree.this.getPath((DefaultMutableTreeNode)value, true);
// return StringUtil.notNullize(path);
// }
// return super.convertValueToText(value, selected, expanded, leaf, row, hasFocus);
// }
};
myActionsTree.setRootVisible(false);
myActionsTree.setShowsRootHandles(true);
myActionsTree.setCellRenderer(createDefaultRenderer());
// RowsDnDSupport.install(myActionsTree, model);
patchActionsTreeCorrespondingToSchema(root);
TreeExpansionMonitor.install(myActionsTree);
myTopPanel.add(setupFilterComponent(myActionsTree), BorderLayout.CENTER);
myTopPanel.add(createToolbar(), BorderLayout.WEST);
myPanel.add(myTopPanel, BorderLayout.NORTH);
myPanel.add(ScrollPaneFactory.createScrollPane(myActionsTree), BorderLayout.CENTER);
JLabel hint = new JLabel("Use UP, DOWN, HOME, and END keys to quickly navigate between the search results.");
hint.setForeground(JBColor.gray);
hint.setIcon(AllIcons.Actions.IntentionBulb);
myPanel.add(ScrollPaneFactory.createScrollPane(hint, true), BorderLayout.SOUTH);
}