import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
-import com.vaadin.terminal.gwt.client.ContainerResizedListener;
import com.vaadin.terminal.gwt.client.TooltipInfo;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VTooltip;
public class VMenuBar extends SimpleFocusablePanel implements
- CloseHandler<PopupPanel>, ContainerResizedListener, KeyPressHandler,
- KeyDownHandler, FocusHandler, SubPartAware {
+ CloseHandler<PopupPanel>, KeyPressHandler, KeyDownHandler,
+ FocusHandler, SubPartAware {
// The hierarchy of VMenuBar is a bit weird as VMenuBar is the Paintable,
// used for the root menu but also used for the sub menus.
}
}
- @Override
- public void setWidth(String width) {
- if (Util.equals(this.width, width)) {
- return;
- }
-
- this.width = width;
-
- Util.setWidthExcludingPaddingAndBorder(this, width, 0);
-
+ void updateSize() {
+ // Take from setWidth
if (!subMenu) {
// Only needed for root level menu
hideChildren();
public void iLayout() {
iLayout(false);
+ updateSize();
}
public void iLayout(boolean iconLoadEvent) {
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.VMenuBar.CustomMenuItem;
-public class VMenuBarPaintable extends VAbstractPaintableWidget {
+public class VMenuBarPaintable extends VAbstractPaintableWidget implements
+ ResizeRequired {
/**
* This method must be implemented to update the client-side component from
* UIDL data received from server.
return (VMenuBar) super.getWidgetForPaintable();
}
+ public void onResize() {
+ getWidgetForPaintable().iLayout();
+ }
}