We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello I'm working on adapting IDEA like code (fork named Consulo), found some different in cell render for tree:
It's simple Border panel where icon placed at east. https://github.com/consulo/consulo/blob/master/modules/desktop-awt/desktop-awt-ide-impl/src/main/java/consulo/desktop/awt/settings/OptionsTree.java
https://github.com/consulo/consulo/blob/master/modules/base/ui-ex-awt-api/src/main/java/consulo/ui/ex/awt/CellRendererPanel.java
private class MyRenderer extends CellRendererPanel implements TreeCellRenderer { final NodeRenderer myTextLabel = new NodeRenderer(); final JLabel myNodeIcon = new JLabel(); final JLabel myProjectIcon = new JLabel(); MyRenderer() { setLayout(new BorderLayout()); add(BorderLayout.CENTER, myTextLabel); add(BorderLayout.WEST, myNodeIcon); add(BorderLayout.EAST, myProjectIcon); setBorder(JBUI.Borders.empty(1, 0, 3, 10)); } @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { myTextLabel.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); myTextLabel.setFont(tree.getFont()); myProjectIcon.setIcon(null); Base baseNode = extractNode(value); if (baseNode instanceof ConfigurableNode) { Configurable configurable = baseNode.getConfigurable(); if (OptionsEditor.isProjectConfigurable(configurable)) { myProjectIcon.setIcon(TargetAWT.to(PlatformIconGroup.generalProjectconfigurable())); } } return this; } }
The text was updated successfully, but these errors were encountered:
Tree: support wide cell renderer (issue #922)
e14fe96
2a8e487
See PR #935
Sorry, something went wrong.
Tested patch from PR, and works as expected. Thanks you ;)
No branches or pull requests
Hello I'm working on adapting IDEA like code (fork named Consulo), found some different in cell render for tree:
It's simple Border panel where icon placed at east.
https://github.com/consulo/consulo/blob/master/modules/desktop-awt/desktop-awt-ide-impl/src/main/java/consulo/desktop/awt/settings/OptionsTree.java
https://github.com/consulo/consulo/blob/master/modules/base/ui-ex-awt-api/src/main/java/consulo/ui/ex/awt/CellRendererPanel.java
The text was updated successfully, but these errors were encountered: