List of usage examples for com.vaadin.ui VerticalLayout setHeight
@Override public void setHeight(float height, Unit unit)
From source file:com.hack23.cia.web.impl.ui.application.views.admin.agentoperations.pagemode.AgentOperationsOverviewPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ADMIN" }) @Override/*from w ww . j a v a2 s .c o m*/ public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout content = createPanelContent(); getMenuItemFactory().createMainPageMenuBar(menuBar); LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION); final ComboBox targetSelect = new ComboBox(TARGET, Arrays.asList(DataAgentTarget.values())); targetSelect.setId(ViewAction.START_AGENT_BUTTON + TARGET2); content.addComponent(targetSelect); content.setExpandRatio(targetSelect, ContentRatio.SMALL2); final ComboBox operationSelect = new ComboBox(OPERATION, Arrays.asList(DataAgentOperation.values())); operationSelect.setId(ViewAction.START_AGENT_BUTTON + OPERATION2); content.addComponent(operationSelect); content.setExpandRatio(operationSelect, ContentRatio.SMALL2); final Button startAgentButton = new Button(START, new StartAgentClickListener(targetSelect, operationSelect, agentContainer)); startAgentButton.setId(ViewAction.START_AGENT_BUTTON.name()); startAgentButton.setIcon(FontAwesome.CROSSHAIRS); content.addComponent(startAgentButton); content.setExpandRatio(startAgentButton, ContentRatio.SMALL3); content.setSizeFull(); content.setMargin(false); content.setSpacing(true); content.setWidth(100, Unit.PERCENTAGE); content.setHeight(100, Unit.PERCENTAGE); return content; }
From source file:com.hack23.cia.web.impl.ui.application.views.common.AbstractView.java
License:Apache License
@Override public final void enter(final ViewChangeEvent event) { try {/*w ww . ja va2s . co m*/ final String parameters = event.getParameters(); for (final PageModeContentFactory pageModeContentFactory : pageModeContentFactoryMap.values()) { if (pageModeContentFactory.matches(pageName, parameters)) { getPanel() .setContent(pageModeContentFactory.createContent(parameters, getBarmenu(), getPanel())); return; } } } catch (final AccessDeniedException e) { LOGGER.warn("Access denided:" + pageName, e); final VerticalLayout panelContent = new VerticalLayout(); panelContent.setMargin(true); panelContent.setWidth(100, Unit.PERCENTAGE); panelContent.setHeight(100, Unit.PERCENTAGE); LabelFactory.createHeader2Label(panelContent, "Access denided:" + pageName); getPanel().setContent(panelContent); getPanel().setCaption("Access denied"); } }
From source file:com.hack23.cia.web.impl.ui.application.views.common.AbstractView.java
License:Apache License
/** * Creates the basic layout with panel and footer. * * @param panelName/*from w ww .j ava2s . co m*/ * the panel name */ protected final void createBasicLayoutWithPanelAndFooter(final String panelName) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true); layout.setWidth(100, Unit.PERCENTAGE); layout.setHeight(100, Unit.PERCENTAGE); final VerticalLayout pageModeContent = new VerticalLayout(); pageModeContent.setMargin(true); pageModeContent.setSpacing(true); pageModeContent.setWidth(100, Unit.PERCENTAGE); pageModeContent.setHeight(100, Unit.PERCENTAGE); layout.addComponent(pageModeContent); final ThemeResource ciaLogoResource = new ThemeResource("cia-logo.png"); final Image ciaLogoImage = new Image(null, ciaLogoResource); final HorizontalLayout topHeader = new HorizontalLayout(); topHeader.addComponent(ciaLogoImage); ciaLogoImage.setWidth("75px"); ciaLogoImage.setHeight("75px"); topHeader.setComponentAlignment(ciaLogoImage, Alignment.MIDDLE_LEFT); topHeader.setExpandRatio(ciaLogoImage, ContentRatio.SMALL); final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout(); final Label titleLabel = new Label("Citizen Intelligence Agency"); titleLabel.setStyleName("Header"); topTitleHeadertPanel.addComponent(titleLabel); topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT); final Label sloganLabel = new Label("// Tracking politicians like bugs!"); sloganLabel.setStyleName("HeaderSlogan"); topTitleHeadertPanel.addComponent(sloganLabel); topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT); topHeader.addComponent(topTitleHeadertPanel); topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT); topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID); topHeaderRightPanel.removeAllComponents(); topHeader.addComponent(topHeaderRightPanel); topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT); topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE); if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN) || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) { final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink(); topHeaderRightPanel.addComponent(userHomePageLink); topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT); final Button logoutButton = new Button(LOGOUT, FontAwesome.SIGN_OUT); final LogoutRequest logoutRequest = new LogoutRequest(); logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId()); logoutButton.addClickListener(new LogoutClickListener(logoutRequest, applicationManager)); topHeaderRightPanel.addComponent(logoutButton); topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT); } else { final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink(); topHeaderRightPanel.addComponent(createRegisterPageLink); topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT); final Link createLoginPageLink = pageLinkFactory.createLoginPageLink(); topHeaderRightPanel.addComponent(createLoginPageLink); topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT); } topHeaderRightPanel.setWidth("100%"); topHeaderRightPanel.setHeight("60px"); topHeader.setWidth("100%"); topHeader.setHeight("60px"); pageModeContent.addComponent(topHeader); pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER); pageModeContent.addComponent(getBarmenu()); pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER); panel = new Panel(panelName); panel.setSizeFull(); pageModeContent.addComponent(panel); pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE); pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink()); setContent(layout); setWidth(100, Unit.PERCENTAGE); setHeight(100, Unit.PERCENTAGE); setSizeFull(); }
From source file:com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractPageModContentFactoryImpl.java
License:Apache License
/** * Creates the panel content.//from w w w.ja v a2 s . c o m * * @return the vertical layout */ protected final VerticalLayout createPanelContent() { final VerticalLayout panelContent = new VerticalLayout(); panelContent.setMargin(true); panelContent.setWidth(100, Unit.PERCENTAGE); panelContent.setHeight(100, Unit.PERCENTAGE); panelContent.setStyleName("Header"); return panelContent; }
From source file:com.hivesys.dashboard.view.repository.RepositoryUpload.java
public RepositoryUpload() { final Label infoLabel = new Label("asasasasasasasxasx"); final VerticalLayout dropPane = new VerticalLayout(infoLabel); dropPane.setComponentAlignment(infoLabel, Alignment.MIDDLE_CENTER); dropPane.setWidth(280.0f, Unit.PIXELS); dropPane.setHeight(200.0f, Unit.PIXELS); dropPane.addStyleName("drop-area"); progress = new ProgressBar(); progress.setIndeterminate(true);/*from w w w.j a v a 2s. co m*/ progress.setVisible(false); dropPane.addComponent(progress); final DragAndDropBox dropBox = new DragAndDropBox(dropPane, progress) { @Override void processFile(String name, String type, ByteArrayOutputStream bas) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }; dropBox.setSizeUndefined(); }
From source file:com.jorambarrez.PropertyPanel.java
License:Apache License
protected void initTrashIcon() { Embedded trashIcon = new Embedded(null, Images.MODELER_TRASH); trashIcon.setWidth(63, UNITS_PIXELS); trashIcon.setHeight(61, UNITS_PIXELS); trashIcon.setType(Embedded.TYPE_IMAGE); VerticalLayout trashLayout = new VerticalLayout(); trashLayout.setWidth(120, UNITS_PIXELS); trashLayout.setHeight(120, UNITS_PIXELS); trashLayout.addComponent(trashIcon); trashLayout.setComponentAlignment(trashIcon, Alignment.MIDDLE_CENTER); DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(trashLayout); dragAndDropWrapper.setDragStartMode(DragStartMode.NONE); dragAndDropWrapper.setSizeUndefined(); addComponent(dragAndDropWrapper);//from w ww . j a va 2s . com setComponentAlignment(dragAndDropWrapper, Alignment.BOTTOM_CENTER); dragAndDropWrapper.setDropHandler(new DropHandler() { private static final long serialVersionUID = 1L; public AcceptCriterion getAcceptCriterion() { return AcceptAll.get(); } public void drop(DragAndDropEvent event) { WrapperTransferable wrapperTransferable = (WrapperTransferable) event.getTransferable(); Node srcNode = (Node) wrapperTransferable.getSourceComponent(); // TODO: use eventrouter! ModelerApp.get().getFlowEditor().removeNode(srcNode); } }); }
From source file:com.mcparland.john.TabsURL.java
License:Apache License
/** * Create the tabs./*from w w w .j a v a 2s. c o m*/ * * @param tabNames * the names of the tabs to create. */ private void createTabs(String[] tabNames) { for (String tabName : tabNames) { VerticalLayout tab = new VerticalLayout(); tab.setCaption(tabName); tab.addComponent(new Label("<h1>" + tabName + "</h1>", ContentMode.HTML)); tab.setHeight(400, Unit.PIXELS); addComponent(tab); } }
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);/*from w w w .ja va 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(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);// w w w . j a v a2 s . co m 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 a v a 2 s .c o m 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); }