本文整理匯總了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);
}
示例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);
}
示例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;
}