本文整理汇总了Java中com.google.gwt.user.client.ui.WidgetCollection类的典型用法代码示例。如果您正苦于以下问题:Java WidgetCollection类的具体用法?Java WidgetCollection怎么用?Java WidgetCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WidgetCollection类属于com.google.gwt.user.client.ui包,在下文中一共展示了WidgetCollection类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startPreview
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* 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);
}
示例2: getButton
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
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;
}
示例3: getLatestListBox
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* @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;
}
示例4: getListBoxes
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
@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;
}
示例5: doLogicalClear
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
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);
}
}
示例6: clearAll
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
public HTMLStream clearAll()
{
WidgetCollection childs = getChildren();
while( childs.size() > 0 )
{
childs.remove( 0 );
}
div.setInnerHTML( "" );
currentParagraph = null;
curSet.clear();
curParCurSet.clear();
return this;
}
示例7: insert
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* 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);
}
示例8: selectAll
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* 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);
}
示例9: doLogicalClear
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
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);
}
}
示例10: getChildren
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
@Override
public WidgetCollection getChildren() {
return super.getChildren();
}
示例11: clear
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
@Override
public void clear() {
super.clear();
children = new WidgetCollection(this);
dividerList.clear();
}
示例12: removeAllNotes
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
private void removeAllNotes() {
final WidgetCollection kids = getChildren();
while (kids.size() > 0) {
remove(kids.size() - 1);
}
}
示例13: getChildren
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* Gets the list of children contained in this panel.
*
* @return a collection of child widgets
*/
public WidgetCollection getChildren() {
return children;
}
示例14: getChildren
import com.google.gwt.user.client.ui.WidgetCollection; //导入依赖的package包/类
/**
* Gets the list of children contained in this panel.
*
* @return a collection of child widgets
*/
public WidgetCollection getChildren() {
return children;
}