public GoogleCalendarPanel(CalendarTaskManager calendarManager) { // style this element as absolute position DOM.setStyleAttribute(this.getElement(), "position", "absolute"); calendarTaskManager = calendarManager; configureCalendar(); createDatePickerDialog(); setHeaderVisible(false); setBodyBorder(false); setBorders(false); setTopComponent(createCalendarToolbar()); add(calendar); // window events to handle resizing Window.enableScrolling(false); Window.addResizeHandler( new ResizeHandler() { public void onResize(ResizeEvent event) { resizeTimer.schedule(500); int h = event.getHeight(); } }); DeferredCommand.addCommand( new Command() { public void execute() { LayoutContainer center = (LayoutContainer) Registry.get(AppView.CENTER_PANEL); calendar.setHeight(center.getHeight() - calendarHeightSize + "px"); } }); }
@Override public void run() { int newHeight = Window.getClientHeight(); int newWidth = Window.getClientWidth(); if (newHeight != height) { height = newHeight; LayoutContainer center = (LayoutContainer) Registry.get(AppView.CENTER_PANEL); calendar.setHeight(center.getHeight() - calendarHeightSize + "px"); calendar.doSizing(); calendar.doLayout(); } }