import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
+import javax.swing.ToolTipManager;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
public DbTreeRenderer(JDatabaseTree me)
{
us = me;
+ ToolTipManager.sharedInstance().registerComponent(dbviews);
}
private Component returnLabel(String txt)
value = vl.getUserObject();
if (value instanceof DbSourceProxy)
{
- val = (((DbSourceProxy) value).getDbName());
+ val = ((DbSourceProxy) value).getDbName();
+ if (((DbSourceProxy) value).getDescription() != null)
+ { // getName()
+ this.setToolTipText(((DbSourceProxy) value).getDescription());
+ }
}
else
{
if (value instanceof String)
{
- val = ((String) value);
+ val = (String) value;
}
}
}
if (value == null)
{
- val = ("");
+ val = "";
}
return super.getTreeCellRendererComponent(tree, val, selected,
expanded, leaf, row, hasFocus);
* @return
*/
public boolean isAlignmentSource();
+
+ /**
+ * Returns an (optional) description of the source, suitable for display as a
+ * tooltip, or null
+ *
+ * @return
+ */
+ public String getDescription();
}
\ No newline at end of file