本文整理汇总了Java中com.google.gwt.user.client.ui.RootPanel类的典型用法代码示例。如果您正苦于以下问题:Java RootPanel类的具体用法?Java RootPanel怎么用?Java RootPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RootPanel类属于com.google.gwt.user.client.ui包,在下文中一共展示了RootPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFrame
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
private Frame createFrame() {
final Frame frame = new Frame(DEFAULT_TEMPLATE_PATH);
frame.getElement().setId(DEFAULT_FRAME_NAME);
frame.setTitle(UIMessages.INSTANCE.previewTitle());
frame.setWidth("500px");
frame.setHeight("500px");
frame.getElement().getStyle().setBackgroundColor("gray");
frame.setVisible(true);
RootPanel.get().add(frame);
frame.addLoadHandler(new LoadHandler() {
@Override
public void onLoad(LoadEvent event) {
frame.getElement().getStyle().setBackgroundColor("white");
zoomPageComboBox.setValue(75);
}
});
return frame;
}
示例2: openFullscreenIE
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
protected void openFullscreenIE(MediaWrapper<?> mediaWrapper, Element template) {
if (mediaWrapper != null && template != null) {
clearFullScreenView();
lastMediaWrapper = mediaWrapper;
VideoFullScreenView parent = getFullScreenView();
Widget widget = mediaWrapper.getMediaObject();
parent.getContainer().add(widget);
resizeToFullScreen(parent.asWidget(), Position.FIXED);
resizeToFullScreen(widget, Position.ABSOLUTE);
parseTemplate(mediaWrapper, template, parent.getControls());
fireEvent(true, mediaWrapper);
RootPanel.get().add(parent);
resizeToFullScreen(lastMediaWrapper.getMediaObject(), Position.FIXED);
resizeToFullScreen(view.asWidget(), Position.FIXED);
resizeToFullScreen(widget, Position.ABSOLUTE);
}
}
示例3: configureSwipe
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
private void configureSwipe() {
if (isSwipeDisabled()) {
for (HandlerRegistration registration : touchHandlers) {
registration.removeHandler();
}
touchHandlers.clear();
setVisiblePageCount(1);
} else {
RootPanel rootPanel = rootPanelDelegate.getRootPanel();
HasTouchHandlers touchHandler = touchRecognitionFactory.getTouchRecognition(rootPanel, false);
touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_START)));
touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_MOVE)));
touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_END)));
setVisiblePageCount(3);
}
panelsCache.setSwipeType(swipeType.get());
}
示例4: 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));
}
示例5: afterInitialization
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
@AfterInitialization
public void afterInitialization() {
authenticationServiceCaller.call(new RemoteCallback<User>() {
@Override
public void callback(User user) {
Label userLabel = new Label(
"User logged in: username=" + user.getIdentifier() + ", roles=" + user.getRoles());
RootPanel.get().add(userLabel);
SimplePanel panel = new SimplePanel();
Anchor logoutLink = new Anchor("Spring Security Logout URL", GWT.getHostPageBaseURL() + "logout");
panel.add(logoutLink);
RootPanel.get().add(panel);
initBtns();
}
}).getUser();
}
示例6: showRequestDetail
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void showRequestDetail(Long id) {
iAssignmentTable.clearTable(1);
LoadingWidget.getInstance().show(MESSAGES.waitLoadTeachingRequestDetail());
ToolBox.setMaxHeight(iScroll.getElement().getStyle(), Math.round(0.9 * Window.getClientHeight()) + "px");
RPC.execute(new TeachingRequestDetailRequest(id), new AsyncCallback<TeachingRequestInfo>() {
@Override
public void onFailure(Throwable caught) {
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadTeachingRequestDetail(caught.getMessage()), caught);
ToolBox.checkAccess(caught);
}
@Override
public void onSuccess(TeachingRequestInfo result) {
LoadingWidget.getInstance().hide();
populate(result, null, null);
GwtHint.hideHint();
center();
RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
}
});
}
示例7: showInstructorDetail
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void showInstructorDetail(Long id) {
iAssignmentTable.clearTable(1);
LoadingWidget.getInstance().show(MESSAGES.waitLoadTeachingRequestDetail());
ToolBox.setMaxHeight(iScroll.getElement().getStyle(), Math.round(0.9 * Window.getClientHeight()) + "px");
RPC.execute(new TeachingAssignmentsDetailRequest(id), new AsyncCallback<InstructorInfo>() {
@Override
public void onFailure(Throwable caught) {
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadTeachingRequestDetail(caught.getMessage()), caught);
ToolBox.checkAccess(caught);
}
@Override
public void onSuccess(InstructorInfo result) {
LoadingWidget.getInstance().hide();
populate(null, null, result);
GwtHint.hideHint();
center();
RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
}
});
}
示例8: 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;
}
示例9: initPageAsync
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void initPageAsync(final String page) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
init(page);
LoadingWidget.getInstance().hide();
}
public void onFailure(Throwable reason) {
Label error = new Label(MESSAGES.failedToLoadPage(reason.getMessage()));
error.setStyleName("unitime-ErrorMessage");
RootPanel loading = RootPanel.get("UniTimeGWT:Loading");
if (loading != null) loading.setVisible(false);
RootPanel.get("UniTimeGWT:Body").add(error);
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadPage(reason.getMessage()), reason);
}
});
}
示例10: insert
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void insert(final RootPanel panel, boolean eventAvailability) {
Long locationId = Long.valueOf(panel.getElement().getInnerHTML().trim());
RPC.execute(RoomInterface.RoomSharingRequest.load(locationId, eventAvailability), new AsyncCallback<RoomSharingModel>() {
@Override
public void onFailure(Throwable caught) {
UniTimeNotifications.error(MESSAGES.failedToLoadRoomAvailability(caught.getMessage()));
}
@Override
public void onSuccess(RoomSharingModel result) {
panel.getElement().setInnerText(null);
setModel(result);
panel.add(RoomSharingWidget.this);
panel.setVisible(true);
}
});
}
示例11: insert
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void insert(final RootPanel panel, Long eventAvailability) {
String[] ids = panel.getElement().getInnerHTML().trim().split(":");
Long locationId = Long.valueOf(ids[0]);
Long examTypeId = Long.valueOf(ids[1]);
RPC.execute(RoomInterface.PeriodPreferenceRequest.load(locationId, examTypeId), new AsyncCallback<PeriodPreferenceModel>() {
@Override
public void onFailure(Throwable caught) {
UniTimeNotifications.error(MESSAGES.failedToLoadPeriodPreferences(caught.getMessage()));
}
@Override
public void onSuccess(PeriodPreferenceModel result) {
panel.getElement().setInnerText(null);
setModel(result);
panel.add(PeriodPreferencesWidget.this);
panel.setVisible(true);
}
});
}
示例12: insert
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void insert(final RootPanel panel) {
String id = panel.getElement().getInnerText();
panel.getElement().setInnerText(null);
panel.add(this);
panel.setVisible(true);
RPC.execute(new SolverAllocatedMemoryRpcRequest(id), new AsyncCallback<SolverAllocatedMemoryRpcResponse>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(SolverAllocatedMemoryRpcResponse result) {
setWidget(new Label(result.getValue()));
}
});
}
示例13: show
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void show(String message, int warningDelayInMillis) {
if (iCount == 0) {
RootPanel.get().add(this, Window.getScrollLeft(), Window.getScrollTop());
RootPanel.get().add(iImage, Window.getScrollLeft() + Window.getClientWidth() / 2, Window.getScrollTop() + Window.getClientHeight() / 2);
iWarningTimer.schedule(warningDelayInMillis);
}
if (message != null) {
boolean showing = (iCount > 0 && !iMessage.getText().isEmpty());
iMessage.setHTML(message);
if (!showing && !iMessage.getText().isEmpty()) {
RootPanel.get().add(iMessage, Window.getScrollLeft() + Window.getClientWidth() / 2 - 225, Window.getScrollTop() + Window.getClientHeight() / 3);
} else if (showing && iMessage.getText().isEmpty()) {
RootPanel.get().remove(iMessage);
}
AriaStatus.getInstance().setText(message.replace("...", "."));
}
iCount ++;
}
示例14: insert
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public static AriaSuggestBox insert(RootPanel panel) {
String config = panel.getElement().getAttribute("configuration");
final String onchange = panel.getElement().getAttribute("onchange");
AriaTextBox text = new AriaTextBox(panel.getElement().getFirstChildElement());
text.getElement().setAttribute("autocomplete", "off");
AriaSuggestBox box = new AriaSuggestBox(text, new CourseNumbersSuggestBox(config));
if (onchange != null)
box.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
ToolBox.eval(onchange);
}
});
panel.add(box);
return box;
}
示例15: show
import com.google.gwt.user.client.ui.RootPanel; //导入依赖的package包/类
public void show(List<EventMeetingRow> meetings, ApproveEventRpcRequest.Operation operation) {
iTable.setValue(meetings);
switch (operation) {
case APPROVE: setText(MESSAGES.dialogApprove()); break;
case REJECT: setText(MESSAGES.dialogReject()); break;
case INQUIRE: setText(MESSAGES.dialogInquire()); break;
case CANCEL: setText(MESSAGES.dialogCancel()); break;
}
iFooter.setEnabled("approve", operation == ApproveEventRpcRequest.Operation.APPROVE);
iFooter.setEnabled("reject", operation == ApproveEventRpcRequest.Operation.REJECT);
iFooter.setEnabled("inquire", operation == ApproveEventRpcRequest.Operation.INQUIRE);
iFooter.setEnabled("cancel", operation == ApproveEventRpcRequest.Operation.CANCEL);
iFileUpload.check();
center();
if (iStandardNotes.getItemCount() == 0)
iNotes.setFocus(true);
else
iStandardNotes.setFocus(true);
RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
}