List of usage examples for com.vaadin.ui GridLayout GridLayout
public GridLayout(int columns, int rows)
From source file:com.klwork.explorer.ui.user.ProfilePanel.java
License:Apache License
protected void initContactSection() { Label header = createProfileHeader(i18nManager.getMessage(Messages.PROFILE_CONTACT)); header.addStyleName(ExplorerLayout.STYLE_H3); header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); infoPanelLayout.addComponent(header); GridLayout contactLayout = createInfoSectionLayout(2, 4); // Email// w w w . j ava 2 s . co m if (!editable && isDefined(user.getEmail())) { addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), user.getEmail()); } else if (editable) { emailField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), emailField, user.getEmail()); } // Phone if (!editable && isDefined(phone)) { addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phone); } else if (editable) { phoneField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phoneField, phone); } // Twitter if (!editable && isDefined(twitterName)) { Link twitterLink = new Link(twitterName, new ExternalResource("http://www.twitter.com/" + twitterName)); addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterLink); } else if (editable) { twitterField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterField, twitterName); } // Skype if (!editable && isDefined(skypeId)) { // The skype entry shows the name + skype icon, laid out in a small grid GridLayout skypeLayout = new GridLayout(2, 1); skypeLayout.setSpacing(true); skypeLayout.setSizeUndefined(); Label skypeIdLabel = new Label(skypeId); skypeIdLabel.setSizeUndefined(); skypeLayout.addComponent(skypeIdLabel); addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeLayout); } else if (editable) { skypeField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeField, skypeId); } }
From source file:com.klwork.explorer.ui.user.ProfilePanel.java
License:Apache License
protected GridLayout createInfoSectionLayout(int columns, int rows) { GridLayout layout = new GridLayout(columns, rows); layout.setSpacing(true);/* w w w . j a v a 2 s .c om*/ layout.setWidth(100, Unit.PERCENTAGE); layout.setMargin(new MarginInfo(true, false, true, false)); infoPanelLayout.addComponent(layout); return layout; }
From source file:com.liferay.mail.vaadin.PreferencesView.java
License:Open Source License
private void updateAccountList() { try {/* www . j a v a 2 s . c om*/ accountPanel.removeAllComponents(); List<Account> accounts = controller.getAccountManager().getAccounts(controller.getUser()); if (accounts.size() > 0) { GridLayout grid = new GridLayout(3, accounts.size()); grid.setSpacing(true); for (final Account account : accounts) { grid.addComponent(new Label(account.getAddress())); Button editButton = new Button(Lang.get("edit-account")); editButton.setStyleName("small"); editButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { editAccount(account); } }); grid.addComponent(editButton); Button deleteButton = new Button(Lang.get("delete-account")); deleteButton.setStyleName("small"); deleteButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { deleteAccount(account); } }); grid.addComponent(deleteButton); } accountPanel.addComponent(grid); } } catch (SystemException e) { // unable to read account information controller.showUnexpectedError(e); } }
From source file:com.lizardtech.expresszip.vaadin.FindLayersViewComponent.java
License:Apache License
private void setupAddFilterWindow(Window window) { // General variables // Layouts//from w w w. j a v a 2 s . co m GridLayout mainLayout = new GridLayout(1, 3); HorizontalLayout axisLayout = new HorizontalLayout(); HorizontalLayout criteriaLayout = new HorizontalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); hznCriteria = criteriaLayout; // Buttons ExpressZipButton btnAdd = new ExpressZipButton("Add", Style.ACTION); btnAdd.setClickShortcut(KeyCode.ENTER); btnAdd.addStyleName("primary"); ExpressZipButton btnCancel = new ExpressZipButton("Cancel", Style.ACTION); // Fields ComboBox cmbAxis = new ComboBox(); cmbAxis.setTextInputAllowed(false); cmbAxis.setNullSelectionAllowed(false); // Labels Label lblAxis = new Label("Axis"); btnAdd.addListener(filterButtonListener); btnCancel.addListener(filterButtonListener); for (Filter.AxisFilters f : Filter.axisArray) { cmbAxis.addItem(filter.getNameOfFilter(f)); } cmbAxis.setImmediate(true); cmbAxis.addListener(axisSelectedListener); cmbAxis.setValue(filter.getNameOfFilter(Filter.axisArray[0])); mainLayout.addComponent(axisLayout, 0, 0); mainLayout.addComponent(criteriaLayout, 0, 1); mainLayout.addComponent(buttonLayout, 0, 2); mainLayout.setSpacing(true); axisLayout.setSpacing(true); axisLayout.addComponent(lblAxis); axisLayout.addComponent(cmbAxis); axisLayout.setExpandRatio(lblAxis, .2f); axisLayout.setExpandRatio(cmbAxis, .8f); axisLayout.setComponentAlignment(lblAxis, Alignment.MIDDLE_LEFT); axisLayout.setComponentAlignment(cmbAxis, Alignment.MIDDLE_LEFT); axisLayout.setSizeFull(); criteriaLayout.setSizeFull(); buttonLayout.setSpacing(true); buttonLayout.addComponent(btnAdd); buttonLayout.addComponent(btnCancel); buttonLayout.setComponentAlignment(btnAdd, Alignment.BOTTOM_RIGHT); buttonLayout.setComponentAlignment(btnCancel, Alignment.BOTTOM_RIGHT); buttonLayout.setExpandRatio(btnAdd, 1f); buttonLayout.setExpandRatio(btnCancel, 0f); buttonLayout.setSizeFull(); mainLayout.setRowExpandRatio(0, 1f); mainLayout.setRowExpandRatio(1, 1f); mainLayout.setRowExpandRatio(2, 1f); mainLayout.setSizeFull(); window.addComponent(mainLayout); window.getContent().setSizeFull(); }
From source file:com.logicbomb.newschool.MyAppWidgetSet.core.DayWidget.java
public DayWidget() { //Creating Panel Panel iPanel = new Panel(); iPanel.addStyleName("backColorWhite"); iPanel.setWidth("876px"); iPanel.setHeight("41px"); ProgressBar iDayProgressBar = new ProgressBar(); iDayProgressBar.setCaption("Period 3, 10th October"); iDayProgressBar.setWidth("875px"); iDayProgressBar.setValue(0.3f);/*w w w.j a va 2 s . c o m*/ addComponent(iDayProgressBar); //Adding Panel to Vertical Layout addComponent(iPanel); VerticalLayout iVerticalLayout = new VerticalLayout(); GridLayout iGridLayout = new GridLayout(9, 1); iGridLayout.setWidth("1000px"); iGridLayout.setHeight("40px"); for (int i = 1; i <= 8; i++) { HourWidget iHourAtAGlanceWidget = new HourWidget(i, 8); iHourAtAGlanceWidget.setSizeFull(); iGridLayout.addComponent(iHourAtAGlanceWidget); iGridLayout.setColumnExpandRatio(i, 1); } iVerticalLayout.addComponent(iGridLayout); iPanel.setContent(iVerticalLayout); }
From source file:com.lst.deploymentautomation.vaadin.popup.TodoDetails.java
License:Open Source License
private Component createProcessInfo(LspsUI ui) { ModelInstanceInfo instance = processService.getModelInstanceInfo(todo.getModelInstanceId()); GridLayout grid = new GridLayout(2, 10); grid.setMargin(true);/* ww w .j a v a 2s . c o m*/ grid.setSpacing(true); grid.setWidth("100%"); grid.setColumnExpandRatio(0, 1); grid.setColumnExpandRatio(1, 2); grid.addComponent(new Label(ui.getMessage("process.id"))); grid.addComponent(new Label(String.valueOf(instance.getId()))); grid.addComponent(new Label(ui.getMessage("process.model"))); grid.addComponent(new Label(instance.getModelName() + " - " + instance.getModelVersion())); grid.addComponent(new Label(ui.getMessage("process.started"))); grid.addComponent(new Label( new SimpleDateFormat(ui.getMessage("app.dateTimeFormat")).format(instance.getStartedDate()))); grid.addComponent(new Label(ui.getMessage("process.finished"))); grid.addComponent(new Label(instance.getFinishedDate() == null ? "" : new SimpleDateFormat(ui.getMessage("app.dateTimeFormat")).format(instance.getFinishedDate()))); String status = "???"; switch (instance.getState()) { case CREATED: status = ui.getMessage("process.statusCreated"); break; case FINISHED: status = ui.getMessage("process.statusFinished"); break; case RUNNING: status = ui.getMessage("process.statusRunning"); break; case SUSPENDED: status = ui.getMessage("process.statusSuspended"); break; case MODEL_UPDATE_PREPROCESSING: status = ui.getMessage("process.statusPreprocessing"); break; case MODEL_UPDATE_PREPROCESSED: status = ui.getMessage("process.statusPreprocessed"); break; case MODEL_UPDATE_TRANSFORMED: status = ui.getMessage("process.statusTransformed"); break; case MODEL_UPDATE_POSTPROCESSING: status = ui.getMessage("process.statusPostprocessing"); break; case MODEL_UPDATE_UPDATED: status = ui.getMessage("process.statusUpdated"); break; case MODEL_UPDATE_ABORTED: status = ui.getMessage("process.statusUpdateAborted"); break; } grid.addComponent(new Label(ui.getMessage("process.status"))); grid.addComponent(new Label(status)); return grid; }
From source file:com.lst.deploymentautomation.vaadin.popup.TodoDetails.java
License:Open Source License
private Component createTodoInfo(LspsUI ui) { GridLayout grid = new GridLayout(2, 10); grid.setMargin(true);/*from w ww .j ava 2 s .c om*/ grid.setSpacing(true); grid.setWidth("100%"); grid.setColumnExpandRatio(0, 1); grid.setColumnExpandRatio(1, 2); grid.addComponent(new Label(ui.getMessage("todo.id"))); grid.addComponent(new Label(String.valueOf(todo.getId()))); // grid.addComponent(new Label(ui.getMessage("todo.process"))); // grid.addComponent(new Label(String.valueOf(todo.getModelInstanceId()))); // grid.addComponent(new Label(ui.getMessage("todo.title"))); // grid.addComponent(new Label(ui.localizeEngineText(todo.getTitle()))); grid.addComponent(new Label(ui.getMessage("todo.task"))); grid.addComponent(new Label(todo.getTaskNamespace())); grid.addComponent(new Label(ui.getMessage("todo.issued"))); grid.addComponent( new Label(new SimpleDateFormat(ui.getMessage("app.dateTimeFormat")).format(todo.getIssuedDate()))); String status = "???"; switch (todo.getStatus()) { case ALIVE: status = ui.getMessage("todo.statusAlive"); break; case ACCOMPLISHED: status = ui.getMessage("todo.statusAccomplished", todo.getSubmittedDate()); break; case INTERRUPTED: status = ui.getMessage("todo.statusInterrupted", todo.getSubmittedDate(), todo.getInterruptionReason()); break; case SUSPENDED: status = ui.getMessage("todo.statusSuspended"); break; } grid.addComponent(new Label(ui.getMessage("todo.status"))); grid.addComponent(new Label(status)); try { TodoAuthorization authorization = todoService.getAuthorization(todo.getId(), ui.getUser().getPerson().getId()); String authMsg; switch (authorization) { case INITIAL_PERFORMER: authMsg = ui.getMessage("todo.authorizationPerformer"); break; case DELEGATE: authMsg = ui.getMessage("todo.authorizationDelegate"); break; case SUBSTITUTE: authMsg = ui.getMessage("todo.authorizationSubstitute"); break; case NOT_PERMITTED: default: authMsg = ui.getMessage("todo.authorizationUnknown"); break; } grid.addComponent(new Label(ui.getMessage("todo.authorization"))); grid.addComponent(new Label(authMsg)); } catch (Exception e) { Utils.rethrow(e, "could not get authorization for " + todo.getId(), log); } //currently it's always the current user; no need to show him // grid.addComponent(new Label(ui.getMessage("todo.responsible"))); // grid.addComponent(new Label(todo.getAllocatedToFullName())); return grid; }
From source file:com.m4gik.views.component.LibraryScreen.java
/** * This method builds library screen. This method overrides an existing * method.//from www.j a va 2 s. c o m * * @see com.m4gik.views.component.ViewScreen#build() */ @Override public Layout build() { HorizontalLayout root = new HorizontalLayout(); root.setSizeFull(); root.setCaption("Media Library"); root.setHeight("200%"); root.setWidth("100%"); this.content = new VerticalLayout(); content.setSizeFull(); root.addComponent(content); final GridLayout grid = new GridLayout(4, 1); Panel top = new Panel("Music Collection", grid); top.setSizeFull(); top.addStyleName(Runo.PANEL_LIGHT); grid.setWidth("100%"); grid.setMargin(true); grid.addStyleName(Runo.LAYOUT_DARKER); content.addComponent(top); content.setExpandRatio(top, 1); grid.addLayoutClickListener(new LayoutClickListener() { private static final long serialVersionUID = -1864555729437118182L; @Override public void layoutClick(LayoutClickEvent event) { for (Iterator<Component> it = grid.iterator(); it.hasNext();) { Component c = it.next(); c.removeStyleName(Runo.CSSLAYOUT_SELECTABLE_SELECTED); } if (event.getChildComponent() != null) { event.getChildComponent().addStyleName(Runo.CSSLAYOUT_SELECTABLE_SELECTED); } } }); buildAudioLibrary(grid, null); return root; }
From source file:com.mcparland.john.DragAndDropPanel.java
License:Apache License
/** * Create a DragAndDropPanel.//from w ww .j a va 2 s . c o m * */ public DragAndDropPanel() { super(); final VerticalSplitPanel leftSplitPanel = new VerticalSplitPanel(); leftSplitPanel.setSizeFull(); leftSplitPanel.setFirstComponent(createLayout(new HorizontalLayout())); leftSplitPanel.setSecondComponent(new VerticalLayout()); final VerticalSplitPanel rightSplitPanel = new VerticalSplitPanel(); rightSplitPanel.setSizeFull(); rightSplitPanel.setFirstComponent(createLayout(new GridLayout(3, 3))); rightSplitPanel.setSecondComponent(new InlineCssLayout()); setFirstComponent(leftSplitPanel); setSecondComponent(rightSplitPanel); setSizeFull(); }
From source file:com.mycollab.module.crm.ui.components.PeopleInfoComp.java
License:Open Source License
public void displayEntryPeople(ValuedBean bean) { this.removeAllComponents(); this.withMargin(false); Label peopleInfoHeader = new Label( FontAwesome.USER.getHtml() + " " + UserUIContext.getMessage(CrmCommonI18nEnum.SUB_INFO_PEOPLE), ContentMode.HTML);/*from ww w. j a v a 2 s. co m*/ peopleInfoHeader.setStyleName("info-hdr"); this.addComponent(peopleInfoHeader); GridLayout layout = new GridLayout(2, 2); layout.setSpacing(true); layout.setWidth("100%"); layout.setMargin(new MarginInfo(false, false, false, true)); try { Label createdLbl = new Label(UserUIContext.getMessage(CrmCommonI18nEnum.ITEM_CREATED_PEOPLE)); createdLbl.setSizeUndefined(); layout.addComponent(createdLbl, 0, 0); String createdUserName = (String) PropertyUtils.getProperty(bean, "createduser"); String createdUserAvatarId = (String) PropertyUtils.getProperty(bean, "createdUserAvatarId"); String createdUserDisplayName = (String) PropertyUtils.getProperty(bean, "createdUserFullName"); UserLink createdUserLink = new UserLink(createdUserName, createdUserAvatarId, createdUserDisplayName); layout.addComponent(createdUserLink, 1, 0); layout.setColumnExpandRatio(1, 1.0f); Label assigneeLbl = new Label(UserUIContext.getMessage(CrmCommonI18nEnum.ITEM_ASSIGN_PEOPLE)); assigneeLbl.setSizeUndefined(); layout.addComponent(assigneeLbl, 0, 1); String assignUserName = (String) PropertyUtils.getProperty(bean, "assignuser"); String assignUserAvatarId = (String) PropertyUtils.getProperty(bean, "assignUserAvatarId"); String assignUserDisplayName = (String) PropertyUtils.getProperty(bean, "assignUserFullName"); UserLink assignUserLink = new UserLink(assignUserName, assignUserAvatarId, assignUserDisplayName); layout.addComponent(assignUserLink, 1, 1); } catch (Exception e) { LOG.error("Can not build user link {} ", BeanUtility.printBeanObj(bean)); } this.addComponent(layout); }