/** Allows to subclasses initialize table * @param t */ private void initializeTable() { table.setModel(tableModel); tableCell = new TableSheetCell(tableModel); table.setDefaultRenderer(Node.Property.class, tableCell); table.setDefaultEditor(Node.Property.class, tableCell); table.getTableHeader().setDefaultRenderer(tableCell); table.setShowGrid(false); table.setIntercellSpacing(new Dimension(0, 0)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.getTableHeader().setReorderingAllowed(false); if (UIManager.getColor("Panel.background") != null) { // NOI18N table.setBackground(UIManager.getColor("Panel.background")); // NOI18N table.setSelectionBackground(UIManager.getColor("Panel.background")); // NOI18N } }
/** Allows to subclasses initialize table * @param t */ private void initializeTable() { table.setModel(tableModel); TableSheetCell tableCell = new TableSheetCell(tableModel); table.setDefaultRenderer(Node.Property.class, tableCell); table.setDefaultEditor(Node.Property.class, tableCell); table.getTableHeader().setDefaultRenderer(tableCell); table.setShowGrid(false); table.setIntercellSpacing(new Dimension(0, 0)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.getTableHeader().setReorderingAllowed(false); if (UIManager.getColor("Panel.background") != null) { // NOI18N table.setBackground(UIManager.getColor("Panel.background")); // NOI18N table.setSelectionBackground(UIManager.getColor("Panel.background")); // NOI18N } }
/** Allows to subclasses initialize table * @param t */ private void initializeTable() { table.setModel(tableModel); TableSheetCell tableCell = new TableSheetCell(tableModel); table.setDefaultRenderer(Node.Property.class, tableCell); table.setDefaultEditor(Node.Property.class, tableCell); table.getTableHeader().setDefaultRenderer(tableCell); table.setShowGrid(false); table.setIntercellSpacing(new Dimension(0, 0)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.getTableHeader().setReorderingAllowed(false); if (UIManager.getColor("Panel.background") != null) { // NOI18N table.setBackground(UIManager.getColor("Panel.background")); // NOI18N table.setSelectionBackground(UIManager.getColor("Panel.background")); // NOI18N } }
public TreeTable(NodeTreeModel treeModel, NodeTableModel tableModel) { super(); setSurrendersFocusOnKeystroke(true); this.tree = new TreeTableCellRenderer(treeModel); this.tableModel = new TreeTableModelAdapter(tree, tableModel); tree.setCellRenderer(new NodeRenderer()); // Install a tableModel representing the visible rows in the tree. setModel(this.tableModel); // Force the JTable and JTree to share their row selection models. selectionWrapper = new ListToTreeSelectionModelWrapper(); tree.setSelectionModel(selectionWrapper); setSelectionModel(selectionWrapper.getListSelectionModel()); getTableHeader().setReorderingAllowed(false); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModelAdapter.class, tree); // Install property renderer and editor. tableCell = new TableSheetCell(this.tableModel); tableCell.setFlat(true); setDefaultRenderer(Property.class, tableCell); setDefaultEditor(Property.class, tableCell); getTableHeader().setDefaultRenderer(tableCell); getAccessibleContext().setAccessibleName(NbBundle.getMessage(TreeTable.class, "ACSN_TreeTable")); // NOI18N getAccessibleContext().setAccessibleDescription( // NOI18N NbBundle.getMessage(TreeTable.class, "ACSD_TreeTable")); // NOI18N setFocusCycleRoot(true); setFocusTraversalPolicy(new STPolicy()); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); putClientProperty("JTable.autoStartsEdit", Boolean.FALSE); initKeysAndActions(); }
TableSheetCell tableCell = new TableSheetCell(this.tableModel); tableCell.setFlat(true); setDefaultRenderer(Property.class, tableCell);
TableSheetCell tableCell = new TableSheetCell(this.tableModel); tableCell.setFlat(true); setDefaultRenderer(Property.class, tableCell);