public CheckTreeTableManager(JXTreeTable treeTable) { this.treetable = treeTable; this.tree = (JTree) treeTable.getCellRenderer(0, 0); selectionModel = new CheckTreeSelectionModel(tree.getModel()); tree.setCellRenderer(new DefaultTreeRenderer(new CheckTreeCellProvider(selectionModel))); treeTable.addMouseListener(this); selectionModel.addTreeSelectionListener(this); }
@Override protected void format(CellContext arg0) { JTree tree = (JTree) arg0.getComponent(); DefaultMutableTreeTableNode node = (DefaultMutableTreeTableNode) arg0.getValue(); Object obj = node.getUserObject(); if(obj instanceof FieldEntity){ TreePath path = tree.getPathForRow(arg0.getRow()); if (path != null) { if (selectionModel.isPathSelected(path, true)) {
/** * {@inheritDoc} <p> * * Here: implemented to set the icon. */ @Override protected void format(CellContext context) { rendererComponent.setIcon(getValueAsIcon(context)); }
/** * {@inheritDoc} */ @Override protected ComponentProvider<?> createDefaultComponentProvider() { return new LabelProvider(createDefaultStringValue()); }
/** * @param background */ public void setBackground(Color background) { componentController.getDefaultVisuals().setBackground(background); }
/** * @param foreground */ public void setForeground(Color foreground) { componentController.getDefaultVisuals().setForeground(foreground); }
/** * {@inheritDoc} <p> * * Here: implemented to set the icon. */ @Override protected void format(CellContext context) { rendererComponent.setIcon(getValueAsIcon(context)); }
/** * {@inheritDoc} */ @Override protected ComponentProvider<?> createDefaultComponentProvider() { return new LabelProvider(createDefaultStringValue()); }
/** * @param background */ public void setBackground(Color background) { componentController.getDefaultVisuals().setBackground(background); }
/** * @param foreground */ public void setForeground(Color foreground) { componentController.getDefaultVisuals().setForeground(foreground); }
/** * {@inheritDoc} <p> * * Here: implemented to set the icon. */ @Override protected void format(CellContext context) { rendererComponent.setIcon(getValueAsIcon(context)); }
/** * {@inheritDoc} */ @Override protected ComponentProvider<?> createDefaultComponentProvider() { return new LabelProvider(createDefaultStringValue()); }
/** * @param background */ public void setBackground(Color background) { componentController.getDefaultVisuals().setBackground(background); }
/** * @param foreground */ public void setForeground(Color foreground) { componentController.getDefaultVisuals().setForeground(foreground); }
/** * {@inheritDoc} <p> * * Here: implemented to set the icon. */ @Override protected void format(CellContext context) { rendererComponent.setIcon(getValueAsIcon(context)); }
/** * {@inheritDoc} */ @Override protected ComponentProvider createDefaultComponentProvider() { return new LabelProvider(createDefaultStringValue()); }
/** * @param background */ public void setBackground(Color background) { componentController.getDefaultVisuals().setBackground(background); }
/** * @param foreground */ public void setForeground(Color foreground) { componentController.getDefaultVisuals().setForeground(foreground); }
/** * {@inheritDoc} <p> * * Here: implemented to set the icon. */ @Override protected void format(CellContext context) { rendererComponent.setIcon(getValueAsIcon(context)); }
/** * @param background */ public void setBackground(Color background) { componentController.getDefaultVisuals().setBackground(background); }