本文整理匯總了Java中com.vaadin.ui.VerticalLayout.setHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java VerticalLayout.setHeight方法的具體用法?Java VerticalLayout.setHeight怎麽用?Java VerticalLayout.setHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.VerticalLayout
的用法示例。
在下文中一共展示了VerticalLayout.setHeight方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: buildSidebar
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private VerticalLayout buildSidebar() {
VerticalLayout sideBar = new VerticalLayout();
sideBar.addStyleName("sidebar");
sideBar.addComponent(buildMainMenu());
sideBar.setExpandRatio(this.menu, 1);
sideBar.setWidth(null);
sideBar.setHeight("100%");
return sideBar;
}
示例3: 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;
}
示例4: SearchAnneeUnivApoWindow
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**
* Crée une fenêtre de recherche de anneeUni
*/
public SearchAnneeUnivApoWindow() {
/* Style */
setWidth(740, Unit.PIXELS);
setHeight(480, Unit.PIXELS);
setModal(true);
setResizable(true);
/* Layout */
VerticalLayout layout = new VerticalLayout();
setContent(layout);
layout.setHeight(100, Unit.PERCENTAGE);
layout.setMargin(true);
layout.setSpacing(true);
/* Titre */
setCaption(applicationContext.getMessage("window.search.anneeUni.title", null, Locale.getDefault()));
/* Table de Resultat de recherche*/
List<SiScolAnneeUni> listeAnneeUni = cacheController.getListeAnneeUni();
if (listeAnneeUni.size()==0){
layout.addComponent(new Label(applicationContext.getMessage("window.search.anneeUni.noannee", null, Locale.getDefault())));
}
tableResult = new TableFormating(null, new BeanItemContainer<SiScolAnneeUni>(SiScolAnneeUni.class,listeAnneeUni));
String[] columnHeadersHarp = new String[FIELDS_ORDER.length];
for (int fieldIndex = 0; fieldIndex < FIELDS_ORDER.length; fieldIndex++){
columnHeadersHarp[fieldIndex] = applicationContext.getMessage("window.search.anneeUni."+FIELDS_ORDER[fieldIndex], null, Locale.getDefault());
}
tableResult.setVisibleColumns((Object[])FIELDS_ORDER);
tableResult.setSortContainerPropertyId(SiScolAnneeUni_.codAnu.getName());
tableResult.setSortAscending(false);
tableResult.setColumnHeaders(columnHeadersHarp);
tableResult.setColumnCollapsingAllowed(true);
tableResult.setColumnReorderingAllowed(true);
tableResult.setSelectable(true);
tableResult.setImmediate(true);
tableResult.setSizeFull();
tableResult.addItemSetChangeListener(e -> tableResult.sanitizeSelection());
tableResult.addValueChangeListener(e -> {
/* Le bouton d'enregistrement est actif seulement si un anneeUni est sélectionné. */
boolean anneeUniIsSelected = tableResult.getValue() instanceof SiScolAnneeUni;
btnValider.setEnabled(anneeUniIsSelected);
});
layout.addComponent(tableResult);
layout.setExpandRatio(tableResult, 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("btnAdd", 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();
}
示例5: SearchCommissionWindow
import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
/**Crée une fenêtre de recherche de commission
* @param ctrCand
*/
public SearchCommissionWindow(CentreCandidature ctrCand) {
/* Style */
setWidth(850, Unit.PIXELS);
setHeight(480, Unit.PIXELS);
setModal(true);
setResizable(true);
/* Layout */
VerticalLayout layout = new VerticalLayout();
setContent(layout);
layout.setHeight(100, Unit.PERCENTAGE);
layout.setMargin(true);
layout.setSpacing(true);
/* Titre */
setCaption(applicationContext.getMessage("commission.window.search.title", null, Locale.getDefault()));
/* Table de Resultat de recherche*/
List<Commission> listeCommission;
if (ctrCand != null){
listeCommission = commissionController.getCommissionsByCtrCand(ctrCand);
}else{
listeCommission = commissionController.getCommissionsGestionnaire();
}
grid.addItems(listeCommission);
grid.initColumn(FIELDS_ORDER, "commission.table.", Commission_.codComm.getName());
grid.addSelectionListener(e->{
// Le bouton d'enregistrement est actif seulement si une commission est sélectionnée.
boolean isSelected = grid.getSelectedItem() instanceof Commission;
btnValider.setEnabled(isSelected);
});
grid.addItemClickListener(e->{
if (e.isDoubleClick()) {
grid.select(e.getItemId());
btnValider.click();
}
});
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();
}