Search in sources :

Example 1 with NodeModelEmpty

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));
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CellRendererNode(com.jsql.view.swing.tree.CellRendererNode) CellEditorNode(com.jsql.view.swing.tree.CellEditorNode) TreeDatabase(com.jsql.view.swing.tree.TreeDatabase) AbstractNodeModel(com.jsql.view.swing.tree.model.AbstractNodeModel) NodeModelEmpty(com.jsql.view.swing.tree.model.NodeModelEmpty)

Aggregations

CellEditorNode (com.jsql.view.swing.tree.CellEditorNode)1 CellRendererNode (com.jsql.view.swing.tree.CellRendererNode)1 TreeDatabase (com.jsql.view.swing.tree.TreeDatabase)1 AbstractNodeModel (com.jsql.view.swing.tree.model.AbstractNodeModel)1 NodeModelEmpty (com.jsql.view.swing.tree.model.NodeModelEmpty)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1