本文整理汇总了Java中com.google.gwt.user.client.ui.RootPanel.get方法的典型用法代码示例。如果您正苦于以下问题:Java RootPanel.get方法的具体用法?Java RootPanel.get怎么用?Java RootPanel.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.RootPanel
的用法示例。
在下文中一共展示了RootPanel.get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onModuleLoad
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get("main");
final Button button = new Button("Click me");
rootPanel.add(button);
ObservableEx.fromKeyboardEvent(button.getElement(), "keydown")
.map(event -> event.ctrlKey)
.take(5)
.subscribe(v -> log("ctrlKey " + v));
ObservableEx.fromMouseEvent(button.getElement(), "click")
.map(event -> event.clientX)
.take(5)
.subscribe(v -> log("clientX " + v));
}
示例2: getInstance
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
public static AriaStatus getInstance() {
if (sStatus == null) {
RootPanel statusPanel = RootPanel.get("UniTimeGWT:AriaStatus");
if (statusPanel != null && "1".equals(Window.Location.getParameter("aria"))) {
sStatus = new AriaStatus(statusPanel.getElement(), false);
sStatus.setStyleName("unitime-VisibleAriaStatus");
} else {
sStatus = new AriaStatus(false);
RootPanel.get().add(sStatus);
}
RootPanel.get().addDomHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeEvent().getKeyCode() == 191 && (event.isControlKeyDown() || event.isAltKeyDown())) {
sStatus.setHTML(sStatus.getHTML());
}
}
}, KeyUpEvent.getType());
}
return sStatus;
}
示例3: attachLogPanel
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
/** Reveals the log div, and executes a task when done. */
// The async API for this method is intended to support two things: a cool
// spew animation, and also the potential to runAsync the whole LogPanel code.
private static void attachLogPanel() {
Logs.get().addHandler(domLogger);
final Panel logHolder = RootPanel.get("logHolder");
logHolder.setVisible(true);
// Need one layout and paint cycle after revealing it to start animation.
// Use high priority to avoid potential starvation by other tasks if a
// problem is occurring.
SchedulerInstance.getHighPriorityTimer().scheduleDelayed(new Task() {
@Override
public void execute() {
logHolder.add(domLogger);
Style waveStyle = Document.get().getElementById(WAVEPANEL_PLACEHOLDER).getStyle();
Style logStyle = logHolder.getElement().getStyle();
logStyle.setHeight(250, Unit.PX);
waveStyle.setBottom(250, Unit.PX);
}
}, 50);
}
示例4: Player
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
@Inject
public Player(@Assisted String id, @Assisted JavaScriptObject jsObject, ViewEngine viewEngine, DeliveryEngine deliveryEngine,
IPlayerContainersAccessor accessor) {
this.accessor = accessor;
this.deliveryEngine = deliveryEngine;
try {
RootPanel.get(id);
} catch (Exception e) {
}
RootPanel root = RootPanel.get(id);
viewEngine.mountView(root);
getAccessor().setPlayerContainer(root);
deliveryEngine.init(jsObject);
}
示例5: onModuleLoadDeferred
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的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);
}
});
}
示例6: reloadMenu
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
public static void reloadMenu() {
for (final Components c: Components.values()) {
final RootPanel p = RootPanel.get(c.id());
if (p != null) {
for (int i = 0; i < p.getWidgetCount(); i++)
if (p.getWidget(i) instanceof UniTimeMenu)
((UniTimeMenu)p.getWidget(i)).reload();
}
}
}
示例7: onModuleLoad
import com.google.gwt.user.client.ui.RootPanel; //导入方法依赖的package包/类
public void onModuleLoad() {
rootPanel = RootPanel.get();
rootPanel.setSize("400", "700");
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
presenter = new InteractiveDownloadDataViewActivity(clientFactory);
// view = clientFactory.getView();
// RootPanel.get().add(view);
// view.setPresenter(presenter);
ScrollPanel scrollPanel = new ScrollPanel();
// scrollPanel.setWidget(view.asWidget());
rootPanel.add(scrollPanel);
presenter.start(scrollPanel, eventBus);
}