当前位置: 首页>>代码示例>>Java>>正文


Java RootPanel类代码示例

本文整理汇总了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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:24,代码来源:PreviewWidget.java

示例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);
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:18,代码来源:VideoFullScreenHelper.java

示例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());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:18,代码来源:MultiPageController.java

示例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));        
}
 
开发者ID:timofeevda,项目名称:gwt-rxjs-jsinterop,代码行数:17,代码来源:OnPageTest.java

示例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();
}
 
开发者ID:expansel,项目名称:errai-spring-boot-sample,代码行数:17,代码来源:App.java

示例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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:TeachingRequestDetailPage.java

示例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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:TeachingRequestDetailPage.java

示例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;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:AriaStatus.java

示例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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:Client.java

示例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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:RoomSharingWidget.java

示例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);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:PeriodPreferencesWidget.java

示例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()));
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:SolverAllocatedMemory.java

示例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 ++;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:LoadingWidget.java

示例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;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:CourseNumbersSuggestBox.java

示例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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:ApproveDialog.java


注:本文中的com.google.gwt.user.client.ui.RootPanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。