summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-02-07 14:02:36 +0200
committerLeif Åstrand <leif@vaadin.com>2012-02-07 14:02:36 +0200
commit208f2461a7022b87350d1bfd05da16653df1e430 (patch)
tree587e6198a8bda5550a5ee38456d30a1be0fa4dfa /src
parent27e820a5f4cdc944b6d3e82d25509fd453489062 (diff)
downloadvaadin-framework-208f2461a7022b87350d1bfd05da16653df1e430.tar.gz
vaadin-framework-208f2461a7022b87350d1bfd05da16653df1e430.zip
Remove some references to Container
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java71
-rw-r--r--src/com/vaadin/terminal/gwt/client/VDebugConsole.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java6
3 files changed, 5 insertions, 77 deletions
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();
/**
@@ -656,62 +636,13 @@ public class Util {
}-*/;
/**
- * Locates the child component of <literal>parent</literal> which contains
- * the element <literal>element</literal>. The child component is also
- * returned if "element" is part of its caption. If
- * <literal>element</literal> 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 <literal>element</literal>.
- * @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 <literal>parent</literal> which
* contains the element <literal>element</literal>. The child component is
* also returned if "element" is part of its caption. If
* <literal>element</literal> 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<VPaintableWidget> 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