chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1524453 - /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
Date Wed, 18 Sep 2013 15:25:05 GMT
Author: fmui
Date: Wed Sep 18 15:25:05 2013
New Revision: 1524453

URL: http://svn.apache.org/r1524453
Log:
Workbench: distinguish between an empty string and a "not set" value

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java?rev=1524453&r1=1524452&r2=1524453&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CollectionRenderer.java
Wed Sep 18 15:25:05 2013
@@ -18,11 +18,13 @@
  */
 package org.apache.chemistry.opencmis.workbench.swing;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.util.Collection;
 import java.util.GregorianCalendar;
 
 import javax.swing.JTable;
+import javax.swing.UIManager;
 import javax.swing.table.DefaultTableCellRenderer;
 
 import org.apache.chemistry.opencmis.commons.definitions.Choice;
@@ -31,6 +33,18 @@ import org.apache.chemistry.opencmis.wor
 public class CollectionRenderer extends DefaultTableCellRenderer {
     private static final long serialVersionUID = 1L;
 
+    private static final String NOT_SET_COLOR;
+
+    static {
+        Color notSetColor = UIManager.getColor("Label.disabledText");
+        if (notSetColor != null) {
+            NOT_SET_COLOR = String.format("#%1$02x%2$02x%3$02x", notSetColor.getRed(), notSetColor.getGreen(),
+                    notSetColor.getBlue());
+        } else {
+            NOT_SET_COLOR = "#8e8f91";
+        }
+    }
+
     public CollectionRenderer() {
         super();
     }
@@ -54,8 +68,8 @@ public class CollectionRenderer extends 
     protected void setValue(Object value) {
         Collection<?> col = (Collection<?>) value;
 
-        if ((col == null) || (col.isEmpty())) {
-            super.setValue("");
+        if (col == null || col.isEmpty()) {
+            super.setValue("<html><span><font color=" + NOT_SET_COLOR + "><i>not
set</i></font></span>");
             return;
         }
 



Mime
View raw message