我们可以使用http://gwtbootstrap3.github.io/gwtbootstrap3-demo/#fullcalendar中提到的 gwtbootstrap3 fullcalendar中提到的 gwtbootstrap3 fullcalendar与 UiBinder 一起使用吗?
我正在尝试将它与 UiBinder 一起使用,但该页面上没有出现任何内容。
我的 UiBinder 类的代码
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:org.gwtbootstrap3.client.ui.gwt">
<g:HTMLPanel ui:field="calendarContainer">
</g:HTMLPanel>
</ui:UiBinder>
对应视图类的代码
public class EventView extends ReverseCompositeView<IEventView.IEventPresenter> implements IEventView {
private static EventViewUiBinder uiBinder = GWT.create( EventViewUiBinder.class );
interface EventViewUiBinder extends UiBinder<Widget, EventView> {
}
@UiField
HTMLPanel calendarContainer;
@Override
public void createView() {
//don't create the view before to take advantage of the lazy loading mechanism
initializeCalendar();
initWidget( uiBinder.createAndBindUi( this ) );
}
private void initializeCalendar() {
final FullCalendar fc = new FullCalendar("event-calendar", ViewOption.month, true);
fc.addLoadHandler(new LoadHandler() {
@Override
public void onLoad(LoadEvent loadEvent) {
addEvents();
}
private void addEvents() {
for (int i = 0; i < 15; i++) {
Event calEvent = new Event("id "+ i, "this is event "+i);
int day = Random.nextInt(10);
Date start = new Date();
CalendarUtil.addDaysToDate(start, -1 * day);
calEvent.setStart(start);
if(i%3 ==0){
calEvent.setAllDay(true);
}else{
Date d = new Date(start.getTime());
d.setHours(d.getHours()+1);
calEvent.setEnd(d);
}
fc.addEvent(calEvent);
}
}
});
calendarContainer.add(fc);
}
}
我正在使用mvp4g
框架。