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


Java VerticalLayout.setStyleName方法代碼示例

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


在下文中一共展示了VerticalLayout.setStyleName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
 
開發者ID:Java-Publications,項目名稱:javamagazin-009-microkernel,代碼行數:35,代碼來源:MainView.java

示例2: createTab

import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private VerticalLayout createTab(String caption, String title, FormLayout content, String guid) {
    VerticalLayout tabSheet = new VerticalLayout();
    tabSheet.setCaption(caption);
    tabSheet.setStyleName(StyleConstants.TAB_SHEET);
    Panel panel = new Panel();
    // creating subHeader inside panel
    panel.setContent(content);
    panel.setSizeFull();
    tabSheet.addComponent(ViewUtil.createSubHeader(title, guid));
    tabSheet.addComponent(panel);
    return tabSheet;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:13,代碼來源:MaintenanceView.java

示例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;
}
 
開發者ID:Java-Publications,項目名稱:vaadin-016-helloworld-14,代碼行數:29,代碼來源:MainView.java

示例4: getInfoLabels

import com.vaadin.ui.VerticalLayout; //導入方法依賴的package包/類
private VerticalLayout getInfoLabels(List<String> infos) {
	VerticalLayout layout = new VerticalLayout();

	infos.stream()
		 .filter(i -> !StringUtils.isEmpty(i))
		 .forEach(info -> layout.addComponent(new Label(info)));

	layout.setStyleName("persephone-card-label");
	layout.setMargin(false);

	return layout;
}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:13,代碼來源:Card.java


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