List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout
public VerticalLayout()
From source file:com.etest.view.systemadministration.HousekeepingMainUI.java
Table populateDataTable() { table.removeAllItems();//from ww w . j ava 2 s. com int i = 0; for (CellItem ci : hs.getAllItemsFromArchive()) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button recycle = new Button("recycle"); recycle.setWidthUndefined(); recycle.setData(ci.getCellItemId()); recycle.setIcon(FontAwesome.RECYCLE); recycle.addStyleName(ValoTheme.BUTTON_LINK); recycle.addStyleName(ValoTheme.BUTTON_TINY); recycle.addStyleName(ValoTheme.BUTTON_QUIET); recycle.addStyleName("button-container"); v.addComponent(recycle); v.setComponentAlignment(recycle, Alignment.MIDDLE_LEFT); Button view = new Button("view"); view.setWidthUndefined(); view.setData(ci.getCellItemId()); view.setIcon(FontAwesome.COFFEE); view.addStyleName(ValoTheme.BUTTON_LINK); view.addStyleName(ValoTheme.BUTTON_TINY); view.addStyleName(ValoTheme.BUTTON_QUIET); view.addStyleName("button-container"); view.addClickListener(buttonClickListener); v.addComponent(view); v.setComponentAlignment(view, Alignment.MIDDLE_LEFT); table.addItem(new Object[] { ci.getCellItemId(), ci.getItem(), v }, i); i++; } table.setPageLength(table.size()); return table; }
From source file:com.etest.view.systemadministration.SemestralTeam.AddSemestralTeamMembersWindow.java
public AddSemestralTeamMembersWindow(int teamTeachId) { this.teamTeachId = teamTeachId; setCaption("ADD TEAM MEMBERS"); setWidth("600px"); setModal(true);/*w w w .j a v a2s . c o m*/ center(); VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); facultyId = tts.getFacultyIdByTeamTeachId(teamTeachId); v.addComponent(buildForms()); setContent(v); getContent().setHeightUndefined(); }
From source file:com.etest.view.systemadministration.SemestralTeam.AddSemestralTeamMembersWindow.java
Window removeTeamMemberWindow(int facultyRowId) { Window sub = new Window(); sub.setCaption("REMOVE TEAM MEMBER"); sub.setWidth("250px"); sub.setModal(true);/* w ww . j av a2 s .c o m*/ sub.center(); VerticalLayout vlayout = new VerticalLayout(); vlayout.setSizeFull(); vlayout.setMargin(true); Button removeBtn = new Button("REMOVE"); removeBtn.setWidth("100%"); removeBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); removeBtn.addStyleName(ValoTheme.BUTTON_SMALL); removeBtn.addClickListener((Button.ClickEvent event) -> { boolean result = tts.removeTeamMember(getTeamTeachId(), facultyRowId); if (result) { populateDataTable(); sub.close(); } }); vlayout.addComponent(removeBtn); sub.setContent(vlayout); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.etest.view.systemadministration.SemestralTeam.AddSemestralTeamMembersWindow.java
Window editTeamMemberPositionWindow(int facultyRowId) { Window sub = new Window(); sub.setCaption("REMOVE TEAM MEMBER"); sub.setWidth("250px"); sub.setModal(true);// w w w . j av a 2 s . co m sub.center(); VerticalLayout vlayout = new VerticalLayout(); vlayout.setSizeFull(); vlayout.setSpacing(true); vlayout.setMargin(true); String name = fs.getFacultyNameById(facultyRowId); vlayout.addComponent(new Label("Set " + name.toUpperCase() + " as Team Leader.")); Button updateBtn = new Button("UPDATE"); updateBtn.setWidth("100%"); updateBtn.setIcon(FontAwesome.USER); updateBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); updateBtn.addStyleName(ValoTheme.BUTTON_SMALL); updateBtn.addClickListener((Button.ClickEvent event) -> { int userId = us.getUserIdByFacultyId(facultyRowId); boolean result = tts.updateTeamTeach(getTeamTeachId(), userId); if (result) { sub.close(); populateDataTable(); close(); } }); vlayout.addComponent(updateBtn); sub.setContent(vlayout); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.etest.view.systemadministration.SemestralTeam.RemoveSemestralTeamWindow.java
public RemoveSemestralTeamWindow(int teamTeachId) { this.teamTeachId = teamTeachId; setCaption("DELETE WINDOW"); setWidth("270px"); setModal(true);/*from w w w. j ava 2 s . c o m*/ center(); VerticalLayout vlayout = new VerticalLayout(); vlayout.setSizeFull(); vlayout.setMargin(true); Button removeBtn = new Button("REMOVE SEMESTRAL TEAM?"); removeBtn.setWidth("100%"); removeBtn.setIcon(FontAwesome.TRASH_O); removeBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); removeBtn.addStyleName(ValoTheme.BUTTON_SMALL); removeBtn.addClickListener((Button.ClickEvent event) -> { boolean result = tts.removeSemestralTeam(getTeamTeachId()); if (result) { close(); } }); removeBtn.setImmediate(true); vlayout.addComponent(removeBtn); setContent(vlayout); getContent().setHeightUndefined(); }
From source file:com.etest.view.systemadministration.syllabus.SyllabusMainUI.java
Table populateDataTable() { table.removeAllItems();//from w ww. j a v a2s .c om int i = 0; for (Syllabus s : ss.getAllSyllabus()) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button edit = new Button("edit"); edit.setWidthUndefined(); edit.setData(s.getSyllabusId()); edit.setIcon(FontAwesome.PENCIL); edit.addStyleName(ValoTheme.BUTTON_LINK); edit.addStyleName(ValoTheme.BUTTON_TINY); edit.addStyleName("button-container"); edit.addClickListener(buttonClickListener); v.addComponent(edit); Button delete = new Button("del"); delete.setWidthUndefined(); delete.setData(s.getSyllabusId()); delete.setIcon(FontAwesome.TRASH_O); delete.addStyleName(ValoTheme.BUTTON_LINK); delete.addStyleName(ValoTheme.BUTTON_TINY); delete.addStyleName("button-container"); delete.addClickListener(buttonClickListener); v.addComponent(delete); Label descriptiveTitle = new Label(s.getTopic(), ContentMode.HTML); descriptiveTitle.setStyleName("label-padding"); Label topic = new Label(s.getTopic(), ContentMode.HTML); topic.setStyleName("label-padding"); table.addItem(new Object[] { // s.getSyllabusId(), s.getSubject(), descriptiveTitle, s.getTopicNo(), topic, s.getEstimatedTime(), v }, i); i++; } table.setPageLength(table.size()); return table; }
From source file:com.etest.view.systemadministration.SystemAdministrationUI.java
public SystemAdministrationUI() { setWidth("100%"); addStyleName("bar"); VerticalLayout v = new VerticalLayout(); v.setCaption("Curriculum"); v.setWidth("100%"); v.addComponent(new CurriculumMainUI()); // v.setMargin(true); addComponent(v);/*from w ww . ja v a2 s . c om*/ v = new VerticalLayout(); v.setCaption("Faculty Member"); v.setWidth("100%"); v.addComponent(new FacultyMainUI()); // v.setMargin(true); addComponent(v); v = new VerticalLayout(); v.setCaption("Syllabus"); v.setWidth("100%"); v.addComponent(new SyllabusMainUI()); // v.setMargin(true); addComponent(v); v = new VerticalLayout(); v.setCaption("Semestral Team"); v.setWidth("100%"); v.addComponent(new SemestralTeamUI()); // v.setMargin(true); addComponent(v); v = new VerticalLayout(); v.setCaption("Housekeeping"); v.setWidth("100%"); v.addComponent(new HousekeepingMainUI()); // v.setMargin(true); addComponent(v); v = new VerticalLayout(); v.setCaption("System Logs"); v.setWidth("100%"); v.addComponent(new SystemLogsMainUI()); // v.setMargin(true); addComponent(v); }
From source file:com.etest.view.testbank.CellCaseMainUI.java
Table populateDataTable() { table.removeAllItems();//from www . jav a 2s . com int i = 0; for (CellCase cc : ccs.getCellCaseByTopic(getSyllabusId())) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button edit = new Button("modify"); edit.setSizeFull(); edit.setData(cc.getCellCaseId()); edit.setIcon(FontAwesome.PENCIL); edit.addStyleName(ValoTheme.BUTTON_LINK); edit.addStyleName(ValoTheme.BUTTON_TINY); edit.addStyleName(ValoTheme.BUTTON_QUIET); edit.addStyleName("button-container"); edit.addClickListener(modifyBtnClickListener); v.addComponent(edit); v.setComponentAlignment(edit, Alignment.MIDDLE_LEFT); Button approve = new Button("status"); approve.setSizeFull(); approve.setData(cc.getCellCaseId()); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); approve.addStyleName("button-container"); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); if (cc.getApprovalStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); } else { approve.setIcon(FontAwesome.THUMBS_UP); } Button stem = new Button("stems"); stem.setSizeFull(); stem.setData(cc.getCellCaseId()); stem.setIcon(FontAwesome.BRIEFCASE); stem.addStyleName(ValoTheme.BUTTON_LINK); stem.addStyleName(ValoTheme.BUTTON_TINY); stem.addStyleName(ValoTheme.BUTTON_QUIET); stem.addStyleName("button-container"); stem.addClickListener(stemBtnClickListener); v.addComponent(stem); v.setComponentAlignment(stem, Alignment.MIDDLE_LEFT); Label label = new Label(cc.getCaseTopic(), ContentMode.HTML); label.setStyleName("label-padding"); table.addItem(new Object[] { cc.getCellCaseId(), label, cc.getUsername_(), cc.getDateCreated(), v }, i); i++; } table.setPageLength(table.size()); return table; }
From source file:com.etest.view.testbank.CellCaseWindow.java
Window modifyCaseWindow(CellCase cellCase) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true);// w w w . j a v a 2s. co m v.setSpacing(true); Window sub = new Window("MODIFY"); sub.setWidth("400px"); sub.setModal(true); sub.center(); ComboBox actionDone = new ComboBox("Action: "); actionDone.setWidth("70%"); actionDone.addStyleName(ValoTheme.COMBOBOX_SMALL); actionDone.setNullSelectionAllowed(false); actionDone.addItem("resolved"); actionDone.addItem("clarified"); actionDone.addItem("modified"); actionDone.setImmediate(true); v.addComponent(actionDone); TextArea remarks = new TextArea("Remarks: "); remarks.setWidth("100%"); remarks.setRows(3); v.addComponent(remarks); Button modify = new Button("UPDATE"); modify.setWidth("70%"); modify.setIcon(FontAwesome.EDIT); modify.addStyleName(ValoTheme.BUTTON_PRIMARY); modify.addStyleName(ValoTheme.BUTTON_SMALL); modify.addClickListener((Button.ClickEvent event) -> { if (remarks.getValue() == null || remarks.getValue().trim().isEmpty()) { Notification.show("Add remarks!", Notification.Type.WARNING_MESSAGE); return; } if (actionDone.getValue() == null) { Notification.show("Add action!", Notification.Type.WARNING_MESSAGE); return; } cellCase.setActionDone(actionDone.getValue().toString()); cellCase.setRemarks(remarks.getValue().trim()); boolean result = ccs.modifyCellCase(cellCase); if (result) { Notification.show("Case has been Modified!", Notification.Type.TRAY_NOTIFICATION); sub.close(); close(); } }); v.addComponent(modify); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.etest.view.testbank.CellCaseWindow.java
Window deleteCaseWindow() { Window sub = new Window("DELETE"); sub.setWidth("250px"); sub.setModal(true);/* w ww . j a v a 2s. c o m*/ sub.center(); VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); Button delete = new Button("DELETE CASE?"); delete.setWidth("100%"); delete.setImmediate(true); delete.addClickListener((Button.ClickEvent event) -> { boolean result = ccs.removeCellCase(getCellCaseId()); if (result) { sub.close(); close(); } }); v.addComponent(delete); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }