import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VNotification.HideEvent;
import com.vaadin.terminal.gwt.client.ui.VView;
+import com.vaadin.terminal.gwt.client.ui.VViewPaintable;
import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
private Timer loadTimer3;
private Element loadElement;
- private final VView view;
+ private final VViewPaintable view;
protected boolean applicationRunning = false;
if (loadElement == null) {
loadElement = DOM.createDiv();
DOM.setStyleAttribute(loadElement, "position", "absolute");
- DOM.appendChild(view.getElement(), loadElement);
+ DOM.appendChild(view.getWidgetForPaintable().getElement(),
+ loadElement);
VConsole.log("inserting load indicator");
}
DOM.setElementProperty(loadElement, "className", "v-loading-indicator");
meta = json.getValueMap("meta");
if (meta.containsKey("repaintAll")) {
repaintAll = true;
- view.clear();
+ view.getWidgetForPaintable().clear();
getPaintableMap().clear();
if (meta.containsKey("invalidLayouts")) {
validatingLayouts = true;
@Deprecated
private void updateCaption(VPaintableWidget paintable, UIDL uidl) {
- if (paintable instanceof VAbstractPaintableWidget) {
- VPaintableWidget parent = ((VAbstractPaintableWidget) paintable)
- .getParentPaintable();
- if (parent instanceof VAbstractPaintableWidgetContainer) {
- ((VPaintableWidgetContainer) parent).updateCaption(paintable,
- uidl);
- return;
- }
- }
-
- // Old Container interface
- // FIXME: Remove
- Util.getLayout(paintable.getWidgetForPaintable()).updateCaption(
- paintable, uidl);
-
+ VPaintableWidgetContainer parent = paintable.getParentPaintable();
+ parent.updateCaption(paintable, uidl);
}
/**
boolean horizontalScrollBar = false;
boolean verticalScrollBar = false;
- Container parentPaintable = Util.getLayout(widget);
+ VPaintableWidgetContainer parentPaintable = paintable
+ .getParentPaintable();
RenderSpace renderSpace;
// Parent-less components (like sub-windows) are relative to browser
renderSpace = new RenderSpace(Window.getClientWidth(),
Window.getClientHeight());
} else {
- renderSpace = parentPaintable.getAllocatedSpace(widget);
+ renderSpace = ((Container) parentPaintable.getWidgetForPaintable())
+ .getAllocatedSpace(widget);
}
if (relativeSize.getHeight() >= 0) {
@Override
public void run() {
VConsole.log("Running re-layout of " + view.getClass().getName());
- runDescendentsLayout(view);
+ runDescendentsLayout(view.getWidgetForPaintable());
isPending = false;
}
};
*
* @return the main view
*/
- public VView getView() {
+ public VViewPaintable getView() {
return view;
}
* @deprecated To be removed before 7.0.0
*/
@Deprecated
-public interface Container extends VPaintableWidget {
+public interface Container {
/**
* Replace child of this layout with another component.
*/
boolean hasChildComponent(Widget component);
- /**
- * Update child components caption, description and error message.
- *
- * <p>
- * Each component is responsible for maintaining its caption, description
- * and error message. In most cases components doesn't want to do that and
- * those elements reside outside of the component. Because of this layouts
- * must provide service for it's childen to show those elements for them.
- * </p>
- *
- * @param paintable
- * Child component for which service is requested.
- * @param uidl
- * UIDL of the child component.
- */
- void updateCaption(VPaintableWidget paintable, UIDL uidl);
-
/**
* Called when a child components size has been updated in the rendering
* phase.
Set<Widget> parentChanges = new HashSet<Widget>();
for (Container parent : childWidgets.keySet()) {
if (!parent.requestLayout(childWidgets.get(parent))) {
- parentChanges.add(parent.getWidgetForPaintable());
+ parentChanges.add((Widget) parent);
}
}
*/
public static VPaintableWidget getChildPaintableForElement(
ApplicationConnection client, Container parent, Element element) {
- Element rootElement = parent.getWidgetForPaintable().getElement();
+ Element rootElement = ((Widget) parent).getElement();
while (element != null && element != rootElement) {
VPaintableWidget paintable = VPaintableMap.get(client)
.getPaintable(element);
* @return
*/
// FIXME: Rename to getParent()
- // public VPaintableWidget getParentPaintable();
+ public VPaintableWidgetContainer getParentPaintable();
}
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VPaintableMap;
import com.vaadin.terminal.gwt.client.VPaintableWidget;
-public class VAbsoluteLayout extends ComplexPanel {
+public class VAbsoluteLayout extends ComplexPanel implements Container {
/** Tag name for widget creation */
public static final String TAGNAME = "absolutelayout";
import com.vaadin.terminal.gwt.client.ApplicationConnection;\r
import com.vaadin.terminal.gwt.client.VPaintableMap;\r
import com.vaadin.terminal.gwt.client.VPaintableWidget;\r
+import com.vaadin.terminal.gwt.client.VPaintableWidgetContainer;\r
\r
public abstract class VAbstractPaintableWidget implements VPaintableWidget {\r
\r
this.id = id;\r
}\r
\r
- public VPaintableWidget getParentPaintable() {\r
+ public VPaintableWidgetContainer getParentPaintable() {\r
// FIXME: Return VPaintableWidgetContainer\r
// FIXME: Store hierarchy instead of doing lookup every time\r
\r
while (w != null) {\r
w = w.getParent();\r
if (paintableMap.isPaintable(w)) {\r
- return paintableMap.getPaintable(w);\r
+ return (VPaintableWidgetContainer) paintableMap.getPaintable(w);\r
}\r
}\r
\r
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.Container;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.StyleConstants;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VPaintableWidget;
import com.vaadin.terminal.gwt.client.ValueMap;
-public class VCssLayout extends SimplePanel {
+public class VCssLayout extends SimplePanel implements Container {
public static final String TAGNAME = "csslayout";
public static final String CLASSNAME = "v-" + TAGNAME;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.Util;
-public class VCustomComponent extends SimplePanel {
+public class VCustomComponent extends SimplePanel implements Container {
private static final String CLASSNAME = "v-customcomponent";
private String height;
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.Container;
import com.vaadin.terminal.gwt.client.ContainerResizedListener;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderSpace;
* @author Vaadin Ltd
*
*/
-public class VCustomLayout extends ComplexPanel implements
+public class VCustomLayout extends ComplexPanel implements Container,
ContainerResizedListener {
public static final String CLASSNAME = "v-customlayout";
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VPaintableWidget;
-abstract class VTabsheetBase extends ComplexPanel {
+abstract class VTabsheetBase extends ComplexPanel implements Container {
String id;
ApplicationConnection client;