本文整理汇总了Java中com.google.gwt.user.client.DeferredCommand.addCommand方法的典型用法代码示例。如果您正苦于以下问题:Java DeferredCommand.addCommand方法的具体用法?Java DeferredCommand.addCommand怎么用?Java DeferredCommand.addCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.DeferredCommand
的用法示例。
在下文中一共展示了DeferredCommand.addCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
@Override
public void show() {
super.show();
// Wizard size (having it resize between page changes is quite annoying)
int width = 340;
int height = 40;
this.center();
setPixelSize(width, height);
super.setPagePanelHeight(85);
DeferredCommand.addCommand(new Command() {
public void execute() {
projectNameTextBox.setFocus(true);
projectNameTextBox.selectAll();
}
});
}
示例2: show
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
@Override
public void show() {
super.show();
// Wizard size (having it resize between page changes is quite annoying)
int width = 320;
int height = 40;
this.center();
setPixelSize(width, height);
super.setPagePanelHeight(40);
DeferredCommand.addCommand(new Command() {
public void execute() {
projectNameTextBox.setFocus(true);
projectNameTextBox.selectAll();
}
});
}
示例3: show
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
@Override
public void show() {
super.show();
// Wizard size (having it resize between page changes is quite annoying)
int width = 500;
int height = 40;
this.center();
setPixelSize(width, height);
super.setPagePanelHeight(40);
DeferredCommand.addCommand(new Command() {
public void execute() {
urlTextBox.setFocus(true);
urlTextBox.selectAll();
}
});
}
示例4: show
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
@Override
public void show() {
super.show();
int width = 320;
int height = 40;
this.center();
setPixelSize(width, height);
super.setPagePanelHeight(40);
DeferredCommand.addCommand(new Command() {
public void execute() {
renameTextBox.setFocus(true);
}
});
}
示例5: it
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
public static void it(String html) {
try {
buildFrame(html);
if (USE_TIMER) {
Timer timer = new Timer() {
public void run() {
printFrame();
}
};
timer.schedule(TIMER_DELAY * 1000);
} else {
DeferredCommand.addCommand(new Command() {
public void execute() {
printFrame();
}
});
}
} catch (Throwable exc) {
Window.alert(exc.getMessage());
}
}
示例6: redrawAllAsync
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
void redrawAllAsync(final WebPlotView pv,
Drawer drawer,
boolean forceRebuild) {
if (_dataConnect == null) {
drawer.setData((List<DrawObj>) null);
return;
}
List<DrawObj> data = _dataConnect.getData(forceRebuild, pv.getPrimaryPlot());
// if (data == null || data.size() == 0) {
// drawer.setData((DrawObj)null);
// }
// else {
final int scrollX = pv.getScrollX();
final int scrollY = pv.getScrollY();
drawer.setData(data);
updateHighlightLayer(drawer, pv);
DeferredCommand.addCommand(new Command() {
public void execute() {
pv.setScrollXY(scrollX, scrollY);
}
});
// }
}
示例7: initOptimalSize
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
protected void initOptimalSize() {
_scroll.setVisible(false);
DeferredCommand.addCommand(new Command() {
public void execute() {
Element e = _panel.getCellFormatter().getElement(0, 0);
int w = DOM.getElementPropertyInt(e, "offsetWidth");
int h = DOM.getElementPropertyInt(e, "offsetHeight");
GWT.log("Initial table size is " + w + "," + h, null);
if(w == 0 || h == 0) {
_scroll.setVisible(true); // Skip all this if it is used inside a TabPanel
} else {
w -= 2; if(w < 0) w = 0;
h -= 2; if(h < 0) h = 0;
_scroll.setSize("" + w + "px", "" + h + "px");
_scroll.setVisible(true);
w = DOM.getElementPropertyInt(e, "offsetWidth");
h = DOM.getElementPropertyInt(e, "offsetHeight");
GWT.log("Now table size is " + w + "," + h, null);
}
}
});
}
示例8: onLoad
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
@Override
protected void onLoad() {
super.onLoad();
getEventManager().fireEvent(new WebEvent(this, ON_LOAD));
DeferredCommand.addCommand(new Command(){
public void execute() {
if (GwtUtil.isOnDisplay(Component.this)) {
if (isInit()) {
onShow();
} else {
// due to async init, this init() could return false.
// in that case, add a listener to execute this request once it is initialized.
eventManager.addListener(ON_INIT, new WebEventListener(){
public void eventNotify(WebEvent ev) {
eventManager.removeListener(ON_INIT, this);
onShow();
}
});
}
}
}
});
}
示例9: updateModel
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
private void updateModel(final ContentPanel cp, final CIModel model) {
DeferredCommand.addCommand(new Command() {
public void execute() {
localData = new CIModelCollection();
localData.addCIModel("offspring", model);
baseData = localData.copy();
redraw();
/*
cp.remove(currentGrid);
currentGrid = new CIPropertyGrid(gridModelConfig, localData);
currentGrid.setPermissions(permissions);
cp.add(currentGrid);
cp.layout();
setHeader(getParent(), "Properties for " + model.getDisplayName());
*/
}
});
}
示例10: onPostPageInExpandedMode
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
public void onPostPageInExpandedMode(PopoutWidget oldPopout, PopoutWidget newPopout, Dimension dim) {
if (newPopout instanceof MiniPlotWidget) {
final MiniPlotWidget mpwNew = (MiniPlotWidget) newPopout;
mpwNew.getGroup().setLastPoppedOut(mpwNew);
AllPlots.getInstance().setSelectedMPW(mpwNew, true);
DeferredCommand.addCommand(new Command() {
public void execute() {
if (AllPlots.getInstance().isWCSMatch()) {
mpwNew.getPlotView().smartCenter();
}
else {
mpwNew.getPlotView().centerOnPoint(_pagingCenter);
}
}
});
} else {
AllPlots.getInstance().setSelectedMPW(null, true);
newPopout.widgetResized(dim.getWidth(), dim.getHeight());
}
}
示例11: maskAndExecute
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
public static void maskAndExecute(String msg,
Widget widget,
MaskPane.MaskHint hint,
final Runnable runnable) {
final MaskPane mp = mask(msg, widget, hint);
mp.show();
DeferredCommand.addCommand(new Command() {
public void execute() {
try {
runnable.run();
} finally {
mp.hide();
}
}
});
}
示例12: redrawHighlightChangeAsync
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
private void redrawHighlightChangeAsync(final WebPlotView pv,
Drawer drawer) {
if ((_dataConnect != null && _dataConnect.size() == 0) ||
(_dataConnect != null && !_dataConnect.getSupportsHighlight())) {
return;
}
if (_dataConnect == null) return;
final int scrollX = pv.getScrollX();
final int scrollY = pv.getScrollY();
updateHighlightLayer(drawer,pv);
DeferredCommand.addCommand(new Command() {
public void execute() {
pv.setScrollXY(scrollX, scrollY);
}
});
}
示例13: changePanel
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
private void changePanel(String list) {
_columns.clear();
vp.remove(table);
vp.remove(html);
if (panel != null && vp.getWidgetIndex(panel) >= 0) {
vp.remove(panel);
}
if (list.equalsIgnoreCase("short")) {
buildPanel(true);
} else {
buildPanel(false);
}
DeferredCommand.addCommand(new Command() {
public void execute() { onResize(); }
});
}
示例14: onBrowserEvent
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONCLICK:
if (items != null && items.length > 0) {
Element target = DOM.eventGetTarget(event);
for (int i = 0; i < items.length; i++) {
if (items[i].getElement()!=null){
// if (DOM.compare(target, items[i].getElement())) {
if (target.getId()!=null && target.getId().equals(items[i].getElement().getId())) {
Command command = items[i].getCommand();
if (command != null) {
DeferredCommand.addCommand(command);
}
}
}
}
DOM.eventPreventDefault(event);
return;
}
}
super.onBrowserEvent(event);
}
示例15: startTesting
import com.google.gwt.user.client.DeferredCommand; //导入方法依赖的package包/类
public void startTesting(final boolean validateText,final boolean validateMap,final boolean deploy,
final ExportBookCallback callback) {
startProgress();
DeferredCommand.addCommand(new Command() {
public void execute() {
try {
validate(validateText,validateMap,false,deploy);
} catch (TimeoutException e) {
//we cannot be here in client side
}
stopProgress();
if (errorCount==0) {
callback.onSuccess(null);
} else {
callback.onError();
}
}
});
}