Folks, I'm trying to make a fairly basic improvement to the default
GWT DatePicker. However, due to its design, I end up having to extend
(and largely reimplement) a few classes (incl CellGridImpl and
CalendarView).
Everything works fine with my implementation when compiling, and when
running as a webapp.
However, when I try to debug using DevMode, I get this error:
01:27:53.944 [ERROR] [analysisgraph] Unable to load module entry point
class com.masergy.ina.analysis.client.AnalysisEntryPoint (see
associated exception for details)
java.lang.IllegalAccessError: tried to access class
com.google.gwt.user.datepicker.client.DatePickerComponent from class
com.masergy.ina.analysis.client.widget.BoundedCalendarView
at
com.masergy.ina.analysis.client.widget.BoundedCalendarView.access
$1(BoundedCalendarView.java:1)
at com.masergy.ina.analysis.client.widget.BoundedCalendarView
$CellGrid$DateCell.update(BoundedCalendarView.java:133)
at
com.masergy.ina.analysis.client.widget.BoundedCalendarView.refresh(BoundedCalendarView.java:
339)
at
com.google.gwt.user.datepicker.client.DatePicker.refreshAll(DatePicker.java:
622)
at
com.google.gwt.user.datepicker.client.DatePicker.setCurrentMonth(DatePicker.java:
513)
at
com.google.gwt.user.datepicker.client.DatePicker.<init>(DatePicker.java:
282)
at
com.masergy.ina.analysis.client.widget.BoundedDatePicker.<init>(BoundedDatePicker.java:
36)
at
com.masergy.ina.analysis.client.widget.BoundedDateTimePicker.doLayout(BoundedDateTimePicker.java:
103)
at
com.masergy.ina.analysis.client.widget.BoundedDateTimePicker.<init>(BoundedDateTimePicker.java:
89)
[...]
update() is from code I've had to reimplement from CalendarView:
public void update(Date current) {
setEnabled(true);
getValue().setTime(current.getTime());
String value = getModel().formatDayOfMonth(getValue());
setText(value);
dateStyle = cellStyle;
if (isFiller()) {
dateStyle += " " + css().dayIsFiller();
} else {
String extraStyle =
getDatePicker().getStyleOfDate(current); // <-- line 133
if (extraStyle != null) {
dateStyle += " " + extraStyle;
}
}
// We want to certify that all date styles have " " before and
after
// them for ease of adding to and replacing them.
dateStyle += " ";
updateStyle();
}
getDatePicker() is an inherited method in the public class
CalendarView, but is from the package-protected DatePickerComponent
class.
Does this make any sense? Why is DatePicker so impossible to extend to
add any decent functionality? In my case, all I wanted was to override
the simple CalendarView.isDateEnabled() method to limit the range of
selectable days. But due to the overly paranoid method and field
access restrictions, I had to reimplement most of the entire package.
I'd like to avoid reimplementing the entire package, including CSS,
but I'm not sure that's even possible.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.