]> source.dussan.org Git - vaadin-framework.git/commitdiff
WindowedDemos and CalendarDemos adjusted slightly.
authorMarc Englund <marc.englund@itmill.com>
Fri, 5 Dec 2008 10:51:49 +0000 (10:51 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 5 Dec 2008 10:51:49 +0000 (10:51 +0000)
svn changeset:6092/svn branch:trunk

src/com/itmill/toolkit/demo/WindowedDemos.java
src/com/itmill/toolkit/demo/reservation/gwt/client/ui/ICalendarField.java

index 8b4f06ca2da5edec959bd308fca9b33e1f8e86e2..36a7cfc119c5671ab957729ae02ce9f612306434 100644 (file)
@@ -76,7 +76,7 @@ public class WindowedDemos extends com.itmill.toolkit.Application {
         Window w = (Window) windows.get(demoName);
         if (w == null) {
             w = new Window(demoName);
-            w.setWidth(520);
+            w.setWidth(560);
             w.setHeight(500);
             w.setPositionX(202);
             w.getLayout().setSizeFull();
index 6ae47ea05cd0cd86d41e0ef5b089867eca54e415..57ec7e675640f2226446c1758c3c83cdb3dbaa32 100644 (file)
@@ -184,7 +184,8 @@ public class ICalendarField extends IDateField {
         }\r
 \r
         // int hour = new Date().getHours()+1; // scroll to current hour\r
-        final int hour = this.date.getHours() + 1; // scroll to selected\r
+        Date d = (this.date != null ? this.date : new Date());\r
+        final int hour = d.getHours() + 1; // scroll to selected\r
         // hour\r
         final int h1 = hourPanel.getOffsetHeight() / 2;\r
         final int oh = hourTable.getOffsetHeight();\r
@@ -262,9 +263,13 @@ public class ICalendarField extends IDateField {
         }\r
 \r
         public List getEntries(Date date, int resolution) {\r
+            final ArrayList res = new ArrayList();\r
+            if (date == null) {\r
+                return res;\r
+            }\r
             final List entries = (List) dates.get(date.getYear() + ""\r
                     + date.getMonth() + "" + date.getDate());\r
-            final ArrayList res = new ArrayList();\r
+\r
             if (entries == null) {\r
                 return res;\r
             }\r