Java 类com.google.gwt.user.client.ui.WidgetCollection 实例源码

项目:webcam    文件:GifPreviewWidget.java   
/**
 * Starts the preview animation with the given {@code delay} between frames.
 * Add the frames using {@link #addImage(String)} method before starting the
 * preview.
 */
public void startPreview(int delay) {
    frameTimer = new Timer() {

        private int currentFrame;

        @Override
        public void run() {
            WidgetCollection frames = getChildren();
            for (int i = 0; i < frames.size(); i++) {
                frames.get(i).setVisible(i == currentFrame);
            }
            currentFrame++;
            if (currentFrame >= frames.size()) {
                currentFrame = 0;
            }
        }
    };
    frameTimer.scheduleRepeating(delay);
}
项目:empiria.player    文件:SelectionButtonGridElementImpl.java   
private SelectionChoiceButton getButton() {
    WidgetCollection children = getChildren();
    // each grid element panel should contain only one child ex. button
    if (children.size() != 1) {
        throw new RuntimeException("SelectionGridElement panel contains " + children.size() + " elements when 1 was expected!");
    }
    SelectionChoiceButton button = (SelectionChoiceButton) children.get(0);
    return button;
}
项目:LAS    文件:VariableSelectorImpl.java   
/**
 * @return The latest remaining (bottom most) ListBox
 */
@Override
public UserListBox getLatestListBox() {
    UserListBox latestListBox = null;
    WidgetCollection children = this.getChildren();
    for (int index = children.size() - 1; index >= 0; index--) {
        Widget widget = children.get(index);
        if (widget instanceof UserListBox) {
            latestListBox = (UserListBox) widget;
            index = -1; // break out of for-loop
        }
    }
    return latestListBox;
}
项目:LAS    文件:VariableSelectorImpl.java   
@Override
public Vector<UserListBox> getListBoxes() {
    Vector<UserListBox> listBoxes = new Vector<UserListBox>();
    WidgetCollection children = this.getChildren();
    for (int index = 0; index < children.size(); index++) {
        Widget widget = children.get(index);
        if (widget instanceof UserListBox) {
            listBoxes.add((UserListBox) widget);
        }
    }
    return listBoxes;
}
项目:ahome-touch    文件:ComplexContainer.java   
void doLogicalClear() {
    if (orphanCommand == null) {
        orphanCommand = new AttachDetachException.Command() {
            public void execute(Widget w) {
                orphan(w);
            }
        };
    }
    try {
        AttachDetachException.tryCommand(this, orphanCommand);
    } finally {
        children = new WidgetCollection(this);
    }
}
项目:hexa.tools    文件:HTMLStream.java   
public HTMLStream clearAll()
{
    WidgetCollection childs = getChildren();
    while( childs.size() > 0 )
    {
        childs.remove( 0 );
    }
    div.setInnerHTML( "" );
    currentParagraph = null;
    curSet.clear();
    curParCurSet.clear();

    return this;
}
项目:kaa    文件:CustomDeckLayoutPanel.java   
/**
 * Insert a widget before the specified widget. If the widget is already a
 * child of this panel, this method behaves as though {@link #remove(Widget)}
 * had already been called.
 *
 * @param widget the widget to be added
 * @param before the widget before which to insert the new child, or <code>null</code> to append
 */
public void insert(Widget widget, Widget before) {
  assertIsChild(before);

  // Detach new child.
  widget.removeFromParent();

  // Logical attach.
  WidgetCollection children = getChildren();
  if (before == null) {
    children.add(widget);
  } else {
    int index = children.indexOf(before);
    children.insert(widget, index);
  }

  // Physical attach.
  Layer layer = layout.attachChild(widget.getElement(), (before != null)
      ? before.getElement() : null, widget);
  setWidgetVisible(widget, layer, false);
  widget.setLayoutData(layer);

  // Adopt.
  adopt(widget);

  // Update the layout.
  animate(0);
}
项目:gwt-d3    文件:D3.java   
/**
 * Selects the specified collection of elements.
 *
 * @param nodes
 *            the elements
 * @return the selection
 */
public static final Selection selectAll(final WidgetCollection widgets) {
    List<Element> elements = new ArrayList<Element>();
    for (Widget widget : widgets) {
        elements.add(widget.getElement());
    }
    return selectAll(elements);
}
项目:touch4j    文件:ComplexContainer.java   
void doLogicalClear() {
    if (orphanCommand == null) {
        orphanCommand = new AttachDetachException.Command() {
            public void execute(Widget w) {
                orphan(w);
            }
        };
    }
    try {
        AttachDetachException.tryCommand(this, orphanCommand);
    } finally {
        children = new WidgetCollection(this);
    }
}
项目:Wiab.pro    文件:ImplPanel.java   
@Override
public WidgetCollection getChildren() {
  return super.getChildren();
}
项目:avro-ui    文件:Breadcrumbs.java   
@Override
public void clear() {
    super.clear();
    children = new WidgetCollection(this);
    dividerList.clear();
}
项目:incubator-wave    文件:ImplPanel.java   
@Override
public WidgetCollection getChildren() {
  return super.getChildren();
}
项目:swarm    文件:SurfaceView.java   
private void removeAllNotes() {
  final WidgetCollection kids = getChildren();
  while (kids.size() > 0) {
    remove(kids.size() - 1);
  }
}
项目:ahome-touch    文件:ComplexContainer.java   
/**
 * Gets the list of children contained in this panel.
 * 
 * @return a collection of child widgets
 */
public WidgetCollection getChildren() {
    return children;
}
项目:touch4j    文件:ComplexContainer.java   
/**
 * Gets the list of children contained in this panel.
 * 
 * @return a collection of child widgets
 */
public WidgetCollection getChildren() {
    return children;
}