aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java27
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java8
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java8
3 files changed, 20 insertions, 23 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java
index 16d27bb053..0ca28481d1 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java
@@ -71,14 +71,11 @@ public class VCalendarPanel extends FocusableFlexTable implements
}
/**
- * Dispatches an event when the panel changes its _focused_ value.
+ * FocusChangeListener is notified when the panel changes its _focused_
+ * value. It can be set with
*/
- public interface ValueChangeListener {
- /**
- *
- * @return true if the calendar panel will not be used anymore
- */
- void changed(Date date);
+ public interface FocusChangeListener {
+ void focusChanged(Date focusedDate);
}
/**
@@ -167,7 +164,7 @@ public class VCalendarPanel extends FocusableFlexTable implements
private SubmitListener submitListener;
- private ValueChangeListener valueChangeListener;
+ private FocusChangeListener focusChangeListener;
private TimeChangeListener timeChangeListener;
@@ -583,8 +580,8 @@ public class VCalendarPanel extends FocusableFlexTable implements
}
if (getResolution() <= VDateField.RESOLUTION_MONTH
- && valueChangeListener != null) {
- valueChangeListener.changed(new Date(focusedDate.getTime()));
+ && focusChangeListener != null) {
+ focusChangeListener.focusChanged(new Date(focusedDate.getTime()));
}
Date start = new Date();
@@ -1625,14 +1622,14 @@ public class VCalendarPanel extends FocusableFlexTable implements
}
/**
- * The value change listener is triggered when the focused date changes by
- * user either clicking on a new date or by using the keyboard.
+ * The given FocusChangeListener is notified when the focused date changes
+ * by user either clicking on a new date or by using the keyboard.
*
* @param listener
- * The listener to trigger
+ * The FocusChangeListener to be notified
*/
- public void setValueChangeListener(ValueChangeListener listener) {
- valueChangeListener = listener;
+ public void setFocusChangeListener(FocusChangeListener listener) {
+ focusChangeListener = listener;
}
/**
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java
index d276ce23f9..c36d0dc788 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java
@@ -13,7 +13,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusOutListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.SubmitListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.TimeChangeListener;
-import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.ValueChangeListener;
+import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
public class VDateFieldCalendar extends VDateField {
@@ -71,8 +71,8 @@ public class VDateFieldCalendar extends VDateField {
}
if (currentResolution <= RESOLUTION_MONTH) {
- caleandarPanel.setValueChangeListener(new ValueChangeListener() {
- public void changed(Date date) {
+ caleandarPanel.setFocusChangeListener(new FocusChangeListener() {
+ public void focusChanged(Date date) {
Date date2 = new Date(caleandarPanel.getDate().getTime());
/*
* Update the value of calendarPanel
@@ -87,7 +87,7 @@ public class VDateFieldCalendar extends VDateField {
}
});
} else {
- caleandarPanel.setValueChangeListener(null);
+ caleandarPanel.setFocusChangeListener(null);
}
// Update possible changes
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
index ae7bea406e..35151cf4c3 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
@@ -27,7 +27,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusOutListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.SubmitListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.TimeChangeListener;
-import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.ValueChangeListener;
+import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
/**
* Represents a date selection component with a text field and a popup date
@@ -164,8 +164,8 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
calendarToggle.setEnabled(enabled);
if (currentResolution <= RESOLUTION_MONTH) {
- calendar.setValueChangeListener(new ValueChangeListener() {
- public void changed(Date date) {
+ calendar.setFocusChangeListener(new FocusChangeListener() {
+ public void focusChanged(Date date) {
updateValue(date);
buildDate();
Date date2 = calendar.getDate();
@@ -174,7 +174,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
}
});
} else {
- calendar.setValueChangeListener(null);
+ calendar.setFocusChangeListener(null);
}
if (currentResolution > RESOLUTION_DAY) {