当前位置: 首页>>代码示例>>Java>>正文


Java HorizontalLayout.setSizeFull方法代码示例

本文整理汇总了Java中com.vaadin.ui.HorizontalLayout.setSizeFull方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout.setSizeFull方法的具体用法?Java HorizontalLayout.setSizeFull怎么用?Java HorizontalLayout.setSizeFull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.HorizontalLayout的用法示例。


在下文中一共展示了HorizontalLayout.setSizeFull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mainLayout

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的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: createComponent

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的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

示例3: buttonsLayout

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
private Layout buttonsLayout(Button... buttons) {
	HorizontalLayout layout = new HorizontalLayout();
	layout.setSizeFull();

	List<Component> components = new ArrayList<>(Arrays.asList(buttons));

	// Set HTML id for each button
	for(Component b : components) {
		b.setId(b.getCaption().replace(' ', '-')+"-btn");
	}

	// Split components into sublists of 5 elements
	int partitionSize = 5;
	List<List<Component>> partitions = new ArrayList<>();
	for (int i = 0; i < components.size(); i += partitionSize) {
		partitions.add(components.subList(i, Math.min(i + partitionSize, components.size())));
	}

	// Create vertical layouts for each list of buttons
	for(List<Component> sublist : partitions) {
		VerticalLayout vLayout = new VerticalLayout();
		vLayout.setMargin(false);

		sublist.stream().forEach(btn -> {
			btn.setSizeFull();
			vLayout.addComponent(btn);
		});

		layout.addComponent(vLayout);
	}

	return layout;
}
 
开发者ID:vianneyfaivre,项目名称:Persephone,代码行数:34,代码来源:ApplicationOverviewPanel.java

示例4: init

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request)
{
    setLocale(Locale.US);

    final HorizontalLayout rootLayout = new HorizontalLayout();
    rootLayout.setSpacing(false);
    rootLayout.setSizeFull();

    final VerticalLayout navigationLayout = new VerticalLayout();
    navigationLayout.setWidth(null);
    final Label title = new Label("HTML5 History API<br>Navigation", ContentMode.HTML);
    title.setStyleName(ValoTheme.LABEL_H1);
    title.addStyleName(ValoTheme.TEXTFIELD_ALIGN_CENTER);
    navigationLayout.addComponent(title);
    rootLayout.addComponent(navigationLayout);

    final TextField param1Field = new TextField("Parameter 1");
    final TextField param2Field = new TextField("Parameter 2");

    final Button homeButton = new Button("Home View",
            event -> getNavigator().navigateTo(HomeView.VIEW_NAME + "/" +
                    getParameters(param1Field.getValue(), param2Field.getValue())));
    navigationLayout.addComponent(homeButton);

    final Button parameterButton = new Button("Other View",
            event -> getNavigator().navigateTo(OtherView.VIEW_NAME + "/" +
                    getParameters(param1Field.getValue(), param2Field.getValue())));
    navigationLayout.addComponents(parameterButton, param1Field, param2Field);

    final Panel contentPanel = new Panel();
    contentPanel.setSizeFull();
    rootLayout.addComponent(contentPanel);
    rootLayout.setExpandRatio(contentPanel, 1.0f);

    setNavigator(HistoryApiNavigatorFactory.createHistoryApiNavigator(this, new CustomViewDisplay(contentPanel)));

    final HomeView homeView = new HomeView();
    getNavigator().addView(HomeView.VIEW_NAME, homeView);
    getNavigator().addView(OtherView.VIEW_NAME, new OtherView());

    setContent(rootLayout);
}
 
开发者ID:apm78,项目名称:history-api-navigation,代码行数:44,代码来源:DemoUI.java


注:本文中的com.vaadin.ui.HorizontalLayout.setSizeFull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。