Author: jflesch
Date: 2006-12-14 21:19:27 +0000 (Thu, 14 Dec 2006)
New Revision: 11411
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
Log:
Report #972 : The indexes with a private key are now in Italic (later, they
will have another icon too)
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java 2006-12-14
21:08:00 UTC (rev 11410)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexCategory.java 2006-12-14
21:19:27 UTC (rev 11411)
@@ -465,6 +465,9 @@
if(children == null)
children = loadChildren();
+ if (children.size() <= 0)
+ return false;
+
for(final Iterator it = children.iterator();
it.hasNext();) {
final IndexTreeNode node =
(IndexTreeNode)((DefaultMutableTreeNode)it.next()).getUserObject();
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2006-12-14
21:08:00 UTC (rev 11410)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2006-12-14
21:19:27 UTC (rev 11411)
@@ -395,7 +395,6 @@
final
boolean hasFocus) {
setBackgroundNonSelectionColor(Color.WHITE);
setBackgroundSelectionColor(IndexTree.SELECTION_COLOR);
- setFont(new Font("Dialog", Font.PLAIN, 12));
if(value instanceof DefaultMutableTreeNode) {
final Object o =
((DefaultMutableTreeNode)value).getUserObject();
@@ -407,10 +406,26 @@
setBackgroundNonSelectionColor(IndexTree.LOADING_COLOR);
setBackgroundSelectionColor(IndexTree.LOADING_SELECTION_COLOR);
}
+
}
- if (((IndexTreeNode)o).hasChanged()) {
- setFont(new Font("Dialog", Font.BOLD,
12));
+ if (o instanceof IndexTreeNode) {
+ /* Remember that for the index category,
+ this kind of query is recursive */
+ boolean modifiable =
((IndexTreeNode)o).isModifiable();
+ boolean hasChanged =
((IndexTreeNode)o).hasChanged();
+
+ int style = 0;
+
+ if (modifiable)
+ style |= Font.ITALIC;
+ if (hasChanged)
+ style |= Font.BOLD;
+
+ if (style == 0)
+ style = Font.PLAIN;
+
+ setFont(new Font("Dialog", style, 12));
}
}