List of usage examples for com.vaadin.ui GridLayout setStyleName
@Override public void setStyleName(String style)
From source file:ch.bfh.ti.soed.hs16.srs.white.view.subviews.RoomsView.java
License:Open Source License
@Override public Component createHeader() { GridLayout headerGrid = new GridLayout(3, 1); headerGrid.setStyleName("table-parent"); Label labelID = new Label("ID"); labelID.setStyleName("display-table-header"); Label labelName = new Label("Name"); labelName.setStyleName("display-table-header"); Label labelSeats = new Label("Seats Available"); labelSeats.setStyleName("display-table-header"); headerGrid.addComponent(labelID);/*from w ww . jav a 2s . co m*/ headerGrid.addComponent(labelName); headerGrid.addComponent(labelSeats); return headerGrid; }
From source file:ch.bfh.ti.soed.hs16.srs.white.view.subviews.UsersView.java
License:Open Source License
@Override public Component createHeader() { GridLayout headerGrid = new GridLayout(4, 1); headerGrid.setStyleName("table-parent"); Label labelID = new Label("ID"); labelID.setStyleName("display-table-header"); Label labelFName = new Label("First Name"); labelFName.setStyleName("display-table-header"); Label labelLName = new Label("Last Name"); labelLName.setStyleName("display-table-header"); Label labelEMail = new Label("E-Mail"); labelEMail.setStyleName("display-table-header"); headerGrid.addComponent(labelID);//from w ww. j a v a 2 s . com headerGrid.addComponent(labelFName); headerGrid.addComponent(labelLName); headerGrid.addComponent(labelEMail); return headerGrid; }
From source file:com.cms.utils.CommonUtils.java
public static void setBasicAttributeLayout(GridLayout gridLayout, String caption, boolean isCollapseable) { gridLayout.setWidth("100%"); gridLayout.setHeight("-1px"); gridLayout.setImmediate(true);/* w w w .j a v a2 s.c o m*/ gridLayout.setMargin(true); gridLayout.setSpacing(true); if (isCollapseable && !DataUtil.isStringNullOrEmpty(caption)) { gridLayout.setStyleName("custom-feildset"); gridLayout.setCaption(MakeURL.makeURLForGrid(caption)); gridLayout.setCaptionAsHtml(isCollapseable); } }
From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectDashboardViewImpl.java
License:Open Source License
@Override public void displayDashboard() { mainLayout.removeAllComponents();//from w w w. ja va2 s .c om SimpleProject currentProject = CurrentProjectVariables.getProject(); VerticalLayout projectInfo = new VerticalLayout(); projectInfo.setStyleName("project-info-layout"); projectInfo.setWidth("100%"); projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER); Label projectIcon = new Label("<span aria-hidden=\"true\" data-icon=\"\"></span>"); projectIcon.setStyleName("project-icon"); projectIcon.setContentMode(ContentMode.HTML); projectIcon.setWidthUndefined(); projectInfo.addComponent(projectIcon); Label projectName = new Label(StringUtils.trim(currentProject.getName(), 50, true)); projectName.setWidth("100%"); projectName.setStyleName("project-name"); projectInfo.addComponent(projectName); GridLayout projectModulesList = new GridLayout(2, 3); projectModulesList.setStyleName("project-modules-layout"); projectModulesList.setWidth("100%"); projectModulesList.setSpacing(true); projectModulesList.setDefaultComponentAlignment(Alignment.TOP_CENTER); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MESSAGE), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MILESTONE), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_TASK), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_BUG), "")); // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_FILE), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_RISK), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_PROBLEM), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_TIME), "")); // // projectModulesList.addComponent(new ProjectModuleButton(AppContext // .getMessage(ProjectCommonI18nEnum.VIEW_STANDAUP), "")); projectModulesList.addComponent( new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_USERS), ""), 0, 2, 1, 2); mainLayout.addComponent(projectInfo); mainLayout.addComponent(projectModulesList); }
From source file:module.pandabox.presentation.PandaBox.java
License:Open Source License
GridLayout getPreviewLayout(String caption) { GridLayout grid = new GridLayout(3, 1) { @Override/*ww w. jav a 2 s . c o m*/ public void addComponent(Component c) { super.addComponent(c); setComponentAlignment(c, "center middle"); if (c.getStyleName() != "") { ((AbstractComponent) c).setDescription( c.getClass().getSimpleName() + ".addStyleName(\"" + c.getStyleName() + "\")"); } else { ((AbstractComponent) c).setDescription("new " + c.getClass().getSimpleName() + "()"); } } }; grid.setWidth("100%"); grid.setSpacing(true); grid.setMargin(true); grid.setCaption(caption); grid.setStyleName("preview-grid"); return grid; }
From source file:org.activiti.administrator.AdminApp.java
License:Apache License
/** * Switch view//from w w w .ja v a 2s .c o m * * @param name * the name of the view class * @param view * the view to switch to */ public void switchView(String name, Layout view) { // Add view to main layout mainLayout.addComponent(view, Consts.CONTENT); // Add logout button if user is authenticated if ((getUser() != null) && !getUser().toString().isEmpty()) { // Create logout grid with user icon, user id and logout button GridLayout logoutGrid = new GridLayout(3, 1); logoutGrid.setStyleName("logout"); // Add user icon Embedded userIcon = new Embedded(null, new ThemeResource("img/user-icon.png")); userIcon.setType(Embedded.TYPE_IMAGE); userIcon.addStyleName("icon"); // Add user id Label userLabel = new Label(getUser().toString()); userLabel.addStyleName("user"); // Add logout button logout.setStyleName(Reindeer.BUTTON_LINK); logout.addStyleName("logout"); logout.setIcon(new ThemeResource("img/divider-white.png")); // Add to logout grid logoutGrid.addComponent(userIcon, 0, 0); logoutGrid.addComponent(userLabel, 1, 0); logoutGrid.addComponent(logout, 2, 0); // Add logout grid to header mainLayout.addComponent(logoutGrid, Consts.LOGOUT); } else { // Remove logout button mainLayout.removeComponent(Consts.LOGOUT); } // Switch to new view viewManager.switchScreen(name, mainLayout); }
From source file:org.eclipse.hawkbit.ui.rollout.rollout.AddUpdateRolloutWindowLayout.java
License:Open Source License
private GridLayout createSimpleGroupDefinitionTab() { final GridLayout layout = new GridLayout(); layout.setSpacing(true);//w w w. j av a 2 s . c om layout.setColumns(3); layout.setRows(4); layout.setStyleName("marginTop"); layout.addComponent(getLabel("caption.rollout.generate.groups"), 0, 0, 2, 0); layout.addComponent(getMandatoryLabel("prompt.number.of.groups"), 0, 1); layout.addComponent(noOfGroups, 1, 1); noOfGroups.addValidator(nullValidator); layout.addComponent(groupSizeLabel, 2, 1); layout.addComponent(getMandatoryLabel("prompt.tigger.threshold"), 0, 2); layout.addComponent(triggerThreshold, 1, 2); triggerThreshold.addValidator(nullValidator); layout.addComponent(getPercentHintLabel(), 2, 2); layout.addComponent(getMandatoryLabel("prompt.error.threshold"), 0, 3); layout.addComponent(errorThreshold, 1, 3); errorThreshold.addValidator(nullValidator); layout.addComponent(errorThresholdOptionGroup, 2, 3); return layout; }
From source file:org.hip.vif.forum.usersettings.ui.ShowCompletedRatingView.java
License:Open Source License
/** Constructor for view to display the completed ratings given. * * @param inRatings {@link QueryResult} the participants involved in the review and rating process * @param inQuestions {@link QueryResult} the reviewed questions * @param inCompletions {@link QueryResult} the reviewed completions * @param inTexts {@link QueryResult} the reviewed texts * @param inTask {@link IPluggableWithLookup} the controlling task * @throws VException// w w w . java 2s . c o m * @throws SQLException */ public ShowCompletedRatingView(final QueryResult inRatings, final QueryResult inQuestions, final QueryResult inCompletions, final QueryResult inTexts, final IPluggableWithLookup inTask) throws VException, SQLException { final VerticalLayout lLayout = new VerticalLayout(); setCompositionRoot(lLayout); final IMessages lMessages = Activator.getMessages(); lLayout.setStyleName("vif-view"); //$NON-NLS-1$ lLayout.addComponent(new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-title", //$NON-NLS-1$ lMessages.getMessage("ratings.completed.title")), ContentMode.HTML)); //$NON-NLS-1$ lLayout.addComponent(new Label(lMessages.getMessage("ui.rated.subtitle"), ContentMode.HTML)); //$NON-NLS-1$ listContributions(inQuestions, inCompletions, inTexts, inTask, lLayout, lMessages); lLayout.addComponent(RiplaViewHelper.createSpacer()); final GridLayout lRatings = new GridLayout(5, 3); lRatings.setStyleName("vif-rating"); //$NON-NLS-1$ lRatings.setWidth("100%"); //$NON-NLS-1$ lRatings.setColumnExpandRatio(4, 1); lLayout.addComponent(lRatings); // headers lRatings.addComponent(new Label("")); //$NON-NLS-1$ addComponentSized(new Label(lMessages.getMessage("ui.rated.column.correctness"), ContentMode.HTML), //$NON-NLS-1$ lRatings); addComponentSized(new Label(lMessages.getMessage("ui.rated.column.efficiency"), ContentMode.HTML), //$NON-NLS-1$ lRatings); addComponentSized(new Label(lMessages.getMessage("ui.rated.column.etiquette"), ContentMode.HTML), lRatings); //$NON-NLS-1$ Label lRemark = new Label(lMessages.getMessage("ui.rated.column.remark"), ContentMode.HTML); //$NON-NLS-1$ lRemark.setStyleName("vif-colhead vif-padding-left"); //$NON-NLS-1$ lRatings.addComponent(lRemark); lRatings.getComponent(0, 0).setWidth(350, Unit.PIXELS); // ratings final Map<Long, String> lParticipants = new HashMap<Long, String>(); final List<Line> lLines = new Vector<ShowCompletedRatingView.Line>(); while (inRatings.hasMoreElements()) { final GeneralDomainObject lRating = inRatings.nextAsDomainObject(); setParticipant(lRating, lParticipants); lLines.add(new Line(lRating)); } for (final Line lLine : lLines) { lRatings.addComponent(new Label(lLine.getInvolved(lParticipants, lMessages), ContentMode.HTML)); addComponentAligened(lLine.getCorrectness(), lRatings); addComponentAligened(lLine.getEfficiency(), lRatings); addComponentAligened(lLine.getEtiquette(), lRatings); lRemark = new Label(lLine.getRemark(), ContentMode.HTML); lRemark.setStyleName("vif-padding-left"); //$NON-NLS-1$ lRatings.addComponent(lRemark); } }
From source file:org.hip.vif.web.util.RatingsTable.java
License:Open Source License
private Component createRatingsTable(final RatingsHelper inRatings) { final GridLayout outLayout = new GridLayout(4, 6); outLayout.setWidth(400, Unit.PIXELS); outLayout.setStyleName("vif-ratings"); //$NON-NLS-1$ final IMessages lMessages = Activator.getMessages(); // first row: table header final Label lSpacer = new Label(""); //$NON-NLS-1$ lSpacer.setWidth(70, Unit.PIXELS);// ww w. ja v a2s . co m outLayout.addComponent(lSpacer, 0, 0); outLayout.addComponent(createLabel(lMessages.getMessage("ratings.table.column.correctness")), 1, 0); //$NON-NLS-1$ outLayout.addComponent(createLabel(lMessages.getMessage("ratings.table.column.responsiveness")), 2, 0); //$NON-NLS-1$ outLayout.addComponent(createLabel(lMessages.getMessage("ratings.table.column.etiquette")), 3, 0); //$NON-NLS-1$ // first content: good addComponent(outLayout, RatingValue.GOOD.render(), 0, 1, Alignment.MIDDLE_CENTER); //$NON-NLS-1$ addComponent(outLayout, createLabel(inRatings.getCorrectnessA()), 1, 1, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEfficiencyA()), 2, 1, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEtiquetteA()), 3, 1, Alignment.MIDDLE_CENTER); // second content: average addComponent(outLayout, RatingValue.AVERAGE.render(), 0, 2, Alignment.MIDDLE_CENTER); //$NON-NLS-1$ addComponent(outLayout, createLabel(inRatings.getCorrectnessB()), 1, 2, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEfficiencyB()), 2, 2, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEtiquetteB()), 3, 2, Alignment.MIDDLE_CENTER); // third content: bad addComponent(outLayout, RatingValue.BAD.render(), 0, 3, Alignment.MIDDLE_CENTER); //$NON-NLS-1$ addComponent(outLayout, createLabel(inRatings.getCorrectnessC()), 1, 3, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEfficiencyC()), 2, 3, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getEtiquetteC()), 3, 3, Alignment.MIDDLE_CENTER); // total addComponent(outLayout, new Label(lMessages.getMessage("ratings.table.label.total")), 0, 4, //$NON-NLS-1$ Alignment.MIDDLE_LEFT); addComponent(outLayout, createLabel(inRatings.getTotal1()), 1, 4, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getTotal2()), 2, 4, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getTotal3()), 3, 4, Alignment.MIDDLE_CENTER); // average addComponent(outLayout, new Label(lMessages.getMessage("ratings.table.label.mean")), 0, 5, //$NON-NLS-1$ Alignment.MIDDLE_LEFT); addComponent(outLayout, createLabel(inRatings.getMean1()), 1, 5, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getMean2()), 2, 5, Alignment.MIDDLE_CENTER); addComponent(outLayout, createLabel(inRatings.getMean3()), 3, 5, Alignment.MIDDLE_CENTER); return outLayout; }
From source file:org.lunifera.examples.kwiee.erp.module.core.presentation.web.vaadin.ui.KwieeUINavigator.java
License:Open Source License
@Override public void init(VaadinRequest request) { // initialize push ///*from w w w. j av a 2s .c om*/ pusher = new ICEPush(); pusher.extend(this); // prepare UI // GridLayout root = new GridLayout(8, 8); root.setStyleName(Reindeer.LAYOUT_BLUE); root.addStyleName("kwiee"); root.setSizeFull(); root.setMargin(new MarginInfo(false, true, true, true)); root.setSpacing(false); setContent(root); root.setRowExpandRatio(0, 0.7f); root.setRowExpandRatio(1, 1.0f); root.setRowExpandRatio(2, 1.0f); root.setRowExpandRatio(3, 1.0f); root.setRowExpandRatio(4, 1.0f); root.setRowExpandRatio(5, 1.0f); root.setRowExpandRatio(6, 1.0f); root.setRowExpandRatio(7, 0.4f); // Create top frame topFrame = new HorizontalLayout(); topFrame.addStyleName("k-topframe"); topFrame.setMargin(true); topFrame.setSpacing(true); topFrame.setSizeFull(); root.addComponent(topFrame, 1, 0, 7, 0); // Create top frame navFrame = new CssLayout(); navFrame.addStyleName("k-navframe"); navFrame.setSizeFull(); root.addComponent(navFrame, 0, 1, 0, 6); // Create main frame mainFrame = new CssLayout(); mainFrame.setSizeFull(); root.addComponent(mainFrame, 1, 1, 7, 6); tabSheet = new TabSheet(); tabSheet.setSizeFull(); mainFrame.addComponent(tabSheet); // task table createTasksTable(); // Create bottom frame bottomFrame = new CssLayout(); bottomFrame.addStyleName("k-bottomframe"); bottomFrame.setSizeFull(); root.addComponent(bottomFrame, 0, 7, 7, 7); initialized = true; // attach the pending modules // synchronized (this) { for (IUIModule module : pendingModules) { attachModule(module); } pendingModules.clear(); } }