Revision: 3692
Author: [email protected]
Date: Thu Jul 8 12:00:25 2010
Log: NEW - bug 2458: Create Critic Manager
http://trillian.sqlpower.ca/bugzilla/show_bug.cgi?id=2458
Refactored the tree cell renderer to let other places, like the enterprise
edition, to add additional renderer filters to update the tree icons.
http://code.google.com/p/power-architect/source/detail?r=3692
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java Thu May
27 07:42:00 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java Thu Jul
8 12:00:25 2010
@@ -131,6 +131,12 @@
* The model behind this DB tree.
*/
private final DBTreeModel treeModel;
+
+ /**
+ * The tree cell renderer that can have other icon filters added to it
to
+ * give the tree a unique look.
+ */
+ private final DBTreeCellRenderer treeCellRenderer;
// ----------- CONSTRUCTORS ------------
@@ -153,9 +159,9 @@
collapseAllAction = new JTreeCollapseAllAction(this,
Messages.getString("DBTree.collapseAllActionName"));
expandAllAction = new JTreeExpandAllAction(this,
Messages.getString("DBTree.expandAllActionName"));
addMouseListener(new PopupListener());
- DBTreeCellRenderer tcr = new DBTreeCellRenderer();
- tcr.addIconFilter(new ProfiledTableIconFilter());
- setCellRenderer(tcr);
+ treeCellRenderer = new DBTreeCellRenderer();
+ getTreeCellRenderer().addIconFilter(new ProfiledTableIconFilter());
+ setCellRenderer(getTreeCellRenderer());
selectAllChildTablesAction = new SelectAllChildTablesAction();
addMouseListener(new MouseListener() {
public void mouseReleased(MouseEvent e) {
@@ -1095,8 +1101,10 @@
return popupMenuEnabled;
}
-
-
+ public DBTreeCellRenderer getTreeCellRenderer() {
+ return treeCellRenderer;
+ }
+
protected class ShowInPlayPenAction extends AbstractAction {
public ShowInPlayPenAction() {
super(Messages.getString("DBTree.showInPlaypenAction"));
//$NON-NLS-1$
@@ -1134,5 +1142,5 @@
}
}
}
-
-}
+
+}