From: Leif Åstrand Date: Tue, 7 Feb 2012 12:02:36 +0000 (+0200) Subject: Remove some references to Container X-Git-Tag: 7.0.0.alpha2~434^2~87 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=208f2461a7022b87350d1bfd05da16653df1e430;p=vaadin-framework.git Remove some references to Container --- diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 67339c984a..b17ed6e62b 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -126,26 +126,6 @@ public class Util { } } - /** - * Returns closest parent Widget in hierarchy that implements Container - * interface - * - * @param component - * @return closest parent Container - */ - public static Container getLayout(Widget component) { - Widget parent = component.getParent(); - while (parent != null && !(parent instanceof Container)) { - parent = parent.getParent(); - } - if (parent != null) { - assert ((Container) parent).hasChildComponent(component); - - return (Container) parent; - } - return null; - } - private static final Element escapeHtmlHelper = DOM.createDiv(); /** @@ -655,53 +635,6 @@ public class Util { }-*/; - /** - * Locates the child component of parent which contains - * the element element. The child component is also - * returned if "element" is part of its caption. If - * element is not part of any child component, null is - * returned. - * - * This method returns the immediate child of the parent that contains the - * element. See - * {@link #getPaintableForElement(ApplicationConnection, Container, Element)} - * for the deepest nested paintable of parent that contains the element. - * - * @param client - * A reference to ApplicationConnection - * @param parent - * The widget that contains element. - * @param element - * An element that is a sub element of the parent - * @return The VPaintableWidget which the element is a part of. Null if the - * element does not belong to a child. - */ - public static VPaintableWidget getChildPaintableForElement( - ApplicationConnection client, Container parent, Element element) { - Element rootElement = ((Widget) parent).getElement(); - while (element != null && element != rootElement) { - VPaintableWidget paintable = VPaintableMap.get(client) - .getPaintable(element); - if (paintable == null) { - String ownerPid = VCaption.getCaptionOwnerPid(element); - if (ownerPid != null) { - paintable = (VPaintableWidget) VPaintableMap.get(client) - .getPaintable(ownerPid); - } - } - - if (paintable != null - && parent.hasChildComponent(paintable - .getWidgetForPaintable())) { - return paintable; - } - - element = (Element) element.getParentElement(); - } - - return null; - } - /** * Locates the nested child component of parent which * contains the element element. The child component is @@ -709,9 +642,7 @@ public class Util { * element is not part of any child component, null is * returned. * - * This method returns the deepest nested VPaintableWidget. See - * {@link #getChildPaintableForElement(ApplicationConnection, Container, Element)} - * for the immediate child component of parent that contains the element. + * This method returns the deepest nested VPaintableWidget. * * @param client * A reference to ApplicationConnection diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java index 76c312676a..d3a963a7e1 100644 --- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java +++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java @@ -523,8 +523,7 @@ public class VDebugConsole extends VOverlay implements Console { private void printClientSideDetectedIssues( Set zeroHeightComponents, ApplicationConnection ac) { for (final VPaintableWidget paintable : zeroHeightComponents) { - final Container layout = Util.getLayout(paintable - .getWidgetForPaintable()); + final Widget layout = paintable.getParent().getWidgetForPaintable(); VerticalPanel errorDetails = new VerticalPanel(); errorDetails.add(new Label("" + Util.getSimpleName(paintable) @@ -534,7 +533,7 @@ public class VDebugConsole extends VOverlay implements Console { emphasisInUi.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (paintable != null) { - Element element2 = ((Widget) layout).getElement(); + Element element2 = layout.getElement(); Widget.setStyleName(element2, "invalidlayout", emphasisInUi.getValue()); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java b/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java index 2bd578a45d..a90c0c33ff 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java +++ b/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java @@ -17,7 +17,6 @@ import com.google.gwt.user.client.ui.KeyboardListener; import com.google.gwt.user.client.ui.KeyboardListenerCollection; 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.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VPaintableWidget; @@ -33,9 +32,8 @@ import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea; public class ShortcutActionHandler { /** - * An interface implemented by those users (most often {@link Container}s, - * but HasWidgets at least) of this helper class that want to support - * special components like {@link VRichTextArea} that don't properly + * An interface implemented by those users of this helper class that want to + * support special components like {@link VRichTextArea} that don't properly * propagate key down events. Those components can build support for * shortcut actions by traversing the closest * {@link ShortcutActionHandlerOwner} from the component hierarchy an