From: Marc Englund Date: Tue, 16 Oct 2007 14:43:41 +0000 (+0000) Subject: Generate reservations, styles X-Git-Tag: 6.7.0.beta1~5837 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=810de1f5969aef286f541743aa9ffdee5f5aa580;p=vaadin-framework.git Generate reservations, styles svn changeset:2529/svn branch:trunk --- diff --git a/WebContent/ITMILL/themes/reservr/styles.css b/WebContent/ITMILL/themes/reservr/styles.css index a2b059a765..6bf615f486 100644 --- a/WebContent/ITMILL/themes/reservr/styles.css +++ b/WebContent/ITMILL/themes/reservr/styles.css @@ -64,7 +64,7 @@ textarea.i-textfield { background: none; font-weight: bold; } -.i-button-selected-link { +#itmtk-ajax-window .i-button-selected-link { border: 0px; text-align: left; text-decoration: none; diff --git a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java index 112d47a46d..5e6f57abd3 100644 --- a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java +++ b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java @@ -50,12 +50,14 @@ public class ReservationApplication extends Application { db = new SampleDB(true); db.generateResources(); db.generateDemoUser(); + db.generateReservations(); Window mainWindow = new Window("Reservr"); setMainWindow(mainWindow); setTheme("reservr"); TabSheet mainTabs = new TabSheet(); + mainTabs.addStyleName(TabSheet.STYLE_NO_PADDING); mainWindow.addComponent(mainTabs); OrderedLayout reservationTab = new OrderedLayout(); @@ -70,6 +72,7 @@ public class ReservationApplication extends Application { Panel reservationPanel = new Panel("Reservation", new OrderedLayout( OrderedLayout.ORIENTATION_HORIZONTAL)); + reservationPanel.setStyle("light"); reservationTab.addComponent(reservationPanel); OrderedLayout infoLayout = new OrderedLayout(); @@ -109,7 +112,8 @@ public class ReservationApplication extends Application { initCalendarFieldPropertyIds(reservedFrom); reservationPanel.addComponent(reservedFrom); - Label arrowLabel = new Label("ยป"); + Label arrowLabel = new Label("»"); + arrowLabel.setContentMode(Label.CONTENT_XHTML); arrowLabel.setStyle("arrow"); reservationPanel.addComponent(arrowLabel); @@ -166,6 +170,7 @@ public class ReservationApplication extends Application { initCalendarFieldPropertyIds(allCalendar); allLayout.addComponent(allCalendar); allTable = new Table(); + allTable.setWidth(700); allTable.setColumnCollapsingAllowed(true); allTable.setColumnReorderingAllowed(true); allLayout.addComponent(allTable); diff --git a/src/com/itmill/toolkit/demo/reservation/ResourceSelectorPanel.java b/src/com/itmill/toolkit/demo/reservation/ResourceSelectorPanel.java index 8593336b42..69da622ef4 100644 --- a/src/com/itmill/toolkit/demo/reservation/ResourceSelectorPanel.java +++ b/src/com/itmill/toolkit/demo/reservation/ResourceSelectorPanel.java @@ -22,6 +22,7 @@ public class ResourceSelectorPanel extends Panel implements public ResourceSelectorPanel(String caption) { super(caption, new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); + setStyle("light"); } public void setResourceContainer(Container resources) { diff --git a/src/com/itmill/toolkit/demo/reservation/SampleDB.java b/src/com/itmill/toolkit/demo/reservation/SampleDB.java index cffebc5d71..7f2225eee1 100644 --- a/src/com/itmill/toolkit/demo/reservation/SampleDB.java +++ b/src/com/itmill/toolkit/demo/reservation/SampleDB.java @@ -6,6 +6,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.util.Calendar; +import java.util.Collection; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -373,6 +375,47 @@ public class SampleDB { } } + public void generateReservations() { + int days = 10; + String descriptions[] = { + "Picking up guests from airport", + "Sightseeing with the guests", + "Moving new servers from A to B", + "Shopping", + "Customer meeting", + "Guests arriving at harbour", + "Moving furniture", + "Taking guests to see town" + }; + Container cat = getCategories(); + Collection cIds = cat.getItemIds(); + for (Iterator it = cIds.iterator(); it.hasNext();) { + Object id = it.next(); + Item ci = cat.getItem(id); + String c = (String)ci.getItemProperty(Resource.PROPERTY_ID_CATEGORY).getValue(); + Container resources = getResources(c); + Collection rIds = resources.getItemIds(); + Calendar cal = Calendar.getInstance(); + //cal.add(Calendar.DAY_OF_MONTH, -days); + for (int i = 0;i