List of usage examples for com.vaadin.ui Panel setSizeFull
@Override public void setSizeFull()
From source file:org.escidoc.browser.ui.maincontent.ContainerMetadataRecordsView.java
License:Open Source License
@SuppressWarnings("serial") private Panel lblAddtionalResources() { final Panel pnl = new Panel(); pnl.setSizeFull(); VerticalLayout hl = new VerticalLayout(); hl.setSizeFull();//from ww w . j a v a2 s. c o m final Button btnVersionHistoryContainer = new Button("Container Version History", new VersionHistoryClickListener(resourceProxy, mainWindow, repositories)); btnVersionHistoryContainer.setStyleName(BaseTheme.BUTTON_LINK); btnVersionHistoryContainer.setDescription("Show Version history in a Pop-up"); final CssLayout cssLayout = new CssLayout(); buildPanelHeader(cssLayout, "Additional Resources"); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); final Button addResourceButton = new Button(); addResourceButton.setStyleName(BaseTheme.BUTTON_LINK); addResourceButton.addStyleName("floatright paddingtop3"); addResourceButton.setWidth("20px"); addResourceButton.setIcon(ICON); addResourceButton.addListener(new ClickListener() { @Override public void buttonClick(final ClickEvent event) { final Window subwindow = new Window("A modal subwindow"); subwindow.setModal(true); subwindow.setWidth("650px"); VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); subwindow.addComponent(new Label("Not yet implemented")); Button close = new Button("Close", new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") ClickEvent event) { (subwindow.getParent()).removeWindow(subwindow); } }); layout.addComponent(close); layout.setComponentAlignment(close, Alignment.TOP_RIGHT); router.getMainWindow().addWindow(subwindow); } }); cssLayout.addComponent(addResourceButton); hl.addComponent(cssLayout); hl.addComponent(btnVersionHistoryContainer); pnl.setContent(hl); return pnl; }
From source file:org.escidoc.browser.ui.maincontent.ContainerView.java
License:Open Source License
private Panel buildDirectMembersPanel() throws EscidocClientException { // common part: create layout Panel directMembersPanel = new Panel(); directMembersPanel.setImmediate(true); directMembersPanel.setSizeFull(); directMembersPanel.setScrollable(true); directMembersPanel.setStyleName(Runo.PANEL_LIGHT); // vlDirectMember VerticalLayout vlDirectMember = new VerticalLayout(); vlDirectMember.setImmediate(true);/* ww w .ja va 2 s . c o m*/ vlDirectMember.setWidth("100.0%"); vlDirectMember.setHeight("100.0%"); vlDirectMember.setMargin(false); directMembersPanel.setContent(vlDirectMember); new DirectMember(serviceLocation, router, resourceProxy.getId(), mainWindow, repositories, directMembersPanel, ResourceType.CONTAINER.toString()).containerAsTree(); return directMembersPanel; }
From source file:org.escidoc.browser.ui.maincontent.ContextRightPanel.java
License:Open Source License
public Panel asPanel() { final Panel pnlmetadataRecs = new Panel(); pnlmetadataRecs.setSizeFull(); VerticalLayout vl = new VerticalLayout(); vl.setImmediate(false);//from w ww . ja v a 2s . c om vl.setWidth("100.0%"); vl.setHeight("100.0%"); vl.setMargin(false); vl.addComponent(buildOrganizationUnit()); vl.addComponent(buildAdminDescription()); pnlmetadataRecs.setContent(vl); return pnlmetadataRecs; }
From source file:org.escidoc.browser.ui.maincontent.ContextRightPanel.java
License:Open Source License
@SuppressWarnings("serial") private Panel buildOrganizationUnit() { final Panel pnlOrgUnit = new Panel(); pnlOrgUnit.setSizeFull(); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull();/*from w ww. j av a 2 s . co m*/ final CssLayout cssLayout = new CssLayout(); buildPanelHeader(cssLayout, ViewConstants.ORGANIZATIONAL_UNIT); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (contextController.canAddOUs()) { final Button addResourceButton = new Button(); addResourceButton.setStyleName(BaseTheme.BUTTON_LINK); addResourceButton.addStyleName("floatright paddingtop3"); addResourceButton.setWidth("20px"); addResourceButton.setIcon(ICON); addResourceButton.addListener(new ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") final ClickEvent event) { final Window subwindow = new Window("A modal subwindow"); subwindow.setModal(true); subwindow.setWidth("650px"); VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); try { subwindow.addComponent(new AddOrgUnitstoContext(router, resourceProxy, contextController, resourceProxy.getOrganizationalUnit())); } catch (EscidocClientException e) { contextController.showError(e); } Button close = new Button(ViewConstants.CLOSE, new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") ClickEvent event) { subwindow.getParent().removeWindow(subwindow); } }); layout.addComponent(close); layout.setComponentAlignment(close, Alignment.TOP_RIGHT); router.getMainWindow().addWindow(subwindow); } }); cssLayout.addComponent(addResourceButton); } vl.addComponent(cssLayout); OrganizationalUnitsTableVH orgUnitTable = new OrganizationalUnitsTableVH(contextController, resourceProxy.getOrganizationalUnit(), router, resourceProxy); orgUnitTable.buildTable(); vl.addComponent(orgUnitTable); vl.setComponentAlignment(orgUnitTable, Alignment.TOP_LEFT); vl.setExpandRatio(orgUnitTable, 9f); pnlOrgUnit.setContent(vl); return pnlOrgUnit; }
From source file:org.escidoc.browser.ui.maincontent.OrgUnitMetadataRecordsView.java
License:Open Source License
public Panel asPanel() { final Panel panel = new Panel(); panel.setSizeFull(); panel.setStyleName(Runo.PANEL_LIGHT); VerticalLayout vl = new VerticalLayout(); vl.setImmediate(false);// ww w .ja v a2 s . c om vl.setWidth("100.0%"); vl.setHeight("100.0%"); vl.setMargin(false); vl.addComponent(buildMetaDataTab()); panel.setContent(vl); return panel; }
From source file:org.escidoc.browser.ui.maincontent.OrgUnitMetadataRecordsView.java
License:Open Source License
@SuppressWarnings("serial") private Component buildMetaDataTab() { Panel innerPanel = new Panel(); innerPanel.setSizeFull(); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull();//w w w. j a v a2 s. c om final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.METADATA); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (canAddMetadata()) { final Button addNewOrgUnitBtn = new Button(); addNewOrgUnitBtn.addListener(new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") ClickEvent event) { OnAddOrgUnitMetadata view = new OnAddOrgUnitMetadata(controller, router.getMainWindow()); view.showAddWindow(); } }); addNewOrgUnitBtn.setStyleName(BaseTheme.BUTTON_LINK); addNewOrgUnitBtn.addStyleName("floatright paddingtop3"); addNewOrgUnitBtn.setWidth("20px"); addNewOrgUnitBtn.setIcon(ICON); cssLayout.addComponent(addNewOrgUnitBtn); } vl.addComponent(cssLayout); OrgUnitMetadataTable metadataTable = new OrgUnitMetadataTable(orgUnit.getMetadataRecords(), controller, router); metadataTable.buildTable(); vl.addComponent(metadataTable); vl.setExpandRatio(metadataTable, 9); innerPanel.setContent(vl); return innerPanel; }
From source file:org.escidoc.browser.ui.maincontent.ParentsView.java
License:Open Source License
public Panel asPanel() { final Panel pnlmetadataRecs = new Panel(); pnlmetadataRecs.setSizeFull(); pnlmetadataRecs.setStyleName(Runo.PANEL_LIGHT); VerticalLayout vl = new VerticalLayout(); vl.setImmediate(false);//from w w w.j ava 2s . c o m vl.setWidth("100.0%"); vl.setHeight("100.0%"); vl.setMargin(false); vl.addComponent(buildParentsList()); pnlmetadataRecs.setContent(vl); return pnlmetadataRecs; }
From source file:org.escidoc.browser.ui.maincontent.ParentsView.java
License:Open Source License
@SuppressWarnings("serial") private Component buildParentsList() { // ViewConstants.PARENTS final Panel panel = new Panel(); panel.setSizeFull(); panel.setStyleName(Runo.PANEL_LIGHT); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull();/*from ww w .j a v a 2 s. c om*/ final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.PARENTS); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); Button btnAdd = new Button(); btnAdd.setStyleName(BaseTheme.BUTTON_LINK); btnAdd.addStyleName("floatright paddingtop3"); btnAdd.setWidth("20px"); btnAdd.setIcon(ICON); btnAdd.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { final Window subwindow = new Window("Manage Organizational Unit Parents"); subwindow.setModal(true); subwindow.setWidth("650px"); VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); try { subwindow.addComponent(new OrgUnitParentEditView(orgUnitProxy, orgUnitProxy.getParentList(), router, orgUnitController)); } catch (EscidocClientException e) { orgUnitController.showError(e); } Button close = new Button("Close", new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") com.vaadin.ui.Button.ClickEvent event) { (subwindow.getParent()).removeWindow(subwindow); } }); layout.addComponent(close); layout.setComponentAlignment(close, Alignment.TOP_RIGHT); mainWindow.addWindow(subwindow); } }); cssLayout.addComponent(btnAdd); vl.addComponent(cssLayout); List<ResourceModel> l = orgUnitProxy.getParentList(); OUParentTableVH parentTable = new OUParentTableVH(orgUnitProxy, router, orgUnitController); parentTable.buildTable(); vl.addComponent(parentTable); vl.setExpandRatio(parentTable, 9f); // TODO here comes table panel.setContent(vl); return panel; }
From source file:org.groom.review.ui.flows.reviewer.ReviewFlowlet.java
License:Apache License
@Override public void initialize() { entityManager = getSite().getSiteContext().getObject(EntityManager.class); final GridLayout gridLayout = new GridLayout(2, 4); gridLayout.setSizeFull();//ww w. jav a 2 s . com gridLayout.setMargin(false); gridLayout.setSpacing(true); //gridLayout.setRowExpandRatio(0, 0.5f); gridLayout.setRowExpandRatio(1, 1f); gridLayout.setColumnExpandRatio(1, 1f); setViewContent(gridLayout); reviewEditor = new ValidatingEditor(ReviewFields.getFieldDescriptors(Review.class)); reviewEditor.setCaption("Review"); reviewEditor.addListener((ValidatingEditorStateListener) this); reviewEditor.setWidth(450, Unit.PIXELS); reviewEditor.setReadOnly(true); gridLayout.addComponent(reviewEditor, 0, 0); final HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); gridLayout.addComponent(buttonLayout, 0, 3); beanQueryFactory = new BeanQueryFactory<FileDiffBeanQuery>(FileDiffBeanQuery.class); queryConfiguration = new HashMap<String, Object>(); beanQueryFactory.setQueryConfiguration(queryConfiguration); container = new LazyQueryContainer(beanQueryFactory, "path", 20, false); container.addContainerProperty("status", Character.class, null, true, false); container.addContainerProperty("reviewed", String.class, null, true, false); container.addContainerProperty("path", String.class, null, true, false); final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); fileDiffTable = new Table() { @Override protected String formatPropertyValue(Object rowId, Object colId, Property property) { Object v = property.getValue(); if (v instanceof Date) { Date dateValue = (Date) v; return format.format(v); } return super.formatPropertyValue(rowId, colId, property); } }; fileDiffTable.setNullSelectionAllowed(false); fileDiffTable.setSizeFull(); fileDiffTable.setContainerDataSource(container); fileDiffTable.setVisibleColumns(new Object[] { "reviewed", "path" }); //table.setColumnWidth("path", 500); fileDiffTable.setColumnWidth("status", 40); fileDiffTable.setColumnWidth("reviewed", 40); fileDiffTable.setColumnHeaders(new String[] { "", getSite().localize("field-path") }); fileDiffTable.setColumnCollapsingAllowed(false); fileDiffTable.setSelectable(true); fileDiffTable.setMultiSelect(false); fileDiffTable.setImmediate(true); fileDiffTable.addItemClickListener(new ItemClickEvent.ItemClickListener() { @Override public void itemClick(ItemClickEvent event) { final String selectedPath = (String) event.getItemId(); if (selectedPath != null) { reviewFileDiff(selectedPath); } } }); fileDiffTable.setCellStyleGenerator(new Table.CellStyleGenerator() { @Override public String getStyle(Table source, Object itemId, Object propertyId) { if (propertyId != null && propertyId.equals("status")) { final FileDiff fileDiff = ((NestingBeanItem<FileDiff>) source.getItem(itemId)).getBean(); switch (fileDiff.getStatus()) { case 'A': return "added"; case 'D': return "deleted"; case 'M': return "modified"; default: return ""; } } else if (propertyId != null && propertyId.equals("path")) { final FileDiff fileDiff = ((NestingBeanItem<FileDiff>) source.getItem(itemId)).getBean(); switch (fileDiff.getStatus()) { case 'A': return "path-added"; case 'D': return "path-deleted"; case 'M': return "path-modified"; default: return ""; } } else if (propertyId != null && propertyId.equals("reviewed")) { final FileDiff fileDiff = ((NestingBeanItem<FileDiff>) source.getItem(itemId)).getBean(); if (fileDiff.isReviewed()) { return "ok"; } else { return ""; } } else { return ""; } } }); fileDiffTable.setConverter("status", new Converter<String, Character>() { @Override public Character convertToModel(String value, Class<? extends Character> targetType, Locale locale) throws ConversionException { throw new UnsupportedOperationException(); } @Override public String convertToPresentation(Character value, Class<? extends String> targetType, Locale locale) throws ConversionException { return ""; } @Override public Class<Character> getModelType() { return Character.class; } @Override public Class<String> getPresentationType() { return String.class; } }); fileDiffTable.setConverter("reviewed", new Converter<String, Boolean>() { @Override public Boolean convertToModel(String value, Class<? extends Boolean> targetType, Locale locale) throws ConversionException { throw new UnsupportedOperationException(); } @Override public String convertToPresentation(Boolean value, Class<? extends String> targetType, Locale locale) throws ConversionException { return ""; } @Override public Class<Boolean> getModelType() { return Boolean.class; } @Override public Class<String> getPresentationType() { return String.class; } }); Panel fileDiffPanel = new Panel("Diffs"); fileDiffPanel.setStyleName(ValoTheme.PANEL_BORDERLESS); fileDiffPanel.setSizeFull(); fileDiffPanel.setContent(fileDiffTable); gridLayout.addComponent(fileDiffPanel, 1, 0, 1, 1); reviewStatusContainer = new LazyEntityContainer<ReviewStatus>(entityManager, true, false, false, ReviewStatus.class, 0, new String[] { "reviewer.emailAddress" }, new boolean[] { true }, "reviewStatusId"); final List<FieldDescriptor> fieldDescriptors = ReviewFields.getFieldDescriptors(ReviewStatus.class); ContainerUtil.addContainerProperties(reviewStatusContainer, fieldDescriptors); final Table reviewerStatusesTable = new FormattingTable(); org.bubblecloud.ilves.component.grid.Grid grid = new org.bubblecloud.ilves.component.grid.Grid( reviewerStatusesTable, reviewStatusContainer); grid.setFields(fieldDescriptors); reviewerStatusesTable.setColumnCollapsed("reviewStatusId", true); reviewerStatusesTable.setColumnCollapsed("created", true); reviewerStatusesTable.setColumnCollapsed("modified", true); reviewerStatusesTable.setSelectable(false); reviewerStatusesTable.setCellStyleGenerator(new Table.CellStyleGenerator() { @Override public String getStyle(Table source, Object itemId, Object propertyId) { if (propertyId != null && propertyId.equals("completed")) { final ReviewStatus reviewStatus = ((NestingBeanItem<ReviewStatus>) source.getItem(itemId)) .getBean(); if (reviewStatus.isCompleted()) { return "ok"; } else { return ""; } } else { return ""; } } }); reviewerStatusesTable.setConverter("completed", new Converter<String, Boolean>() { @Override public Boolean convertToModel(String value, Class<? extends Boolean> targetType, Locale locale) throws ConversionException { throw new UnsupportedOperationException(); } @Override public String convertToPresentation(Boolean value, Class<? extends String> targetType, Locale locale) throws ConversionException { return ""; } @Override public Class<Boolean> getModelType() { return Boolean.class; } @Override public Class<String> getPresentationType() { return String.class; } }); Panel reviewerPanel = new Panel("Reviewers"); reviewerPanel.setStyleName(ValoTheme.PANEL_BORDERLESS); reviewerPanel.setHeight(300, Unit.PIXELS); reviewerPanel.setContent(grid); gridLayout.addComponent(reviewerPanel, 0, 2); commentContainer = new LazyEntityContainer<Comment>(entityManager, true, false, false, Comment.class, 0, new String[] { "path", "line" }, new boolean[] { true, true }, "reviewCommentId"); final List<FieldDescriptor> commentFieldDescriptors = ReviewFields.getFieldDescriptors(Comment.class); ContainerUtil.addContainerProperties(commentContainer, commentFieldDescriptors); final Table commentTable = new FormattingTable(); org.bubblecloud.ilves.component.grid.Grid commentGrid = new org.bubblecloud.ilves.component.grid.Grid( commentTable, commentContainer); commentTable.setNullSelectionAllowed(false); commentGrid.setSizeFull(); commentGrid.setFields(commentFieldDescriptors); commentTable.setImmediate(true); commentTable.setColumnCollapsed("reviewCommentId", true); commentTable.setColumnCollapsed("created", true); commentTable.setColumnCollapsed("modified", true); commentTable.setColumnCollapsed("committer", true); commentTable.setColumnCollapsed("path", true); commentTable.setColumnCollapsed("line", true); commentTable.setColumnCollapsed("hash", true); commentTable.setCellStyleGenerator(new Table.CellStyleGenerator() { @Override public String getStyle(Table source, Object itemId, Object propertyId) { if (propertyId != null && propertyId.equals("severity")) { final Comment comment = ((NestingBeanItem<Comment>) source.getItem(itemId)).getBean(); switch (comment.getSeverity()) { case 1: return "kudo"; case -1: return "warning"; case -2: return "red-flag"; default: return ""; } } else { return ""; } } }); commentTable.setConverter("severity", new Converter<String, Integer>() { @Override public Integer convertToModel(String value, Class<? extends Integer> targetType, Locale locale) throws ConversionException { throw new UnsupportedOperationException(); } @Override public String convertToPresentation(Integer value, Class<? extends String> targetType, Locale locale) throws ConversionException { return ""; } @Override public Class<Integer> getModelType() { return Integer.class; } @Override public Class<String> getPresentationType() { return String.class; } }); Panel commentPanel = new Panel("Review Comments"); commentPanel.setStyleName(ValoTheme.PANEL_BORDERLESS); commentPanel.setHeight(300, Unit.PIXELS); commentPanel.setContent(commentGrid); gridLayout.addComponent(commentPanel, 1, 2, 1, 2); commentTable.addItemClickListener(new ItemClickEvent.ItemClickListener() { @Override public void itemClick(ItemClickEvent event) { final String commentId = (String) event.getItemId(); if (commentId != null) { final Comment comment = ((NestingBeanItem<Comment>) commentTable.getItem(commentId)).getBean(); final String path = comment.getPath(); final FileDiff fileDiff = ((NestingBeanItem<FileDiff>) fileDiffTable.getItem(path)).getBean(); fileDiff.setReviewed(true); ReviewDao.saveReviewStatus(entityManager, reviewStatus); final char status = fileDiff.getStatus(); if (status == 'A' || status == 'M') { final ReviewFileDiffFlowlet view = getFlow().forward(ReviewFileDiffFlowlet.class); view.setFileDiff(review, fileDiff, comment.getDiffLine()); } } } }); completeButton = new Button(getSite().localize("button-complete")); completeButton.setImmediate(true); buttonLayout.addComponent(completeButton); completeButton.addListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final ReviewCommentDialog commentDialog = new ReviewCommentDialog( new ReviewCommentDialog.DialogListener() { @Override public void onOk(final String message) { reviewStatus.setReviewComment(message); reviewStatus.setCompleted(true); ReviewDao.saveReviewStatus(entityManager, reviewStatus); enter(); } @Override public void onCancel() { } }); commentDialog.setCaption("Please enter final comment."); UI.getCurrent().addWindow(commentDialog); commentDialog.getTextArea().focus(); } }); reopenButton = new Button(getSite().localize("button-reopen")); reopenButton.setImmediate(true); buttonLayout.addComponent(reopenButton); reopenButton.addListener(new ClickListener() { /** Serial version UID. */ private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { reviewStatus.setCompleted(false); ReviewDao.saveReviewStatus(entityManager, reviewStatus); enter(); } }); }
From source file:org.iespuigcastellar.attendancemanager.screenlayouts.EditTeachersLayout.java
License:Open Source License
private void initLayout() { VerticalLayout left = new VerticalLayout(); left.setSizeFull();//ww w. jav a 2 s. c o m left.addComponent(teachersTable); teachersTable.setSizeFull(); left.setExpandRatio(teachersTable, 1); tablecontrols.setWidth("100%"); left.addComponent(tablecontrols); this.addComponent(left); VerticalLayout right = new VerticalLayout(); right.setSizeFull(); Panel formPanel = new Panel("Form:"); formPanel.setSizeFull(); formPanel.addComponent(teacherForm); formPanel.addComponent(addupdateButton); right.addComponent(formPanel); teacherForm.setSizeFull(); teacherForm.getLayout().setMargin(true); teacherForm.setImmediate(true); teacherForm.getLayout().addComponent(loginTextField); teacherForm.getLayout().addComponent(passwordTextField); teacherForm.getLayout().addComponent(commentTextField); teacherForm.getLayout().addComponent(adminCheckBox); //teacherForm.setEnabled(false); this.addComponent(right); }