@@ -1247,8 +1247,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
private ListBox sec; | |||
private ListBox msec; | |||
private ListBox ampm; | |||
/** | |||
@@ -1313,19 +1311,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
} | |||
sec.addChangeHandler(this); | |||
} | |||
if (getResolution() == VDateField.RESOLUTION_MSEC) { | |||
msec = createListBox(); | |||
for (int i = 0; i < 1000; i++) { | |||
if (i < 10) { | |||
msec.addItem("00" + i); | |||
} else if (i < 100) { | |||
msec.addItem("0" + i); | |||
} else { | |||
msec.addItem("" + i); | |||
} | |||
} | |||
msec.addChangeHandler(this); | |||
} | |||
final String delimiter = getDateTimeService().getClockDelimeter(); | |||
if (isReadonly()) { | |||
@@ -1359,16 +1344,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
add(sec); | |||
} | |||
} | |||
if (getResolution() == VDateField.RESOLUTION_MSEC) { | |||
add(new VLabel(".")); | |||
if (isReadonly()) { | |||
final int m = getMilliseconds(); | |||
final String ms = m < 100 ? "0" + m : "" + m; | |||
add(new VLabel(m < 10 ? "0" + ms : ms)); | |||
} else { | |||
add(msec); | |||
} | |||
} | |||
if (getResolution() == VDateField.RESOLUTION_HOUR) { | |||
add(new VLabel(delimiter + "00")); // o'clock | |||
} | |||
@@ -1444,13 +1419,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
if (getResolution() >= VDateField.RESOLUTION_SEC) { | |||
sec.setSelectedIndex(value.getSeconds()); | |||
} | |||
if (getResolution() == VDateField.RESOLUTION_MSEC) { | |||
if (selected) { | |||
msec.setSelectedIndex(getMilliseconds()); | |||
} else { | |||
msec.setSelectedIndex(0); | |||
} | |||
} | |||
if (getDateTimeService().isTwelveHourClock()) { | |||
ampm.setSelectedIndex(value.getHours() < 12 ? 0 : 1); | |||
} | |||
@@ -1462,9 +1430,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
if (sec != null) { | |||
sec.setEnabled(isEnabled()); | |||
} | |||
if (msec != null) { | |||
msec.setEnabled(isEnabled()); | |||
} | |||
if (ampm != null) { | |||
ampm.setEnabled(isEnabled()); | |||
} | |||
@@ -1527,15 +1492,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
} | |||
event.preventDefault(); | |||
event.stopPropagation(); | |||
} else if (event.getSource() == msec) { | |||
final int ms = msec.getSelectedIndex(); | |||
DateTimeService.setMilliseconds(value, ms); | |||
if (timeChangeListener != null) { | |||
timeChangeListener.changed(value.getHours(), | |||
value.getMinutes(), value.getSeconds(), ms); | |||
} | |||
event.preventDefault(); | |||
event.stopPropagation(); | |||
} else if (event.getSource() == ampm) { | |||
final int h = hours.getSelectedIndex() | |||
+ (ampm.getSelectedIndex() * 12); | |||
@@ -1705,8 +1661,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
return SUBPART_MINUTE_SELECT; | |||
} else if (contains(time.sec, subElement)) { | |||
return SUBPART_SECS_SELECT; | |||
} else if (contains(time.msec, subElement)) { | |||
return SUBPART_MSECS_SELECT; | |||
} else if (contains(time.ampm, subElement)) { | |||
return SUBPART_AMPM_SELECT; | |||
@@ -1755,9 +1709,6 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
if (SUBPART_SECS_SELECT.equals(subPart)) { | |||
return time.sec.getElement(); | |||
} | |||
if (SUBPART_MSECS_SELECT.equals(subPart)) { | |||
return time.msec.getElement(); | |||
} | |||
if (SUBPART_AMPM_SELECT.equals(subPart)) { | |||
return time.ampm.getElement(); | |||
} |
@@ -32,7 +32,6 @@ public class VDateField extends FlowPanel implements Paintable, Field { | |||
public static final int RESOLUTION_HOUR = 8; | |||
public static final int RESOLUTION_MIN = 16; | |||
public static final int RESOLUTION_SEC = 32; | |||
public static final int RESOLUTION_MSEC = 64; | |||
public static final String WEEK_NUMBERS = "wn"; | |||
@@ -114,9 +113,7 @@ public class VDateField extends FlowPanel implements Paintable, Field { | |||
&& dts.getFirstDayOfWeek() == 1; | |||
int newResolution; | |||
if (uidl.hasVariable("msec")) { | |||
newResolution = RESOLUTION_MSEC; | |||
} else if (uidl.hasVariable("sec")) { | |||
if (uidl.hasVariable("sec")) { | |||
newResolution = RESOLUTION_SEC; | |||
} else if (uidl.hasVariable("min")) { | |||
newResolution = RESOLUTION_MIN; | |||
@@ -146,13 +143,11 @@ public class VDateField extends FlowPanel implements Paintable, Field { | |||
.getIntVariable("min") : 0; | |||
final int sec = (currentResolution >= RESOLUTION_SEC) ? uidl | |||
.getIntVariable("sec") : 0; | |||
final int msec = (currentResolution >= RESOLUTION_MSEC) ? uidl | |||
.getIntVariable("msec") : 0; | |||
// Construct new date for this datefield (only if not null) | |||
if (year > -1) { | |||
setCurrentDate(new Date((long) getTime(year, month, day, hour, min, | |||
sec, msec))); | |||
sec, 0))); | |||
} else { | |||
setCurrentDate(null); | |||
} |
@@ -123,14 +123,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, | |||
if (getCurrentResolution() > RESOLUTION_MIN) { | |||
getClient().updateVariable(getId(), "sec", | |||
newDate.getSeconds(), false); | |||
if (getCurrentResolution() == RESOLUTION_MSEC) { | |||
getClient().updateVariable( | |||
getId(), | |||
"msec", | |||
DateTimeService | |||
.getMilliseconds(newDate), | |||
false); | |||
} | |||
} | |||
} | |||
} |
@@ -146,9 +146,6 @@ public class VTextualDate extends VDateField implements Paintable, Field, | |||
frmString += ":mm"; | |||
if (currentResolution >= RESOLUTION_SEC) { | |||
frmString += ":ss"; | |||
if (currentResolution >= RESOLUTION_MSEC) { | |||
frmString += ".SSS"; | |||
} | |||
} | |||
} | |||
if (dts.isTwelveHourClock()) { | |||
@@ -298,10 +295,6 @@ public class VTextualDate extends VDateField implements Paintable, Field, | |||
currentResolution == VDateField.RESOLUTION_SEC | |||
&& immediate); | |||
} | |||
if (currentResolution == VDateField.RESOLUTION_MSEC) { | |||
getClient().updateVariable(getId(), "msec", | |||
currentDate != null ? getMilliseconds() : -1, immediate); | |||
} | |||
} | |||
@@ -61,17 +61,9 @@ public class DateField extends AbstractField<Date> implements | |||
* @since 7.0 | |||
*/ | |||
public enum Resolution { | |||
MILLISECOND, SECOND, MINUTE, HOUR, DAY, MONTH, YEAR; | |||
SECOND, MINUTE, HOUR, DAY, MONTH, YEAR; | |||
}; | |||
/** | |||
* Resolution identifier: milliseconds. | |||
* | |||
* @deprecated Use {@link Resolution#MILLISECOND} | |||
*/ | |||
@Deprecated | |||
public static final Resolution RESOLUTION_MSEC = Resolution.MILLISECOND; | |||
/** | |||
* Resolution identifier: seconds. | |||
* | |||
@@ -159,8 +151,6 @@ public class DateField extends AbstractField<Date> implements | |||
private static Map<Resolution, String> variableNameForResolution = new HashMap<DateField.Resolution, String>(); | |||
private static Map<Resolution, Integer> calendarFieldForResolution = new HashMap<DateField.Resolution, Integer>(); | |||
{ | |||
calendarFieldForResolution.put(Resolution.MILLISECOND, | |||
Calendar.MILLISECOND); | |||
calendarFieldForResolution.put(Resolution.SECOND, Calendar.SECOND); | |||
calendarFieldForResolution.put(Resolution.MINUTE, Calendar.MINUTE); | |||
calendarFieldForResolution.put(Resolution.HOUR, Calendar.HOUR_OF_DAY); | |||
@@ -168,7 +158,6 @@ public class DateField extends AbstractField<Date> implements | |||
calendarFieldForResolution.put(Resolution.MONTH, Calendar.MONTH); | |||
calendarFieldForResolution.put(Resolution.YEAR, Calendar.YEAR); | |||
variableNameForResolution.put(Resolution.MILLISECOND, "msec"); | |||
variableNameForResolution.put(Resolution.SECOND, "sec"); | |||
variableNameForResolution.put(Resolution.MINUTE, "min"); | |||
variableNameForResolution.put(Resolution.HOUR, "hour"); |
@@ -102,7 +102,6 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> { | |||
options.put("Hour", DateField.Resolution.HOUR); | |||
options.put("Min", DateField.Resolution.MINUTE); | |||
options.put("Sec", DateField.Resolution.SECOND); | |||
options.put("Msec", DateField.Resolution.MILLISECOND); | |||
createSelectAction("Resolution", category, options, "Year", | |||
resolutionCommand); |
@@ -74,7 +74,6 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> { | |||
options.put("Hour", DateField.Resolution.HOUR); | |||
options.put("Min", DateField.Resolution.MINUTE); | |||
options.put("Sec", DateField.Resolution.SECOND); | |||
options.put("Msec", DateField.Resolution.MILLISECOND); | |||
return createSelectAction("Resolution", options, "Year", | |||
new Command<InlineDateField, Resolution>() { | |||
@@ -74,7 +74,6 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> { | |||
options.put("Hour", DateField.Resolution.HOUR); | |||
options.put("Min", DateField.Resolution.MINUTE); | |||
options.put("Sec", DateField.Resolution.SECOND); | |||
options.put("Msec", DateField.Resolution.MILLISECOND); | |||
return createSelectAction("Resolution", options, "Year", | |||
new Command<PopupDateField, Resolution>() { | |||