List of usage examples for com.vaadin.ui VerticalLayout setSpacing
@Override public void setSpacing(boolean spacing)
From source file:com.purebred.core.view.ResultsConnectedEntityForm.java
License:Open Source License
private HorizontalLayout createNavigationFormLayout() { HorizontalLayout navigationFormLayout = new HorizontalLayout(); navigationFormLayout.setSizeUndefined(); VerticalLayout previousButtonLayout = new VerticalLayout(); previousButtonLayout.setSizeUndefined(); previousButtonLayout.setMargin(false); previousButtonLayout.setSpacing(false); Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined();/*w w w . j av a2s . c o m*/ previousButtonLayout.addComponent(spaceLabel); previousButton = new Button(null, this, "previousItem"); previousButton.setDescription(entityForm.uiMessageSource.getMessage("entityForm.previous.description")); previousButton.setSizeUndefined(); previousButton.addStyleName("borderless"); previousButton.setIcon(new ThemeResource("icons/16/previous.png")); if (entityForm.getViewableToManyRelationships().size() == 0) { HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout(); previousButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); previousButtonHorizontalLayout.addComponent(previousButton); previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel); previousButtonLayout.addComponent(previousButtonHorizontalLayout); } else { previousButtonLayout.addComponent(previousButton); } navigationFormLayout.addComponent(previousButtonLayout); navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT); navigationFormLayout.addComponent(entityForm); VerticalLayout nextButtonLayout = new VerticalLayout(); nextButtonLayout.setSizeUndefined(); nextButtonLayout.setMargin(false); nextButtonLayout.setSpacing(false); spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined(); previousButtonLayout.addComponent(spaceLabel); nextButtonLayout.addComponent(spaceLabel); nextButton = new Button(null, this, "nextItem"); nextButton.setDescription(entityForm.uiMessageSource.getMessage("entityForm.next.description")); nextButton.setSizeUndefined(); nextButton.addStyleName("borderless"); nextButton.setIcon(new ThemeResource("icons/16/next.png")); HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout(); nextButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel); nextButtonHorizontalLayout.addComponent(nextButton); nextButtonLayout.addComponent(nextButtonHorizontalLayout); navigationFormLayout.addComponent(nextButtonLayout); navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT); navigationFormLayout.setSpacing(false); navigationFormLayout.setMargin(false); return navigationFormLayout; }
From source file:com.rdonasco.config.web.ConfigApplication.java
License:Apache License
@Override public void init() { Window mainWindow = new Window("rdonasco Config"); setMainWindow(mainWindow);/* w ww .j a v a2 s . c o m*/ final ConfigDataView controlledView = getConfigDataViewController().getControlledView(); // controlledView.setSizeFull(); final VerticalLayout mainWindowLayout = (VerticalLayout) mainWindow.getContent(); Button logoutButton = new Button("Refresh"); logoutButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent event) { try { getConfigDataViewController().refreshView(); } catch (WidgetException ex) { LOG.log(Level.WARNING, ex.getMessage(), ex); } } }); setTheme("config"); mainWindowLayout.setMargin(true); mainWindowLayout.setSpacing(true); mainWindowLayout.addStyleName("mainWindow"); mainWindowLayout.setSizeFull(); mainWindowLayout.addComponent(logoutButton); mainWindowLayout.addComponent(controlledView); mainWindowLayout.setExpandRatio(controlledView, 1); }
From source file:com.rdonasco.datamanager.listeditor.view.ListEditorView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("List Editor")); setStyleName(ListEditorTheme.CSS_PANEL_BUBBLE); addItemButton.setCaption(I18NResource.localize("Add new item")); addItemButton.setWidth(100f, UNITS_PERCENTAGE); addItemButton.addStyleName(ListEditorTheme.CSS_SMALL); editorTable.addStyleName(ListEditorTheme.CSS_TABLE_SMALL_STRIPED); editorTable.addStyleName(ListEditorTheme.CSS_TABLE_BORDERLESS); VerticalLayout layout = (VerticalLayout) getContent(); if (!isReadOnly()) { layout.addComponent(addItemButton); }/*from ww w .jav a 2 s.c om*/ layout.addComponent(editorTable); editorTable.setSizeFull(); layout.setExpandRatio(editorTable, 1); layout.setSpacing(true); }
From source file:com.rdonasco.security.application.views.ApplicationListPanelView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { getAddButton().setCaption(I18NResource.localize("Add new")); getAddButton().setDescription(I18NResource.localize("Add new application")); getAddButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_ADD)); getAddButton().setWidth(100, UNITS_PERCENTAGE); getAddButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); getRefreshButton().setCaption(I18NResource.localize("Refresh")); getRefreshButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_REFRESH)); getRefreshButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); VerticalLayout content = ((VerticalLayout) getContent()); content.setMargin(true);// w ww .j a v a 2 s . c o m content.setHeight(600, UNITS_PIXELS); content.removeAllComponents(); if (null != getDataViewListTable()) { getDataViewListTable().setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100F, UNITS_PERCENTAGE); buttonLayout.addComponent(getAddButton()); buttonLayout.addComponent(getRefreshButton()); buttonLayout.setExpandRatio(getAddButton(), 1); content.addComponent(buttonLayout); content.addComponent(getDataViewListTable()); content.setExpandRatio(getDataViewListTable(), 1); content.setSpacing(true); } }
From source file:com.rdonasco.security.group.views.GroupListPanelView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("Groups")); setStyleName(SecurityDefaultTheme.CSS_PANEL_BUBBLE); VerticalLayout content = (VerticalLayout) getContent(); content.setMargin(true);/*from w w w.j a va 2 s . c om*/ content.setHeight(600, UNITS_PIXELS); content.removeAllComponents(); getGroupListTable().setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100F, UNITS_PERCENTAGE); buttonLayout.addComponent(getAddGroupButton()); buttonLayout.addComponent(getRefreshButton()); buttonLayout.setExpandRatio(getAddGroupButton(), 1); content.addComponent(buttonLayout); content.addComponent(getGroupListTable()); content.setExpandRatio(getGroupListTable(), 1); content.setSpacing(true); }
From source file:com.rdonasco.security.role.views.RoleListPanelView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("Roles")); setStyleName(SecurityDefaultTheme.CSS_PANEL_BUBBLE); VerticalLayout content = (VerticalLayout) getContent(); content.setMargin(true);/*from ww w. j ava2s . c om*/ content.setHeight(600, UNITS_PIXELS); content.removeAllComponents(); getRoleListTable().setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100F, UNITS_PERCENTAGE); buttonLayout.addComponent(addRoleButton); buttonLayout.addComponent(refreshButton); buttonLayout.setExpandRatio(addRoleButton, 1); content.addComponent(buttonLayout); content.addComponent(getRoleListTable()); content.setExpandRatio(getRoleListTable(), 1); content.setSpacing(true); }
From source file:com.rdonasco.security.user.views.UserCapabilitiesView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("User Capabilities")); setStyleName(SecurityDefaultTheme.CSS_PANEL_BUBBLE); getUserCapabilitiesTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_SMALL_STRIPED); getUserCapabilitiesTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_BORDERLESS); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSpacing(true); layout.addComponent(getUserCapabilitiesTable()); getUserCapabilitiesTable().setSizeFull(); layout.setExpandRatio(getUserCapabilitiesTable(), 1); }
From source file:com.rdonasco.security.user.views.UserGroupsView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("User Groups")); setStyleName(SecurityDefaultTheme.CSS_PANEL_BUBBLE); getUserGroupsTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_SMALL_STRIPED); getUserGroupsTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_BORDERLESS); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSpacing(true); layout.addComponent(getUserGroupsTable()); getUserGroupsTable().setSizeFull();//from w ww . jav a 2 s . c o m layout.setExpandRatio(getUserGroupsTable(), 1); }
From source file:com.rdonasco.security.user.views.UserListPanelView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { getAddUserButton().setCaption(I18NResource.localize("Add new user")); getAddUserButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_ADD)); getAddUserButton().setWidth(100, UNITS_PERCENTAGE); getAddUserButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); getRefreshButton().setCaption("Refresh"); getRefreshButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_REFRESH)); getRefreshButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); VerticalLayout content = ((VerticalLayout) getContent()); content.setMargin(true);//from w w w . java 2 s .c om content.setHeight(600, UNITS_PIXELS); content.removeAllComponents(); if (null != getDataViewListTable()) { getDataViewListTable().setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100F, UNITS_PERCENTAGE); buttonLayout.addComponent(getAddUserButton()); buttonLayout.addComponent(getRefreshButton()); buttonLayout.setExpandRatio(getAddUserButton(), 1); content.addComponent(buttonLayout); content.addComponent(getDataViewListTable()); content.setExpandRatio(getDataViewListTable(), 1); content.setSpacing(true); } }
From source file:com.rdonasco.security.user.views.UserRolesView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { setCaption(I18NResource.localize("User Roles")); setStyleName(SecurityDefaultTheme.CSS_PANEL_BUBBLE); getUserRolesTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_SMALL_STRIPED); getUserRolesTable().addStyleName(SecurityDefaultTheme.CSS_TABLE_BORDERLESS); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSpacing(true); layout.addComponent(getUserRolesTable()); getUserRolesTable().setSizeFull();/*from www. j av a 2s. c o m*/ layout.setExpandRatio(getUserRolesTable(), 1); }