From f7ee8fb1d2c6b6d51e03486968f3bc20e7c44b4d Mon Sep 17 00:00:00 2001
From: Leif Åstrand Tools have been updated for Vaadin @vaadin-minor@ with
+ Tools have been updated for Vaadin @version-minor@ with
the following changes:
- Vaadin @version@ is a feature release that includes a number
- of enhancements as well as important bug fixes, as listed in
- the change log below. You can also
- view the change
+ log below. You can also view the list
of the closed issues at the Vaadin developer's site.
" : ": ";
- caption.setInnerHTML("" + calendarEvent.getTimeAsText()
- + "" + separator
- + Util.escapeHTML(calendarEvent.getCaption()));
+ String innerHtml;
+ String escapedCaption = Util.escapeHTML(calendarEvent.getCaption());
+ String timeAsText = calendarEvent.getTimeAsText();
+ if (bigMode) {
+ innerHtml = "" + timeAsText + "
" + escapedCaption;
+ } else {
+ innerHtml = "" + timeAsText + ": " + escapedCaption;
+ }
+ caption.setInnerHTML(innerHtml);
eventContent.setInnerHTML("");
}
diff --git a/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.html b/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.html
new file mode 100644
index 0000000000..38a6be24ce
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.java b/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.java
new file mode 100644
index 0000000000..d82e75c94d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/calendar/TestHideTimeAndSeparator.java
@@ -0,0 +1,105 @@
+package com.vaadin.tests.components.calendar;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Calendar;
+import com.vaadin.ui.components.calendar.event.CalendarEvent;
+import com.vaadin.ui.components.calendar.event.CalendarEventProvider;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+@Theme("tests-calendar")
+public class TestHideTimeAndSeparator extends AbstractTestUI {
+
+ class GenericEvent implements CalendarEvent {
+ private final Date start;
+ private final Date end;
+ private final String caption;
+ private final boolean hideTime;
+
+ public GenericEvent(Date start, Date end, String caption, boolean hideTime) {
+ this.start = start;
+ this.end = end;
+ this.caption = caption;
+ this.hideTime = hideTime;
+ }
+
+ @Override
+ public Date getStart() {
+ return start;
+ }
+
+ @Override
+ public Date getEnd() {
+ return end;
+ }
+
+ @Override
+ public String getCaption() {
+ return caption;
+ }
+
+ @Override
+ public String getDescription() {
+ return "This is a " + caption;
+ }
+
+ @Override
+ public String getStyleName() {
+ return hideTime ? "hide-time" : null;
+ }
+
+ @Override
+ public boolean isAllDay() {
+ return false;
+ }
+
+ }
+
+ CalendarEvent shortEventHidden = new GenericEvent(makeDate(2013, 1, 2, 8, 0), makeDate(2013, 1, 2, 8, 30), "Short event", true);
+ CalendarEvent longEventHidden = new GenericEvent(makeDate(2013, 1, 2, 10, 0), makeDate(2013, 1, 2, 12, 0), "Long event", true);
+ CalendarEvent shortEvent = new GenericEvent(makeDate(2013, 1, 3, 8, 0), makeDate(2013, 1, 3, 8, 30), "Short event", false);
+ CalendarEvent longEvent = new GenericEvent(makeDate(2013, 1, 3, 10, 0), makeDate(2013, 1, 3, 12, 0), "Long event", false);
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Calendar cal = new Calendar();
+ cal.setWidth("100%");
+ cal.setHeight("500px");
+
+ cal.addEvent(shortEventHidden);
+ cal.addEvent(longEventHidden);
+ cal.addEvent(shortEvent);
+ cal.addEvent(longEvent);
+
+ cal.setStartDate(makeDate(2013, 1, 1));
+ cal.setEndDate(makeDate(2013, 1, 7));
+ cal.setFirstVisibleHourOfDay(7);
+
+ addComponent(cal);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The time should be hideable by CSS";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 12460;
+ }
+
+ private Date makeDate(int year, int month, int day, int hour, int minute) {
+ java.util.Calendar juc = java.util.Calendar.getInstance();
+ juc.set(year, month, day, hour, minute);
+ return juc.getTime();
+ }
+ private Date makeDate(int year, int month, int day) {
+ java.util.Calendar juc = java.util.Calendar.getInstance();
+ juc.set(year, month, day);
+ return juc.getTime();
+ }
+}
--
cgit v1.2.3
From 61dd8f782775d042aa32ef33cda3c71a77224ede Mon Sep 17 00:00:00 2001
From: Artur Signell
+
+TestHideTimeAndSeparator
+
+open
+ /run/com.vaadin.tests.components.calendar.TestHideTimeAndSeparator?restartApplication
+
+
+
+assertNotVisible
+ vaadin=runcomvaadintestscomponentscalendarTestHideTimeAndSeparator::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[35]/domChild[0]/domChild[0]
+
+
+
+assertNotVisible
+ vaadin=runcomvaadintestscomponentscalendarTestHideTimeAndSeparator::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[34]/domChild[0]/domChild[0]
+
+
+
+assertVisible
+ vaadin=runcomvaadintestscomponentscalendarTestHideTimeAndSeparator::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]/domChild[0]/domChild[35]/domChild[0]/domChild[0]
+
+
+
+assertVisible
+ vaadin=runcomvaadintestscomponentscalendarTestHideTimeAndSeparator::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]/domChild[0]/domChild[34]/domChild[0]/domChild[0]
+
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentscalendarTestHideTimeAndSeparator::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]/domChild[0]/domChild[35]/domChild[0]/domChild[0]
+ 8:00 AM:
+
--
cgit v1.2.3
From 476e0b843ae07787c27ed48eba47870b7ffa833f Mon Sep 17 00:00:00 2001
From: Artur Signell
Overview of Vaadin @version@ Release
-- cgit v1.2.3