本文整理汇总了Java中com.google.gwt.user.client.Timer.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.cancel方法的具体用法?Java Timer.cancel怎么用?Java Timer.cancel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Timer
的用法示例。
在下文中一共展示了Timer.cancel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* Evaluate
*/
public void evaluate(String name) {
if (name.equals("futurama")) {
left = -180;
top = Window.getClientHeight() - 80 - 21;
show();
setPopupPosition(left, top);
move = new Timer() {
public void run() {
left += 2;
setPopupPosition(left, top);
if (left < Window.getClientWidth() + 180) {
move.schedule(40);
} else {
move.cancel();
hide();
}
}
};
move.schedule(40);
}
}
示例2: setCarts
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void setCarts(final List<ShoppingCartRef> carts) {
_carts = carts;
for (Timer t : _timers.values()) {
t.cancel();
}
_timers.clear();
if (carts == null) {
setData(null);
return;
}
List<ListGridEntry<ShoppingCartRef>> es = new Vector<ListGridEntry<ShoppingCartRef>>(carts.size());
for (ShoppingCartRef sc : carts) {
ListGridEntry<ShoppingCartRef> e = new ListGridEntry<ShoppingCartRef>(sc);
e.set("id", sc.id());
e.set("status", sc.status());
e.set("progress", sc.status());
e.set("log", sc.status());
es.add(e);
}
if (!es.isEmpty()) {
ShoppingCartRef selected = null;
List<ShoppingCartRef> selections = selections();
if (selections != null) {
if (!selections.isEmpty()) {
selected = selections.get(0);
}
}
setData(es);
if (selected != null && carts.contains(selected)) {
select(selected);
} else {
ActiveShoppingCart.get(new ObjectResolveHandler<ShoppingCartRef>() {
@Override
public void resolved(ShoppingCartRef asc) {
select(asc);
}
});
}
} else {
setData(null);
}
}