本文整理匯總了Java中com.vaadin.ui.VerticalLayout.setSizeFull方法的典型用法代碼示例。如果您正苦於以下問題:Java VerticalLayout.setSizeFull方法的具體用法?Java VerticalLayout.setSizeFull怎麽用?Java VerticalLayout.setSizeFull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.VerticalLayout
的用法示例。
在下文中一共展示了VerticalLayout.setSizeFull方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.setSpacing(true);
setContent(root);
MHorizontalLayout horizontalLayout = new MHorizontalLayout();
for (MenuEntry menuEntry : menuEntries) {
horizontalLayout.addComponent(new MButton(menuEntry.getName(), event -> {
navigator.navigateTo(menuEntry.getNavigationTarget());
}));
}
root.addComponent(horizontalLayout);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1.0f);
}
示例2: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
final VerticalLayout rootLayout = new VerticalLayout();
rootLayout.setSizeFull();
setContent(rootLayout);
final CssLayout navigationBar = new CssLayout();
navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
navigationBar.addComponent(createNavigationButton("Demo View (Default)",
Constants.VIEW_DEFAULT));
navigationBar.addComponent(createNavigationButton("Stream View",
Constants.VIEW_STREAM));
rootLayout.addComponent(navigationBar);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
rootLayout.addComponent(springViewDisplay);
rootLayout.setExpandRatio(springViewDisplay, 1.0f);
}
示例3: createSubView
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private void createSubView(String title, ToolbarButtons[] buttons) {
setSizeFull();
final VerticalLayout layout = new VerticalLayout();
layout.addStyleName(StyleConstants.BASE_CONTAINER);
layout.setSizeFull();
final VerticalLayout panel = new VerticalLayout();
panel.addStyleName("panel");
panel.setSizeFull();
layout.addComponent(createHeader(title));
layout.addComponent(panel);
if (buttons != null) {
panel.addComponent(createToolbar(buttons));
}
panel.addComponent(createTable());
panel.setExpandRatio(this.table, 1L);
layout.setExpandRatio(panel, 1L);
addComponent(layout);
}
示例4: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
setSizeFull();
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(true);
testGrid.setSizeFull();
testGrid.getEditor().setEnabled(true);
testGrid.setItems(getCustomers());
layout.addComponent(testGrid);
setContent(layout);
}
示例5: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
// The root of the component hierarchy
VerticalLayout content = new VerticalLayout();
content.setSizeFull(); // Use entire window
setContent(content); // Attach to the UI
// Add some component
content.addComponent(new Label("<b>Hello!</b> - How are you?", ContentMode.HTML));
}
示例6: mainLayout
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private HorizontalLayout mainLayout() {
menuLayout = new VerticalLayout();
menuLayout.setStyleName(ValoTheme.MENU_ROOT);
menuLayout.setWidth(100, Unit.PERCENTAGE);
menuLayout.setHeight(100, Unit.PERCENTAGE);
menuLayout.setSizeFull();
final CssLayout menuButtons = new CssLayout();
menuButtons.setSizeFull();
menuButtons.addStyleName(ValoTheme.MENU_PART);
menuButtons.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
menuButtons.addComponents(
createMenuButton(VaadinIcons.VIEWPORT, "Dashboard", DashboardComponent::new),
createMenuButton(VaadinIcons.SITEMAP, "Sitemap", DashboardComponent::new),
createMenuButton(VaadinIcons.CALC_BOOK, "Calculate", CalcComponent::new),
createMenuButton(VaadinIcons.NOTEBOOK, "Write", WriteComponent::new),
createMenuButtonForNotification(VaadinIcons.EXIT, "Logout", "You want to go?")
);
menuLayout.addComponent(menuButtons);
contentLayout = new CssLayout(new Label("Content"));
contentLayout.setSizeFull();
final HorizontalLayout layout = new HorizontalLayout();
layout.setSizeFull();
layout.addComponent(menuLayout);
layout.addComponent(contentLayout);
layout.setExpandRatio(menuLayout, 0.20f);
layout.setExpandRatio(contentLayout, 0.80f);
return layout;
}
示例7: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setSpacing(true);
/*Layout des mails*/
VerticalLayout layoutMailModel = new VerticalLayout();
layoutMailModel.setSizeFull();
layoutMailModel.setSpacing(true);
layoutMailModel.setMargin(true);
/*Layout des typ decision*/
VerticalLayout layoutMailTypeDec = new VerticalLayout();
layoutMailTypeDec.setSizeFull();
layoutMailTypeDec.setSpacing(true);
layoutMailTypeDec.setMargin(true);
/*Le layout a onglet*/
TabSheet sheet = new TabSheet();
sheet.setImmediate(true);
sheet.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
addComponent(sheet);
sheet.setSizeFull();
sheet.addTab(layoutMailModel, applicationContext.getMessage("mail.model.title", null, UI.getCurrent().getLocale()),FontAwesome.ENVELOPE_O);
sheet.addTab(layoutMailTypeDec, applicationContext.getMessage("mail.typdec.title", null, UI.getCurrent().getLocale()),FontAwesome.ENVELOPE);
/*Populate le layoutMailModel*/
populateMailModelLayout(layoutMailModel);
/*Populate le layoutMailModel*/
populateMailTypeDecLayout(layoutMailTypeDec);
/* Inscrit la vue aux mises à jour de mail */
mailEntityPusher.registerEntityPushListener(this);
}
示例8: initLayout
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
* Initialise le layout principal
*/
private void initLayout() {
layout.setSizeFull();
setContent(layout);
menuLayout.setPrimaryStyleName(ValoTheme.MENU_ROOT);
layoutWithSheet.setPrimaryStyleName(StyleConstants.VALO_CONTENT);
layoutWithSheet.addStyleName(StyleConstants.SCROLLABLE);
layoutWithSheet.setSizeFull();
VerticalLayout vlAll = new VerticalLayout();
vlAll.addStyleName(StyleConstants.SCROLLABLE);
vlAll.setSizeFull();
subBarMenu.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
subBarMenu.setVisible(false);
vlAll.addComponent(subBarMenu);
contentLayout.addStyleName(StyleConstants.SCROLLABLE);
contentLayout.setSizeFull();
vlAll.addComponent(contentLayout);
vlAll.setExpandRatio(contentLayout, 1);
layoutWithSheet.addComponent(vlAll);
menuButtonLayout.addStyleName(StyleConstants.VALO_MY_MENU_MAX_WIDTH);
layout.setExpandRatio(layoutWithSheet, 1);
Responsive.makeResponsive(this);
addStyleName(ValoTheme.UI_WITH_MENU);
}
示例9: 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);
}
示例10: createComponent
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected Component createComponent() {
final CssLayout contentLayout = new CssLayout(new Label("Content"));
contentLayout.setSizeFull();
contentLayout.setId(cssLayoutID().apply(MainUI.class, "Content"));
final VerticalLayout menuLayout = new VerticalLayout();
menuLayout.setId(verticalLayoutID().apply(MainUI.class, "MenuLayout"));
menuLayout.setStyleName(ValoTheme.MENU_ROOT);
menuLayout.setWidth(100, Unit.PERCENTAGE);
menuLayout.setHeight(100, Unit.PERCENTAGE);
menuLayout.setSizeFull();
// to hard bound
menuLayout.addComponent(new MenuComponent(contentLayout));
final HorizontalLayout mainLayout = new HorizontalLayout();
mainLayout.setId(horizontalLayoutID().apply(MainUI.class, "MainLayout"));
mainLayout.setSizeFull();
mainLayout.addComponent(menuLayout);
mainLayout.addComponent(contentLayout);
mainLayout.setExpandRatio(menuLayout, 0.20f);
mainLayout.setExpandRatio(contentLayout, 0.80f);
return mainLayout;
}
示例11: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
// Root layout
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setSpacing(false);
root.setMargin(false);
setContent(root);
// Main panel
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1);
// Footer
Layout footer = getFooter();
root.addComponent(footer);
root.setExpandRatio(footer, 0);
// Error handler
UI.getCurrent().setErrorHandler(new UIErrorHandler());
// Disable session expired notification, the page will be reloaded on any action
VaadinService.getCurrent().setSystemMessagesProvider(
systemMessagesInfo -> {
CustomizedSystemMessages msgs = new CustomizedSystemMessages();
msgs.setSessionExpiredNotificationEnabled(false);
return msgs;
});
}
示例12: popupRowOnClick
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private PopupView popupRowOnClick() {
VerticalLayout popupContent = new VerticalLayout();
popupContent.setSizeFull();
PopupView popup = new PopupView(null, popupContent);
grid.addItemClickListener(e -> {
popup.setData(e.getItem());
popup.setPopupVisible(true);
});
popup.addPopupVisibilityListener(event -> {
if (event.isPopupVisible()) {
popupContent.removeAllComponents();
PropertyItem item = (PropertyItem) popup.getData();
Label popupTitle = new Label("<h2>Property details</h2>", ContentMode.HTML);
popupTitle.setSizeFull();
Button popupClose = new Button(VaadinIcons.CLOSE);
popupClose.addClickListener(e -> popup.setPopupVisible(false));
HorizontalLayout title = new HorizontalLayout(popupTitle, popupClose);
title.setSizeFull();
title.setExpandRatio(popupTitle, 3);
title.setExpandRatio(popupClose, 1);
title.setComponentAlignment(popupClose, Alignment.TOP_RIGHT);
Label propertyKey= new Label(String.format("Key: '%s'", item.getKey()), ContentMode.TEXT);
Label propertyValue = new Label(String.format("Value: '%s'", item.getValue()), ContentMode.TEXT);
propertyValue.setSizeFull();
Label propertyOrigin = new Label(String.format("Origin: '%s'", item.getOrigin()), ContentMode.TEXT);
popupContent.addComponents(title, propertyKey, propertyValue, propertyOrigin);
}
});
popup.setHideOnMouseOut(false);
popup.setSizeFull();
return popup;
}
示例13: InfoWindow
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
* Crée une fenêtre d'information
* @param message
* @param titre
*/
public InfoWindow(String titre, String message, Integer width, Integer percentageHeight) {
/* Style */
if (width==null){
width = 400;
}
setWidth(width, Unit.PIXELS);
if (percentageHeight!=null){
setHeight(percentageHeight,Unit.PERCENTAGE);
}
setModal(true);
setResizable(false);
setClosable(false);
/* Layout */
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
/* Titre */
setCaption(titre);
/* Texte */
Label textLabel = new Label(message,ContentMode.HTML);
if (percentageHeight!=null){
layout.setSizeFull();
/* Titre */
VerticalLayout layoutItem = new VerticalLayout();
layoutItem.setMargin(true);
layoutItem.setWidth(100, Unit.PERCENTAGE);
layoutItem.setSpacing(true);
layoutItem.addComponent(textLabel);
/* Panel */
Panel panel = new Panel();
panel.setSizeFull();
panel.setContent(layoutItem);
layout.addComponent(panel);
layout.setExpandRatio(panel, 1);
}else{
layout.addComponent(textLabel);
}
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
layout.addComponent(buttonsLayout);
btnAnnuler = new OneClickButton(applicationContext.getMessage("btnClose", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
btnAnnuler.addClickListener(e -> close());
buttonsLayout.addComponent(btnAnnuler);
buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_CENTER);
/* Centre la fenêtre */
center();
}
示例14: SearchCtrCandWindow
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
* Crée une fenêtre de recherche de centre de candidature
*/
public SearchCtrCandWindow() {
/* Style */
setWidth(740, Unit.PIXELS);
setHeight(480, Unit.PIXELS);
setModal(true);
setResizable(true);
/* Layout */
VerticalLayout layout = new VerticalLayout();
setContent(layout);
layout.setSizeFull();
layout.setMargin(true);
layout.setSpacing(true);
/* Titre */
setCaption(applicationContext.getMessage("ctrCand.window.search.title", null, Locale.getDefault()));
/* Table de Resultat de recherche*/
grid.addItems(centreCandidatureController.getListCentreCandidature());
grid.initColumn(FIELDS_ORDER, "ctrCand.table.", CentreCandidature_.codCtrCand.getName());
grid.addSelectionListener(e->{
// Le bouton d'enregistrement est actif seulement si un ctrCand est sélectionnée.
boolean isSelected = grid.getSelectedItem() instanceof CentreCandidature;
btnValider.setEnabled(isSelected);
});
grid.addItemClickListener(e->{
if (e.isDoubleClick()) {
grid.select(e.getItemId());
btnValider.click();
}
});
grid.setColumnWidth(CentreCandidature_.codCtrCand.getName(), 180);
grid.setExpendColumn(CentreCandidature_.libCtrCand.getName());
layout.addComponent(grid);
layout.setExpandRatio(grid, 1.0f);
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
layout.addComponent(buttonsLayout);
btnAnnuler = new OneClickButton(applicationContext.getMessage("btnAnnuler", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
btnAnnuler.addClickListener(e -> close());
buttonsLayout.addComponent(btnAnnuler);
buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_LEFT);
btnValider = new OneClickButton(applicationContext.getMessage("btnValid", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
btnValider.setEnabled(false);
btnValider.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnValider.addClickListener(e -> {
performAction();
});
buttonsLayout.addComponent(btnValider);
buttonsLayout.setComponentAlignment(btnValider, Alignment.MIDDLE_RIGHT);
/* Centre la fenêtre */
center();
}
示例15: init
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
layout.setMargin(true);
layout.setSizeFull();
Grid<DemoPerson> grid = new Grid("<b>Demo Grid</b>", new ListDataProvider(DemoPerson.getPersonList()));
grid.setCaptionAsHtml(true);
grid.setSizeFull();
grid.setSelectionMode(Grid.SelectionMode.NONE);
Grid.Column<DemoPerson, String> idColumn = grid.addColumn(DemoPerson::getId).setCaption("Id");
Grid.Column<DemoPerson, String> firstNameColumn = grid.addColumn(DemoPerson::getFirstName).setCaption("Firstname");
Grid.Column<DemoPerson, String> surNameColumn = grid.addColumn(DemoPerson::getSurName).setCaption("Surname");
Grid.Column<DemoPerson, String> companyColumn = grid.addColumn(DemoPerson::getCompany,
new ClickableTextRenderer(getCompanyClickListener())).setCaption("Company");
Grid.Column<DemoPerson, String> companyTypeColumn = grid.addColumn(DemoPerson::getCompanyType).setCaption("Company Type");
Grid.Column<DemoPerson, String> cityColumn = grid.addColumn(DemoPerson::getCity).setCaption("City");
// Use the advanced form of the Clickable Text Renderer on
// column "city". This will require a value provider where the PRESENTATION
// class is of type ClickableText. Because the city is of type String
// the value provider must convert from String to ClickableText.
cityColumn.setRenderer((String source) -> {
ClickableText ct = new ClickableText();
ct.description = "Will take you to " + source; // Sets the HTML title attribute, aka tooltip
// I want a space between the underlined text and the icon. To avoid the
// space being underlined (because of the link styling) I use a
// a different style for the space itself.
ct.value = source + "<span class=\"v-icon\"> </span>" + VaadinIcons.EXTERNAL_LINK.getHtml();
ct.isHTML = true;
return ct;
}, new ClickableTextRendererAdv<>(getCityClickListener()));
layout.addComponent(grid);
setContent(layout);
}