當前位置: 首頁>>代碼示例>>Java>>正文


Java VerticalLayout.setSizeUndefined方法代碼示例

本文整理匯總了Java中com.vaadin.ui.VerticalLayout.setSizeUndefined方法的典型用法代碼示例。如果您正苦於以下問題:Java VerticalLayout.setSizeUndefined方法的具體用法?Java VerticalLayout.setSizeUndefined怎麽用?Java VerticalLayout.setSizeUndefined使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.VerticalLayout的用法示例。


在下文中一共展示了VerticalLayout.setSizeUndefined方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addMentionCnil

import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
 * ajoute la mention CNIL
 */
private void addMentionCnil() {
	panelCnil.setWidth(100, Unit.PERCENTAGE);
	panelCnil.setHeight(100, Unit.PIXELS);
	addComponent(panelCnil);
	setComponentAlignment(panelCnil, Alignment.BOTTOM_LEFT);

	VerticalLayout vlContentLabelCnil = new VerticalLayout();
	vlContentLabelCnil.setSizeUndefined();
	vlContentLabelCnil.setWidth(100, Unit.PERCENTAGE);
	vlContentLabelCnil.setMargin(true);

	labelCnil.setContentMode(ContentMode.HTML);
	labelCnil.addStyleName(ValoTheme.LABEL_TINY);
	labelCnil.addStyleName(StyleConstants.LABEL_JUSTIFY);
	labelCnil.addStyleName(StyleConstants.LABEL_SAUT_LIGNE);
	vlContentLabelCnil.addComponent(labelCnil);

	panelCnil.setContent(vlContentLabelCnil);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:23,代碼來源:AccueilView.java

示例2: init

import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
    setSizeFull();

    user = new TextField("User:");
    user.setWidth("300px");
    user.setRequiredIndicatorVisible(true);

    password = new PasswordField("Password:");
    password.setWidth("300px");
    user.setRequiredIndicatorVisible(true);
    password.setValue("");

    VerticalLayout fields = new VerticalLayout(user, password, loginButton);
    fields.setCaption("Please login to access the application");
    fields.setSpacing(true);
    fields.setMargin(new MarginInfo(true, true, true, false));
    fields.setSizeUndefined();

    VerticalLayout uiLayout = new VerticalLayout(fields);
    uiLayout.setSizeFull();
    uiLayout.setComponentAlignment(fields, Alignment.MIDDLE_CENTER);

    setFocusedComponent(user);

    setContent(uiLayout);
}
 
開發者ID:kuylim,項目名稱:spring-boot-security-vaadin,代碼行數:28,代碼來源:LoginUI.java

示例3: getLogsPanel

import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private Panel getLogsPanel(Application app, String logs, String propertyLoggingPath) {

		// Logs text area
		Label logsLabel = new Label(logs, ContentMode.PREFORMATTED);
		logsLabel.setStyleName("app-logs");

		// Create panel
		VerticalLayout layout = new VerticalLayout(logsLabel);
		layout.setSpacing(false);
		layout.setSizeUndefined();

		Panel panel = new Panel(String.format("Application Logs (from %s)", propertyLoggingPath), layout);
		panel.setHeight(500, Unit.PIXELS);
		scrollToBottom(panel);

		// Auto refresh logs
		ajaxRefreshInit(args -> {
			int uiId = ((PersephoneUI)getUI()).getUIId();
			LOGGER.trace("UI-{}: Logs Refresh Start", uiId);

			// Get current session range
			LogsRange currentSessionRange = ((PersephoneUI)getUI()).getUserData().getCurrentRange();
			LOGGER.trace("UI-{}: Logs Refresh: Current Range: {}-{}", uiId, currentSessionRange.getStart(), currentSessionRange.getEnd());

			// Get next logs range to retrieve
			LogsRange nextRange = logsService.getLogsRange(app, currentSessionRange, bytesToRetrieveRefresh);
			LOGGER.trace("UI-{}: Logs Refresh: Next Range: {}-{}", uiId, nextRange.getStart(), nextRange.getEnd());

			// Update current range into user session
			((PersephoneUI)getUI()).getUserData().setCurrentRange(nextRange);

			// Get logs
			String newLogs = logsService.getLogs(app, nextRange);

			// Update UI
			if(!StringUtils.isEmpty(newLogs)) {

				String oldLogs = logsLabel.getValue();

				// Too much logs displayed => let's strip them out
				if(oldLogs.length() + newLogs.length() > bytesToDisplayMax) {
					newLogs = oldLogs + newLogs;
					LOGGER.trace("UI-{}: Logs Refresh: Too much logs are going to be displayed (length={}), it will be stripped to {} chars", uiId, newLogs.length(), bytesToDisplayMax);
					newLogs = newLogs.substring(newLogs.length() - bytesToDisplayMax);
					logsLabel.setValue(newLogs);
				}
				// max length not reached yet
				else {
					logsLabel.setValue(oldLogs + newLogs);
				}
			}

			scrollToBottom(panel);

			LOGGER.trace("UI-{} Logs Refresh End", uiId);
		});

		return panel;
	}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:60,代碼來源:LogsPage.java


注:本文中的com.vaadin.ui.VerticalLayout.setSizeUndefined方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。