chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1300652 - /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java
Date Wed, 14 Mar 2012 17:26:10 GMT
Author: fmui
Date: Wed Mar 14 17:26:10 2012
New Revision: 1300652

URL: http://svn.apache.org/viewvc?rev=1300652&view=rev
Log:
Workbench: added time zone info to property editor

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

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java?rev=1300652&r1=1300651&r2=1300652&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/PropertyEditorFrame.java
Wed Mar 14 17:26:10 2012
@@ -39,6 +39,7 @@ import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.TimeZone;
 
 import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
@@ -575,12 +576,14 @@ public class PropertyEditorFrame extends
         private final SpinnerNumberModel hour;
         private final SpinnerNumberModel min;
         private final SpinnerNumberModel sec;
+        private final TimeZone timezone;
 
         public DateTimePropertyInputField(final Object value, final UpdateStatus status,
final Color bgColor) {
             setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
             setBackground(bgColor);
 
             GregorianCalendar cal = (value == null ? new GregorianCalendar() : (GregorianCalendar)
value);
+            timezone = cal.getTimeZone();
 
             day = new SpinnerNumberModel(cal.get(Calendar.DATE), 1, 31, 1);
             addSpinner(new JSpinner(day), status);
@@ -619,6 +622,8 @@ public class PropertyEditorFrame extends
             sec = new SpinnerNumberModel(cal.get(Calendar.SECOND), 0, 59, 1);
             JSpinner secSpinner = new JSpinner(sec);
             addSpinner(secSpinner, status);
+
+            add(new JLabel(" " + timezone.getDisplayName(true, TimeZone.SHORT)));
         }
 
         private void addSpinner(final JSpinner spinner, final UpdateStatus status) {
@@ -635,6 +640,8 @@ public class PropertyEditorFrame extends
         public Object getPropertyValue() {
             GregorianCalendar result = new GregorianCalendar();
 
+            result.setTimeZone(timezone);
+
             result.set(Calendar.YEAR, year.getNumber().intValue());
             int mi = 0;
             String ms = month.getValue().toString();



Mime
View raw message