本文整理汇总了Java中com.google.gwt.dom.client.Element.setId方法的典型用法代码示例。如果您正苦于以下问题:Java Element.setId方法的具体用法?Java Element.setId怎么用?Java Element.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.Element
的用法示例。
在下文中一共展示了Element.setId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: centerMainPreloader
import com.google.gwt.dom.client.Element; //导入方法依赖的package包/类
private void centerMainPreloader(int x, int y, Element preloaderElement) {
preloaderElement.setId(MAIN_PRELOADER_ID);
preloaderElement.getStyle().setPosition(Style.Position.ABSOLUTE);
int leftOffset = x - preloaderElement.getOffsetWidth() / 2;
preloaderElement.getStyle().setLeft(leftOffset, Style.Unit.PX);
int topOffset = y - preloaderElement.getOffsetHeight() / 2;
preloaderElement.getStyle().setTop(topOffset, Style.Unit.PX);
}
示例2: onModuleLoadDeferred
import com.google.gwt.dom.client.Element; //导入方法依赖的package包/类
public void onModuleLoadDeferred() {
// register triggers
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
for (Triggers t: Triggers.values())
t.register();
callGwtOnLoadIfExists();
}
@Override
public void onFailure(Throwable reason) {
}
});
// load page
if (RootPanel.get("UniTimeGWT:Body") != null) {
LoadingWidget.getInstance().show(MESSAGES.waitLoadingPage());
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
initPageAsync(Window.Location.getParameter("page"));
}
});
}
// load components
for (final Components c: Components.values()) {
final RootPanel p = RootPanel.get(c.id());
if (p != null) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
initComponentAsync(p, c);
}
});
}
if (p == null && c.isMultiple()) {
NodeList<Element> x = getElementsByName(c.id());
if (x != null && x.getLength() > 0)
for (int i = 0; i < x.getLength(); i++) {
Element e = x.getItem(i);
e.setId(DOM.createUniqueId());
final RootPanel q = RootPanel.get(e.getId());
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
initComponentAsync(q, c);
}
});
}
}
}
Window.addWindowClosingHandler(new Window.ClosingHandler() {
@Override
public void onWindowClosing(Window.ClosingEvent event) {
if (isLoadingDisplayed() || LoadingWidget.getInstance().isShowing()) return;
LoadingWidget.showLoading(MESSAGES.waitPlease());
iPageLoadingTimer = new Timer() {
@Override
public void run() {
RPC.execute(new IsSessionBusyRpcRequest(), new AsyncCallback<GwtRpcResponseBoolean>() {
@Override
public void onFailure(Throwable caught) {
LoadingWidget.hideLoading();
}
@Override
public void onSuccess(GwtRpcResponseBoolean result) {
if (result.getValue()) {
iPageLoadingTimer.schedule(500);
} else {
LoadingWidget.hideLoading();
}
}
});
}
};
iPageLoadingTimer.schedule(500);
}
});
}