diff options
author | Artur Signell <artur@vaadin.com> | 2012-01-31 15:33:01 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-01-31 15:33:01 +0200 |
commit | c1f26940cd893dc5e89d2c6eb39d83ce668557fe (patch) | |
tree | cbe03a6cba732d0bcb1ddce2ece938dd07165489 /src | |
parent | 1d01f9204bd760789592238be039acef57616109 (diff) | |
parent | b1ae3cd70e2ca4656bb28f77ca79fe0efd29dd67 (diff) | |
download | vaadin-framework-c1f26940cd893dc5e89d2c6eb39d83ce668557fe.tar.gz vaadin-framework-c1f26940cd893dc5e89d2c6eb39d83ce668557fe.zip |
Merged 'b1ae3cd70e2ca4656bb28f77ca79fe0efd29dd67' (origin/6.8)
Conflicts:
WebContent/release-notes.html
tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java
Diffstat (limited to 'src')
4 files changed, 62 insertions, 13 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index f9be8bf019..fbf1b2c2d6 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -532,8 +532,12 @@ public class ApplicationConfiguration implements EntryPoint { // Prepare VConsole for debugging if (isDebugMode()) { Console console = GWT.create(Console.class); - console.setQuietMode(isQuietDebugMode()); - console.init(); + if (console instanceof VDebugConsole) { + // Methods from VDebugConsole not present in Console + VDebugConsole vDebugConsole = (VDebugConsole) console; + vDebugConsole.setQuietMode(isQuietDebugMode()); + vDebugConsole.init(); + } VConsole.setImplementation(console); } else { VConsole.setImplementation((Console) GWT.create(NullConsole.class)); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index b318fe0af3..99eadc9558 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -73,7 +73,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /**
* FocusChangeListener is notified when the panel changes its _focused_
- * value. It can be set with
+ * value.
*/
public interface FocusChangeListener {
void focusChanged(Date focusedDate);
@@ -192,21 +192,22 @@ public class VCalendarPanel extends FocusableFlexTable implements }
/**
- * Sets the focus to given day of current time. Used when moving in the
- * calender with the keyboard.
+ * Sets the focus to given date in the current view. Used when moving in the
+ * calendar with the keyboard.
*
* @param date
- * The day number from by Date.getDate()
+ * A Date representing the day of month to be focused. Must be
+ * one of the days currently visible.
*/
- private void focusDay(Date day) {
+ private void focusDay(Date date) {
// Only used when calender body is present
if (resolution > VDateField.RESOLUTION_MONTH) {
if (focusedDay != null) {
focusedDay.removeStyleDependentName(CN_FOCUSED);
}
- if (day != null && focusedDate != null) {
- focusedDate.setTime(day.getTime());
+ if (date != null && focusedDate != null) {
+ focusedDate.setTime(date.getTime());
int rowCount = days.getRowCount();
for (int i = 0; i < rowCount; i++) {
int cellCount = days.getCellCount(i);
@@ -214,7 +215,7 @@ public class VCalendarPanel extends FocusableFlexTable implements Widget widget = days.getWidget(i, j);
if (widget != null && widget instanceof Day) {
Day curday = (Day) widget;
- if (curday.getDate().equals(day)) {
+ if (curday.getDate().equals(date)) {
curday.addStyleDependentName(CN_FOCUSED);
focusedDay = curday;
focusedRow = i;
@@ -228,9 +229,12 @@ public class VCalendarPanel extends FocusableFlexTable implements }
/**
- * Sets the selection hightlight to a given date of current time
+ * Sets the selection highlight to a given day in the current view
*
* @param date
+ * A Date representing the day of month to be selected. Must be
+ * one of the days currently visible.
+ *
*/
private void selectDate(Date date) {
if (selectedDay != null) {
@@ -1483,6 +1487,9 @@ public class VCalendarPanel extends FocusableFlexTable implements }
+ /**
+ * A widget representing a single day in the calendar panel.
+ */
private class Day extends InlineHTML {
private static final String BASECLASS = VDateField.CLASSNAME
+ "-calendarpanel-day";
@@ -1629,6 +1636,8 @@ public class VCalendarPanel extends FocusableFlexTable implements if (day != null) {
Date date = day.getDate();
int id = date.getDate();
+ // Zero or negative ids map to days of the preceding month,
+ // past-the-end-of-month ids to days of the following month
if (date.getMonth() < displayedMonth.getMonth()) {
id -= DateTimeService.getNumberOfDaysInMonth(date);
} else if (date.getMonth() > displayedMonth.getMonth()) {
@@ -1696,8 +1705,8 @@ public class VCalendarPanel extends FocusableFlexTable implements return time.ampm.getElement();
}
if (subPart.startsWith(SUBPART_DAY)) {
- // can be less than 1 or greater than the number of days in the current month
- // these map to the "off-month" days
+ // Zero or negative ids map to days in the preceding month,
+ // past-the-end-of-month ids to days in the following month
int dayOfMonth = Integer.parseInt(subPart.substring(SUBPART_DAY
.length()));
Date date = new Date(displayedMonth.getYear(),
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index de68ae96a4..24763745e3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2404,6 +2404,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, break; } break; + case Event.ONCONTEXTMENU: + if (client.hasEventListeners(VScrollTable.this, + HEADER_CLICK_EVENT_ID)) { + // Prevent showing the browser's context menu when there is + // a right click listener. + event.preventDefault(); + } + break; + case Event.ONDBLCLICK: + fireHeaderClickedEvent(event); + break; case Event.ONTOUCHMOVE: case Event.ONMOUSEMOVE: if (dragging) { @@ -4540,6 +4551,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, .get(client).getPaintable(uidl.getId()); paintable.updateFromUIDL(uidl, client); } + pendingComponentPaints.clear(); } } diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index e6c8642b84..a6cf51e80f 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -898,4 +898,28 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier { bringToFront(); } + /** + * Notifies the child components and subwindows that the window is attached + * to the application. + */ + @Override + public void attach() { + super.attach(); + for (Window w : subwindows) { + w.attach(); + } + } + + /** + * Notifies the child components and subwindows that the window is detached + * from the application. + */ + @Override + public void detach() { + super.detach(); + for (Window w : subwindows) { + w.detach(); + } + } + } |