use of com.jsql.view.swing.tree.model.NodeModelEmpty in project jsql-injection by ron190.
the class ManagerDatabase method initializeTree.
private void initializeTree() {
// First node in tree
AbstractNodeModel nodeModelEmpty = new NodeModelEmpty(I18nViewUtil.valueByKey("DATABASE_EMPTY"));
var root = new DefaultMutableTreeNode(nodeModelEmpty);
I18nViewUtil.addComponentForKey("DATABASE_EMPTY", nodeModelEmpty);
this.tree = new TreeDatabase(root);
this.tree.setName("treeDatabases");
MediatorHelper.register(this.tree);
// Graphic manager for components
this.tree.setCellRenderer(new CellRendererNode());
this.tree.addFocusListener(this.getTreeFocusListener());
this.tree.addMouseListener(this.getTreeMouseListener());
this.tree.addKeyListener(this.getTreeKeyListener());
// Action manager for components
this.tree.setCellEditor(new CellEditorNode());
// Tree setting
// allows repaint nodes
this.tree.setEditable(true);
this.tree.setShowsRootHandles(true);
this.tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// Repaint Gif progress bar
this.tree.getModel().addTreeModelListener(new TreeModelGifListener());
this.tree.setBorder(BorderFactory.createEmptyBorder(0, 0, LightScrollPane.THUMB_SIZE, 0));
}
Aggregations