sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1627279 - in /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis: setup/About.java util/collection/TreeTableFormat.java
Date Wed, 24 Sep 2014 11:21:15 GMT
Author: desruisseaux
Date: Wed Sep 24 11:21:15 2014
New Revision: 1627279

URL: http://svn.apache.org/r1627279
Log:
TreeTableFormat checks for more types to localize.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java?rev=1627279&r1=1627278&r2=1627279&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8]
Wed Sep 24 11:21:15 2014
@@ -352,6 +352,7 @@ fill:   for (int i=0; ; i++) {
             if (name == null) {
                 name = resources.getString(nameKey);
             }
+            @SuppressWarnings("null")
             final TreeTable.Node node = section.newChild();
             node.setValue(NAME, name);
             if (children != null) {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1627279&r1=1627278&r2=1627279&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
[UTF-8] Wed Sep 24 11:21:15 2014
@@ -23,11 +23,13 @@ import java.util.Map;
 import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
+import java.util.Currency;
 import java.io.IOException;
 import java.text.Format;
 import java.text.ParsePosition;
 import java.text.ParseException;
 import java.util.regex.Matcher;
+import java.nio.charset.Charset;
 import org.opengis.util.Enumerated;
 import org.opengis.util.InternationalString;
 import org.apache.sis.io.LineAppender;
@@ -93,7 +95,7 @@ import static org.apache.sis.util.Charac
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3 (derived from geotk-2.0)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 public class TreeTableFormat extends TabularFormat<TreeTable> {
@@ -635,6 +637,18 @@ public class TreeTableFormat extends Tab
                 text = Types.getCodeTitle((Enumerated) value).toString(getDisplayLocale());
             } else if (value instanceof Enum<?>) {
                 text = CharSequences.upperCaseToSentence(((Enum<?>) value).name());
+            } else if (value instanceof Locale) {
+                final Locale locale = getDisplayLocale();
+                text = (locale != Locale.ROOT) ? ((Locale) value).getDisplayName(locale)
: value.toString();
+            } else if (value instanceof TimeZone) {
+                final Locale locale = getDisplayLocale();
+                text = (locale != Locale.ROOT) ? ((TimeZone) value).getDisplayName(locale)
: ((TimeZone) value).getID();
+            } else if (value instanceof Charset) {
+                final Locale locale = getDisplayLocale();
+                text = (locale != Locale.ROOT) ? ((Charset) value).displayName(locale) :
((Charset) value).name();
+            } else if (value instanceof Currency) {
+                final Locale locale = getDisplayLocale();
+                text = (locale != Locale.ROOT) ? ((Currency) value).getDisplayName(locale)
: value.toString();
             } else {
                 /*
                  * Check for a value-by-value format only as last resort.



Mime
View raw message