Author: thomasobrien95
Date: Mon Jan 12 09:15:43 2009
New Revision: 2912

Added:
   trunk/src/icons/parts/noAccess.png   (contents, props changed)
Modified:
   trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeCellRenderer.java

Log:
Added a badge for failed DB connections and composed an icon for DBs with exceptions on them.

Modified: trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeCellRenderer.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeCellRenderer.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeCellRenderer.java Mon Jan 12 09:15:43 2009
@@ -22,9 +22,11 @@
 import java.awt.Color;
 import java.awt.Component;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;

+import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JTree;
 import javax.swing.tree.DefaultTreeCellRenderer;
@@ -40,6 +42,7 @@
 import ca.sqlpower.architect.SQLSchema;
 import ca.sqlpower.architect.SQLTable;
 import ca.sqlpower.architect.SQLIndex.Column;
+import ca.sqlpower.swingui.ComposedIcon;

 /**
  * The DBTreeCellRenderer renders nodes of a JTree which are of
@@ -67,7 +70,8 @@
public static final ImageIcon PK_ICON = new ImageIcon(DBTreeCellRenderer.class.getResource("icons/Index_key16.png")); public static final ImageIcon UNIQUE_INDEX_ICON = new ImageIcon(DBTreeCellRenderer.class.getResource("icons/Index_unique16.png")); public static final ImageIcon COLUMN_ICON = new ImageIcon(DBTreeCellRenderer.class.getResource("icons/Column16.png")); - public static final ImageIcon ERROR_ICON = new ImageIcon(DBTreeCellRenderer.class.getResource("icons/stop16.png")); + public static final ImageIcon ERROR_BADGE = new ImageIcon(ClassLoader.getSystemResource("icons/parts/noAccess.png")); + public static final Icon DB_ERROR_ICON = new ComposedIcon(Arrays.asList(DB_ICON, ERROR_BADGE));

private final List<IconFilter> iconFilterChain = new ArrayList<IconFilter>();

@@ -87,7 +91,7 @@
        
if (value instanceof SQLObject && ((SQLObject) value).getChildrenInaccessibleReason() != null) { logger.debug("Children are not accessible from the node " + ((SQLObject) value).getName());
-            setIcon(ERROR_ICON);
+            setIcon(DB_ERROR_ICON);
setToolTipText("Inaccessible: " + ((SQLObject) value).getChildrenInaccessibleReason());
         } else if (value instanceof SQLDatabase) {
                        SQLDatabase db = (SQLDatabase) value;

Added: trunk/src/icons/parts/noAccess.png
==============================================================================
Binary file. No diff available.

Reply via email to