Package com.jsql.view.swing.tree.model
Class NodeModelEmpty
java.lang.Object
com.jsql.view.swing.tree.model.AbstractNodeModel
com.jsql.view.swing.tree.model.NodeModelEmpty
- Direct Known Subclasses:
NodeModelColumn
Model for default item used on an empty tree.
-
Constructor Summary
ConstructorDescriptionNodeModelEmpty
(Column column) NodeModelEmpty
(String textNode) Flat node for empty tree. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildMenu
(JPopupMenuCustomExtract tablePopupMenu, TreePath path) Display a popupmenu on mouse right click if needed.getComponent
(JTree tree, Object nodeRenderer, boolean isSelected, boolean isLeaf, boolean hasFocus) Draw the panel component based on node model.protected Icon
getLeafIcon
(boolean leaf) Get icon displayed next to the node text.boolean
Check if menu should be opened.void
Run injection process (see GUIMediator.model().dao).void
showPopup
(DefaultMutableTreeNode currentTableNode, TreePath path, MouseEvent e) Display a popup menu for a database or table node.Methods inherited from class com.jsql.view.swing.tree.model.AbstractNodeModel
displayProgress, getElementDatabase, getIndexProgress, getPanel, getParent, isContainingSelection, isLoaded, isLoading, isProgressing, isRunning, isSelected, setContainingSelection, setIndexProgress, setIsEdited, setLoaded, setLoading, setProgressing, setRunning, setSelected, setText, toString
-
Constructor Details
-
NodeModelEmpty
Flat node for empty tree.- Parameters:
textNode
-
-
NodeModelEmpty
-
-
Method Details
-
getComponent
public Component getComponent(JTree tree, Object nodeRenderer, boolean isSelected, boolean isLeaf, boolean hasFocus) Description copied from class:AbstractNodeModel
Draw the panel component based on node model.- Overrides:
getComponent
in classAbstractNodeModel
- Returns:
-
getLeafIcon
Description copied from class:AbstractNodeModel
Get icon displayed next to the node text.- Specified by:
getLeafIcon
in classAbstractNodeModel
- Parameters:
leaf
- True will display an arrow icon, false won't- Returns:
- Icon to display
-
runAction
public void runAction()Description copied from class:AbstractNodeModel
Run injection process (see GUIMediator.model().dao). Used by database and table nodes.- Specified by:
runAction
in classAbstractNodeModel
-
buildMenu
Description copied from class:AbstractNodeModel
Display a popupmenu on mouse right click if needed.- Specified by:
buildMenu
in classAbstractNodeModel
- Parameters:
tablePopupMenu
- Menu to displaypath
- Treepath of current node
-
showPopup
Description copied from class:AbstractNodeModel
Display a popup menu for a database or table node.- Overrides:
showPopup
in classAbstractNodeModel
- Parameters:
currentTableNode
- Current nodepath
- Path of current node
-
isPopupDisplayable
public boolean isPopupDisplayable()Description copied from class:AbstractNodeModel
Check if menu should be opened. i.e: does not show menu on database except during injection.- Specified by:
isPopupDisplayable
in classAbstractNodeModel
- Returns:
- True if popupup should be opened, false otherwise
-