import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.ui.PanelConnector.PanelState;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
public class WindowConnector extends AbstractComponentContainerConnector
implements BeforeShortcutActionListener, SimpleManagedLayout,
PostLayoutListener {
+ public static class WindowState extends PanelState {
+
+ }
+
private static final String CLICK_EVENT_IDENTIFIER = PanelConnector.CLICK_EVENT_IDENTIFIER;
private ClickEventHandler clickEventHandler = new ClickEventHandler(this,
}
// setting scrollposition must happen after children is rendered
- getWidget().contentPanel.setScrollPosition(uidl
- .getIntVariable("scrollTop"));
- getWidget().contentPanel.setHorizontalScrollPosition(uidl
- .getIntVariable("scrollLeft"));
+ getWidget().contentPanel.setScrollPosition(getState().getScrollTop());
+ getWidget().contentPanel.setHorizontalScrollPosition(getState()
+ .getScrollLeft());
// Center this window on screen if requested
// This had to be here because we might not know the content size before
window.updateShadowSizeAndPosition();
}
+ @Override
+ public WindowState getState() {
+ return (WindowState) super.getState();
+ }
}
import com.vaadin.event.ShortcutListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.PanelConnector.PanelState;
import com.vaadin.terminal.gwt.client.ui.VView;
import com.vaadin.terminal.gwt.client.ui.WindowConnector;
+import com.vaadin.terminal.gwt.client.ui.WindowConnector.WindowState;
/**
* A component that represents an application (browser native) window or a sub
@ClientWidget(WindowConnector.class)
public class Window extends Panel implements FocusNotifier, BlurNotifier {
- public class WindowState extends PanelState {
-
- }
-
/**
* <b>Sub window only</b>. Top offset in pixels for the sub window (relative
* to the parent application window) or -1 if unspecified.
bringToFront();
}
+ @Override
+ public WindowState getState() {
+ return (WindowState) super.getState();
+ }
+
+ @Override
+ protected WindowState createState() {
+ return new WindowState();
+ }
}