Refine search
/** * This convenience method makes a null-safe call to * {@link IsWidget#asWidget()}. * * @return the widget aspect, or <code>null</code> if w is null */ public static Widget asWidgetOrNull(IsWidget w) { return w == null ? null : w.asWidget(); } /**
@Override public void addGroupItem(String id, String name, String description, IsWidget widget) { Element el = widget.asWidget().getElement(); navWidget.appendChild((Node) el); }
/** * Add a widget to the panel in the specified layer. Note that this method * does not do the logical attach. * * @param w the widget to add, or null to clear the widget * @param toReplace the widget to replace * @param layer the layer in which the existing widget is placed * @return the layer in which the new widget is placed, or null if no widget */ private Layer add(IsWidget w, IsWidget toReplace, Layer layer) { // Validate. if (w == toReplace) { return layer; } // Detach new child. if (w != null) { w.asWidget().removeFromParent(); } // Remove old child. if (toReplace != null) { remove(toReplace); } Layer toRet = null; if (w != null) { // Physical attach. toRet = layout.attachChild(w.asWidget().getElement()); adopt(w.asWidget()); } return toRet; }
/** * Show the specified widget. If the widget is not a child of this panel, it * is added to the end of the panel. If the specified widget is null, the * currently-visible widget will be hidden. * * @param widget the widget to show, and add if not a child */ @Override public void setWidget(IsWidget widget) { // Hide the currently visible widget. if (widget == null) { showWidget(null); return; } // Add the widget if it is not already a child. if (widget.asWidget().getParent() != this) { add(widget); } // Show the widget. showWidget(widget.asWidget()); }
public void remove() { if (index < 0 || index >= widgetCount) { throw new IllegalStateException(); } IsWidget w = provider.get(index); if (w == null) { throw new IllegalStateException("Widget was already removed."); } w.asWidget().removeFromParent(); } }
public void showSummary() { summary.asWidget().setVisible( true ); detail.asWidget().setVisible( false ); }
@Override public boolean remove(IsWidget w) { if (w.asWidget() instanceof IsFlexible) { w.asWidget().removeStyleName(appearance.css().flexible()); } return container.remove(w); }
@Override public void add(IsWidget w) { if (w.asWidget() instanceof IsFlexible) { w.asWidget().addStyleName(appearance.css().flexible()); } container.add(w); }
@Override public void paint() { if (showPredicate.apply(parent)) { parent.getElement().appendChild(widget.asWidget().getElement()); } }
/** * Show the specified widget. If the widget is not a child of this panel, it * is added to the end of the panel. If the specified widget is null, the * currently-visible widget will be hidden. * * @param w the widget to show, and add if not a child */ @Override public void setWidget(IsWidget w) { // Hide the currently visible widget. if (w == null) { showWidget(null); return; } // Add the widget if it is not already a child. if (w.asWidget().getParent() != this) { add(w); } // Show the widget. showWidget(w.asWidget()); }
public void remove() { if (index < 0 || index >= widgetCount) { throw new IllegalStateException(); } IsWidget w = provider.get(index); if (w == null) { throw new IllegalStateException("Widget was already removed."); } w.asWidget().removeFromParent(); } }
public void showDetail() { detail.asWidget().setVisible( true ); summary.asWidget().setVisible( false ); } }
@Override public boolean remove(IsWidget w) { if (w.asWidget() instanceof IsFlexible) { w.asWidget().removeStyleName(appearance.css().flexible()); } return container.remove(w); }
private void setZIndeces() { for (int i = 0; i < children.size(); i++) { IsWidget object = children.get(i); object.asWidget().getElement().getStyle().setZIndex(i); } } }
public void remove() { if (index < 0 || index >= widgetCount) { throw new IllegalStateException(); } IsWidget w = provider.get(index); if (w == null) { throw new IllegalStateException("Widget was already removed."); } w.asWidget().removeFromParent(); } }
public void add(IsWidget child) { children.add(child); getElement().appendChild(child.asWidget().getElement()); adopt(child.asWidget()); }
/** * Overloaded version for IsWidget. * * @see #setWidgetLeftWidth(Widget,double, Style.Unit, double, Style.Unit) */ public void setWidgetLeftWidth(IsWidget child, double left, Unit leftUnit, double width, Unit widthUnit) { this.setWidgetLeftWidth(child.asWidget(), left, leftUnit, width, widthUnit); }