List of usage examples for com.vaadin.server FontAwesome SAVE
FontAwesome SAVE
To view the source code for com.vaadin.server FontAwesome SAVE.
Click Source Link
From source file:com.etest.view.systemadministration.curriculum.CurriculumFormWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setMargin(true);// w w w . ja v a 2s .c om yearLevel.setWidth("75%"); form.addComponent(yearLevel); subjectField.setWidth("75%"); form.addComponent(subjectField); normCourseOffering.setWidth("75%"); form.addComponent(normCourseOffering); descriptiveTitleField.setWidth("100%"); descriptiveTitleField.setRows(3); descriptiveTitleField.setInputPrompt("Descriptive Title.."); form.addComponent(descriptiveTitleField); Button save = new Button("SAVE"); save.setWidth("100%"); save.setIcon(FontAwesome.SAVE); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addStyleName(ValoTheme.BUTTON_SMALL); save.addClickListener(buttonClickListener); Button update = new Button("UPDATE"); update.setWidth("100%"); update.setIcon(FontAwesome.ADJUST); update.addStyleName(ValoTheme.BUTTON_PRIMARY); update.addStyleName(ValoTheme.BUTTON_SMALL); update.addClickListener(buttonClickListener); Button delete = new Button("DELETE"); delete.setWidth("100%"); delete.setIcon(FontAwesome.ERASER); delete.addStyleName(ValoTheme.BUTTON_PRIMARY); delete.addStyleName(ValoTheme.BUTTON_SMALL); delete.addClickListener(buttonClickListener); HorizontalLayout hlayout = new HorizontalLayout(); hlayout.setWidth("100%"); hlayout.setSpacing(true); if (getCurriculumId() != 0) { hlayout.addComponent(update); hlayout.addComponent(delete); Curriculum c = cs.getCurriculumById(getCurriculumId()); yearLevel.setValue(c.getYearLevel()); subjectField.setValue(c.getSubject()); normCourseOffering.setValue(c.getNormCourseOffering()); descriptiveTitleField.setValue(c.getDescriptiveTitle()); if (getButtonCaption().equals("edit")) { delete.setVisible(false); } else { update.setVisible(false); } } else { hlayout.addComponent(save); } form.addComponent(hlayout); return form; }
From source file:com.etest.view.systemadministration.SemestralTeam.AddSemestralTeamMembersWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setSpacing(true);/* ww w .j a va 2 s . c o m*/ faculty = CommonComboBox.getAllFacultyExceptTeamLeader("Add Team Member.. ", getFacultyId()); faculty.setWidth("60%"); faculty.setIcon(FontAwesome.USER); form.addComponent(faculty); addMemberBtn.setWidth("60%"); addMemberBtn.setIcon(FontAwesome.SAVE); addMemberBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); addMemberBtn.addStyleName(ValoTheme.BUTTON_SMALL); addMemberBtn.addClickListener(buttonClickListener); form.addComponent(addMemberBtn); populateDataTable(); form.addComponent(table); return form; }
From source file:com.etest.view.systemadministration.SemestralTeamUI.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("400px"); form.setSpacing(true);/*from www .j a v a 2 s . c o m*/ subjects = CommonComboBox.getSubjectFromCurriculum("Subject.."); subjects.setCaption("Curriculum: "); subjects.setIcon(FontAwesome.SEARCH); form.addComponent(subjects); schoolYear = CommonComboBox.getSchoolYear("School Year.."); schoolYear.setCaption("School Year: "); schoolYear.setIcon(FontAwesome.SEARCH); form.addComponent(schoolYear); semester = CommonComboBox.getNormCourseOfferingComboBox("Semester.."); semester.setCaption("Semester: "); semester.setIcon(FontAwesome.SEARCH); form.addComponent(semester); faculty = CommonComboBox.getAllFaculty("Select Faculty.."); faculty.setCaption("Team Leader: "); faculty.setIcon(FontAwesome.USER); form.addComponent(faculty); Button saveBtn = new Button("Enroll Semestral Team"); saveBtn.setWidth("100%"); saveBtn.setIcon(FontAwesome.SAVE); saveBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); saveBtn.addStyleName(ValoTheme.BUTTON_SMALL); saveBtn.addClickListener(saveBtnClickListener); saveBtn.setImmediate(true); form.addComponent(saveBtn); return form; }
From source file:com.etest.view.systemadministration.syllabus.SyllabusFormWindow.java
Component buildSyllabusForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);// w ww. j a v a2 s . c o m subjects.setCaption("Subject: "); subjects.setWidth("50%"); subjects.setIcon(FontAwesome.BOOK); subjects.addStyleName(ValoTheme.COMBOBOX_SMALL); form.addComponent(subjects); topicNo.setCaption("Topic No: "); topicNo.setWidth("50%"); topicNo.setIcon(FontAwesome.TAG); topicNo.addStyleName(ValoTheme.TEXTFIELD_SMALL); form.addComponent(topicNo); topic.setCaption("Topic: "); topic.setWidth("100%"); topic.setIcon(FontAwesome.TAG); topic.setInputPrompt("Enter Topic.."); topic.setRows(3); topic.addStyleName(ValoTheme.TEXTAREA_SMALL); form.addComponent(topic); estimatedTime.setCaption("Estimated Time: "); estimatedTime.setWidth("50%"); estimatedTime.setIcon(FontAwesome.TAG); estimatedTime.addStyleName(ValoTheme.TEXTFIELD_SMALL); form.addComponent(estimatedTime); Button save = new Button("SAVE"); save.setWidth("50%"); save.setIcon(FontAwesome.SAVE); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addStyleName(ValoTheme.BUTTON_SMALL); save.addClickListener(buttonClickListener); Button update = new Button("UPDATE"); update.setWidth("60%"); update.setIcon(FontAwesome.PENCIL); update.addStyleName(ValoTheme.BUTTON_PRIMARY); update.addStyleName(ValoTheme.BUTTON_SMALL); update.addClickListener(buttonClickListener); Button remove = new Button("REMOVE"); remove.setWidth("60%"); remove.setIcon(FontAwesome.TRASH_O); remove.addStyleName(ValoTheme.BUTTON_PRIMARY); remove.addStyleName(ValoTheme.BUTTON_SMALL); remove.addClickListener(buttonClickListener); if (getSyllabusId() != 0) { s = ss.getSyllabusById(syllabusId); subjects.setValue(s.getCurriculumId()); topicNo.setValue(String.valueOf(s.getTopicNo())); estimatedTime.setValue(String.valueOf(s.getEstimatedTime())); topic.setValue(s.getTopic()); if (getButtonCaption().equals("edit")) { form.addComponent(update); } else { form.addComponent(remove); } } else { form.addComponent(save); } return form; }
From source file:com.etest.view.testbank.CellCaseWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);//from w ww .j a va 2 s .co m subject.setCaption("Subject: "); subject.setWidth("50%"); subject.addValueChangeListener((new CurriculumPropertyChangeListener(topic))); form.addComponent(subject); topic.setCaption("Topic: "); topic.setWidth("80%"); topic.setInputPrompt("Select a Topic.."); topic.addStyleName(ValoTheme.COMBOBOX_SMALL); form.addComponent(topic); caseTopic = new TextArea(); caseTopic.setCaption("Case: "); caseTopic.setWidth("100%"); caseTopic.setRows(5); form.addComponent(caseTopic); HorizontalLayout hlayout = new HorizontalLayout(); hlayout.setWidth("100%"); hlayout.setSpacing(true); Button save = new Button("SAVE"); save.setWidth("200px"); save.setIcon(FontAwesome.SAVE); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addStyleName(ValoTheme.BUTTON_SMALL); save.addClickListener(buttonClickListener); Button modify = new Button("MODIFY"); modify.setWidth("200px"); modify.setIcon(FontAwesome.EDIT); modify.addStyleName(ValoTheme.BUTTON_PRIMARY); modify.addStyleName(ValoTheme.BUTTON_SMALL); modify.addClickListener(buttonClickListener); Button approve = new Button("APPROVE"); approve.setWidth("200px"); approve.setIcon(FontAwesome.THUMBS_UP); approve.addStyleName(ValoTheme.BUTTON_PRIMARY); approve.addStyleName(ValoTheme.BUTTON_SMALL); approve.setEnabled(UserAccess.approve()); approve.addClickListener(buttonClickListener); Button delete = new Button("DELETE"); delete.setWidth("200px"); delete.setIcon(FontAwesome.TRASH_O); delete.addStyleName(ValoTheme.BUTTON_PRIMARY); delete.addStyleName(ValoTheme.BUTTON_SMALL); delete.setEnabled(UserAccess.delete()); delete.addClickListener(buttonClickListener); if (getCellCaseId() != 0) { CellCase cc = ccs.getCellCaseById(getCellCaseId()); subject.setValue(cc.getCurriculumId()); topic.setValue(cc.getSyllabusId()); caseTopic.setValue(cc.getCaseTopic()); approve.setVisible(cc.getApprovalStatus() == 0); hlayout.addComponent(approve); hlayout.setComponentAlignment(approve, Alignment.MIDDLE_RIGHT); hlayout.addComponent(modify); hlayout.setComponentAlignment(modify, Alignment.MIDDLE_RIGHT); hlayout.addComponent(delete); hlayout.setComponentAlignment(delete, Alignment.MIDDLE_RIGHT); } else { hlayout.addComponent(save); hlayout.setComponentAlignment(save, Alignment.MIDDLE_RIGHT); } form.addComponent(hlayout); form.setComponentAlignment(hlayout, Alignment.MIDDLE_RIGHT); return form; }
From source file:com.etest.view.testbank.cellitem.CellItemWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);//from w ww.jav a 2s. c om form.setSpacing(true); HorizontalLayout hlayout = new HorizontalLayout(); hlayout.setWidth("100%"); Button helpBtn = new Button("HELP"); helpBtn.setWidthUndefined(); helpBtn.setIcon(FontAwesome.TASKS); helpBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); helpBtn.addStyleName(ValoTheme.BUTTON_SMALL); helpBtn.addClickListener((Button.ClickEvent event) -> { Window sub = new MultipleChoiceHelpViewer(); if (sub.getParent() == null) { UI.getCurrent().addWindow(sub); } }); hlayout.addComponent(helpBtn); hlayout.setComponentAlignment(helpBtn, Alignment.MIDDLE_RIGHT); form.addComponent(hlayout); bloomsTaxonomy.setCaption("Blooms Class: "); bloomsTaxonomy.setWidth("30%"); form.addComponent(bloomsTaxonomy); stem = new TextArea("Stem: "); stem.setWidth("100%"); stem.setRows(5); stem.setWordwrap(true); form.addComponent(stem); HorizontalLayout h1 = new HorizontalLayout(); h1.setCaption("Option A:"); h1.setWidth("100%"); h1.setSpacing(true); optionA = new CommonTextField("add option A", null); optionA.setWidth("500px"); h1.addComponent(optionA); Button optionABtn = new CommonButton("OPTION A"); optionABtn.setWidth("120px"); optionABtn.addClickListener(updateOptionAndKeyListerner); h1.addComponent(optionABtn); h1.setComponentAlignment(optionABtn, Alignment.MIDDLE_RIGHT); optionABtn.setVisible(isEdit()); form.addComponent(h1); HorizontalLayout h2 = new HorizontalLayout(); h2.setCaption("Key A:"); h2.setWidth("100%"); h2.setSpacing(true); keyA = new CommonTextField("Enter a Key for Option A", null); keyA.setWidth("500px"); h2.addComponent(keyA); Button keyABtn = new CommonButton("KEY A"); keyABtn.setWidth("120px"); keyABtn.addClickListener(updateOptionAndKeyListerner); h2.addComponent(keyABtn); h2.setComponentAlignment(keyABtn, Alignment.MIDDLE_RIGHT); keyABtn.setVisible(isEdit()); form.addComponent(h2); HorizontalLayout h3 = new HorizontalLayout(); h3.setCaption("Option B:"); h3.setWidth("100%"); h3.setSpacing(true); optionB = new CommonTextField("add option B", null); optionB.setWidth("500px"); h3.addComponent(optionB); Button optionBBtn = new CommonButton("OPTION B"); optionBBtn.setWidth("120px"); optionBBtn.addClickListener(updateOptionAndKeyListerner); h3.addComponent(optionBBtn); h3.setComponentAlignment(optionBBtn, Alignment.MIDDLE_RIGHT); optionBBtn.setVisible(isEdit()); form.addComponent(h3); HorizontalLayout h4 = new HorizontalLayout(); h4.setCaption("Key B:"); h4.setWidth("100%"); h4.setSpacing(true); keyB = new CommonTextField("Enter a Key for Option B", null); keyB.setWidth("500px"); h4.addComponent(keyB); Button keyBBtn = new CommonButton("KEY B"); keyBBtn.setWidth("120px"); keyBBtn.addClickListener(updateOptionAndKeyListerner); h4.addComponent(keyBBtn); h4.setComponentAlignment(keyBBtn, Alignment.MIDDLE_RIGHT); keyBBtn.setVisible(isEdit()); form.addComponent(h4); HorizontalLayout h5 = new HorizontalLayout(); h5.setCaption("Option C:"); h5.setWidth("100%"); h5.setSpacing(true); optionC = new CommonTextField("add option C", null); optionC.setWidth("500px"); h5.addComponent(optionC); Button optionCBtn = new CommonButton("OPTION C"); optionCBtn.setWidth("120px"); optionCBtn.addClickListener(updateOptionAndKeyListerner); h5.addComponent(optionCBtn); h5.setComponentAlignment(optionCBtn, Alignment.TOP_RIGHT); optionCBtn.setVisible(isEdit()); form.addComponent(h5); HorizontalLayout h6 = new HorizontalLayout(); h6.setCaption("Key C:"); h6.setWidth("100%"); h6.setSpacing(true); keyC = new CommonTextField("Enter a Key for Option C", null); keyC.setWidth("500px"); h6.addComponent(keyC); Button keyCBtn = new CommonButton("KEY C"); keyCBtn.setWidth("120px"); keyCBtn.addClickListener(updateOptionAndKeyListerner); h6.addComponent(keyCBtn); h6.setComponentAlignment(keyCBtn, Alignment.MIDDLE_RIGHT); keyCBtn.setVisible(isEdit()); form.addComponent(h6); HorizontalLayout h7 = new HorizontalLayout(); h7.setCaption("Option D:"); h7.setWidth("100%"); h7.setSpacing(true); optionD = new CommonTextField("add option D", null); optionD.setWidth("500px"); h7.addComponent(optionD); Button optionDBtn = new CommonButton("OPTION D"); optionDBtn.setWidth("120px"); optionDBtn.addClickListener(updateOptionAndKeyListerner); h7.addComponent(optionDBtn); h7.setComponentAlignment(optionDBtn, Alignment.MIDDLE_RIGHT); optionDBtn.setVisible(isEdit()); form.addComponent(h7); HorizontalLayout h8 = new HorizontalLayout(); h8.setCaption("Key D:"); h8.setWidth("100%"); h8.setSpacing(true); keyD = new CommonTextField("Enter a Key for Option D", null); keyD.setWidth("500px"); h8.addComponent(keyD); Button keyDBtn = new CommonButton("KEY D"); keyDBtn.setWidth("120px"); keyDBtn.addClickListener(updateOptionAndKeyListerner); h8.addComponent(keyDBtn); h8.setComponentAlignment(keyDBtn, Alignment.MIDDLE_RIGHT); keyDBtn.setVisible(isEdit()); form.addComponent(h8); HorizontalLayout h = new HorizontalLayout(); h.setWidth("100%"); Button save = new Button("SAVE"); save.setWidth("200px"); save.setIcon(FontAwesome.SAVE); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addStyleName(ValoTheme.BUTTON_SMALL); save.addClickListener(buttonClickListener); Button remove = new Button("ARCHIVE/REMOVE ITEM?"); remove.setWidth("200px"); remove.setIcon(FontAwesome.ARCHIVE); remove.addStyleName(ValoTheme.BUTTON_PRIMARY); remove.addStyleName(ValoTheme.BUTTON_SMALL); remove.addClickListener(buttonClickListener); Button approve = new Button("APPROVE ITEM?"); approve.setWidth("200px"); approve.setIcon(FontAwesome.THUMBS_O_UP); approve.addStyleName(ValoTheme.BUTTON_PRIMARY); approve.addStyleName(ValoTheme.BUTTON_SMALL); approve.addClickListener(buttonClickListener); Button edit = new Button("UPDATE"); edit.setWidth("200px"); edit.setIcon(FontAwesome.SAVE); edit.addStyleName(ValoTheme.BUTTON_PRIMARY); edit.addStyleName(ValoTheme.BUTTON_SMALL); edit.addClickListener(buttonClickListener); if (getCellItemId() != 0) { CellItem ci = cis.getCellItemById(getCellItemId()); bloomsTaxonomy.setValue(ci.getBloomsClassId()); bloomsTaxonomy.addValueChangeListener((Property.ValueChangeEvent event) -> { isBloomsChanged = true; }); stem.setValue(ci.getItem()); stem.addTextChangeListener((FieldEvents.TextChangeEvent event) -> { if (!stem.getValue().trim().equals(event.getText().trim())) { isStemChanged = true; } }); /** * OPTION A */ optionA.setValue(ci.getOptionA()); isOptionAKeyExist = k.isKeyExist(getCellItemId(), ci.getOptionA()); if (isOptionAKeyExist) { keyA.setValue(k.getItemKey(getCellItemId(), ci.getOptionA())); } keyA.setData(k.getItemKeyId(getCellItemId(), ci.getOptionA())); /** * OPTION B */ optionB.setValue(ci.getOptionB()); isOptionBKeyExist = k.isKeyExist(getCellItemId(), ci.getOptionB()); if (isOptionBKeyExist) { keyB.setValue(k.getItemKey(getCellItemId(), ci.getOptionB())); } keyB.setData(k.getItemKeyId(getCellItemId(), ci.getOptionB())); /** * OPTION C */ optionC.setValue(ci.getOptionC()); isOptionCKeyExist = k.isKeyExist(getCellItemId(), ci.getOptionC()); if (isOptionCKeyExist) { keyC.setValue(k.getItemKey(getCellItemId(), ci.getOptionC())); } keyC.setData(k.getItemKeyId(getCellItemId(), ci.getOptionC())); /** * OPTION D */ optionD.setValue(ci.getOptionD()); isOptionDKeyExist = k.isKeyExist(getCellItemId(), ci.getOptionD()); if (isOptionDKeyExist) { keyD.setValue(k.getItemKey(getCellItemId(), ci.getOptionD())); } keyD.setData(k.getItemKeyId(getCellItemId(), ci.getOptionD())); h.addComponent(remove); h.setComponentAlignment(remove, Alignment.MIDDLE_RIGHT); h.addComponent(approve); h.setComponentAlignment(approve, Alignment.MIDDLE_RIGHT); h.addComponent(edit); h.setComponentAlignment(edit, Alignment.MIDDLE_RIGHT); form.addComponent(h); } else { h.addComponent(save); h.setComponentAlignment(save, Alignment.MIDDLE_RIGHT); form.addComponent(h); } return form; }
From source file:com.hybridbpm.ui.component.bpm.TaskLayout.java
License:Apache License
public TaskLayout(String taskId, String processName, String taskName, boolean showHeader) { this.taskId = taskId; this.processName = processName; this.taskName = taskName; this.showHeader = showHeader; Responsive.makeResponsive(this); btnAccept.setIcon(FontAwesome.CHECK); btnEscalate.setIcon(FontAwesome.ARROW_UP); btnDelegate.setIcon(FontAwesome.ARROW_DOWN); btnSchedule.setIcon(FontAwesome.CALENDAR); btnSave.setIcon(FontAwesome.SAVE); btnSend.setIcon(FontAwesome.SEND);/*w w w. ja v a2 s .com*/ // btnClose.setIcon(FontAwesome.TIMES); btnSend.setStyleName(ValoTheme.BUTTON_PRIMARY); btnAccept.addStyleName(ValoTheme.BUTTON_SMALL); btnEscalate.addStyleName(ValoTheme.BUTTON_SMALL); btnDelegate.addStyleName(ValoTheme.BUTTON_SMALL); btnSchedule.addStyleName(ValoTheme.BUTTON_SMALL); btnSave.addStyleName(ValoTheme.BUTTON_SMALL); btnSend.addStyleName(ValoTheme.BUTTON_SMALL); btnClose.addStyleName(ValoTheme.BUTTON_SMALL); priorityMenubar.setStyleName(ValoTheme.MENUBAR_SMALL); // buttonBar.setWidth(100, Unit.PERCENTAGE); buttonBar.setSpacing(true); buttonBar.addStyleName("toolbar"); // buttonBar.setExpandRatio(btnAccept, 1f); // buttonBar.setComponentAlignment(priorityMenubar, Alignment.MIDDLE_LEFT); buttonBar.setComponentAlignment(btnAccept, Alignment.MIDDLE_RIGHT); // buttonBar.setComponentAlignment(btnEscalate, Alignment.MIDDLE_RIGHT); // buttonBar.setComponentAlignment(btnDelegate, Alignment.MIDDLE_RIGHT); buttonBar.setComponentAlignment(btnSchedule, Alignment.MIDDLE_RIGHT); buttonBar.setComponentAlignment(btnSave, Alignment.MIDDLE_RIGHT); buttonBar.setComponentAlignment(btnSend, Alignment.MIDDLE_RIGHT); buttonBar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT); tabSheet.setStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR); tabSheet.setStyleName(ValoTheme.TABSHEET_FRAMED); tabSheet.setSizeFull(); setSizeFull(); setSpacing(true); if (showHeader) { addComponent(taskFormHeader); } addComponent(buttonBar); setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT); addComponent(tabSheet); setExpandRatio(tabSheet, 1f); loadForm(); }
From source file:com.hybridbpm.ui.component.development.AbstractEditor.java
License:Apache License
public AbstractEditor() { setSizeFull();// ww w . j a v a 2s.co m setSpacing(true); setMargin(new MarginInfo(true, false, false, false)); addComponent(buttonBar); setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT); addComponent(horizontalSplitPanel); setExpandRatio(horizontalSplitPanel, 1f); horizontalSplitPanel.setSizeFull(); horizontalSplitPanel.setStyleName("transparent"); buttonBar.setSpacing(true); buttonBar.setSpacing(true); btnSave.setIcon(FontAwesome.SAVE); btnSave.setStyleName(ValoTheme.BUTTON_BORDERLESS); btnSave.addStyleName(ValoTheme.BUTTON_SMALL); btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY); }
From source file:com.hybridbpm.ui.component.document.DocumentLayout.java
License:Apache License
public DocumentLayout(String documentId) { this.documentId = documentId; tabSheet.getTab(documentFormLayout).setCaption(Translate.getMessage("documentFormCaption")); tabSheet.getTab(documentHistoryLayout).setCaption(Translate.getMessage("documentHistoryCaption")); tabSheet.getTab(documentAccessLayout).setCaption(Translate.getMessage("documentAccessCaption")); btnAddPermission.setCaption(Translate.getMessage("btnAddPermission")); btnSave.setCaption(Translate.getMessage("btnSave")); document = HybridbpmUI.getDocumentAPI().getDocumentById(documentId, false); setCaption(document.getName());//from ww w .ja va 2 s . c o m Design.read(this); documentFormLayout.initUI(document); documentHistoryLayout.setDocument(document); documentHistoryLayout.refreshTable(); Responsive.makeResponsive(this); btnSave.setIcon(FontAwesome.SAVE); btnSave.addClickListener(this); btnAddPermission.setIcon(FontAwesome.PLUS); btnAddPermission.addClickListener(this); btnAddPermission.setVisible(false); tabSheet.addSelectedTabChangeListener(this); if (Objects.equals(Document.TYPE.FOLDER, document.getType())) { tabSheet.getTab(documentFormLayout).setCaption("Folder"); tabSheet.getTab(documentHistoryLayout).setVisible(false); } else if (Objects.equals(Document.TYPE.FILE, document.getType())) { tabSheet.getTab(documentFormLayout).setCaption("File"); tabSheet.getTab(documentHistoryLayout).setVisible(true); } if (HybridbpmUI.getDocumentAPI().getMyDocumentPermissions(document) .contains(Permission.PERMISSION.PERMISSIONS)) { documentAccessLayout.setDocument(document); documentAccessLayout.refreshTable(); tabSheet.getTab(documentAccessLayout).setVisible(true); } else { tabSheet.getTab(documentAccessLayout).setVisible(false); } }
From source file:com.ies.schoolos.ui.mobile.info.layout.PersonalLayout.java
private void addressGroup() { addressGroup = new VerticalComponentGroup(); addressGroup.setSizeUndefined();/*from w w w .j a v a 2s. c om*/ addTab(addressGroup, "", FontAwesome.BOOK); tel = new TextField(""); tel.setInputPrompt(""); tel.setImmediate(false); tel.setWidth("-1px"); tel.setHeight("-1px"); tel.setNullRepresentation(""); addressGroup.addComponent(tel); mobile = new TextField(""); mobile.setInputPrompt(""); mobile.setImmediate(false); mobile.setWidth("-1px"); mobile.setHeight("-1px"); mobile.setRequired(true); mobile.setNullRepresentation(""); addressGroup.addComponent(mobile); email = new EmailField(""); email.setInputPrompt(""); email.setImmediate(false); email.setWidth("-1px"); email.setHeight("-1px"); email.setRequired(true); email.setNullRepresentation(""); email.addTextChangeListener(new TextChangeListener() { private static final long serialVersionUID = 1L; @Override public void textChange(TextChangeEvent event) { if (!isEdit) { if (event.getText() != null) { if (event.getText().length() >= 13) { userSqlContainer.addContainerFilter(new Equal(UserSchema.EMAIL, event.getText())); if (userSqlContainer.size() > 0) { disableDuplicateEmailForm(); Notification.show( "?? ??", Type.WARNING_MESSAGE); } else { enableDuplicateEmailForm(); } userSqlContainer.removeAllContainerFilters(); } } } } }); addressGroup.addComponent(email); Label currentLabel = new Label(""); addressGroup.addComponent(currentLabel); currentAddress = new TextArea(""); currentAddress.setInputPrompt(" "); currentAddress.setImmediate(false); currentAddress.setWidth("-1px"); currentAddress.setHeight("-1px"); currentAddress.setNullRepresentation(""); addressGroup.addComponent(currentAddress); currentProvince = new NativeSelect("", new Province()); //currentProvince.setInputPrompt("??"); currentProvince.setItemCaptionPropertyId("name"); currentProvince.setImmediate(true); currentProvince.setNullSelectionAllowed(false); currentProvince.setWidth("-1px"); currentProvince.setHeight("-1px"); //currentProvince.setFilteringMode(FilteringMode.CONTAINS); currentProvince.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) currentDistrict.setContainerDataSource( new District(Integer.parseInt(event.getProperty().getValue().toString()))); } }); addressGroup.addComponent(currentProvince); currentDistrict = new NativeSelect(""); //currentDistrict.setInputPrompt("??"); currentDistrict.setItemCaptionPropertyId("name"); currentDistrict.setImmediate(true); currentDistrict.setNullSelectionAllowed(false); currentDistrict.setWidth("-1px"); currentDistrict.setHeight("-1px"); //currentDistrict.setFilteringMode(FilteringMode.CONTAINS); currentDistrict.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { currentCity.setContainerDataSource( new City(Integer.parseInt(event.getProperty().getValue().toString()))); currentPostcode.setContainerDataSource( new Postcode(Integer.parseInt(event.getProperty().getValue().toString()))); } } }); addressGroup.addComponent(currentDistrict); currentCity = new NativeSelect(""); //currentCity.setInputPrompt("??"); currentCity.setItemCaptionPropertyId("name"); currentCity.setImmediate(true); currentCity.setNullSelectionAllowed(false); currentCity.setWidth("-1px"); currentCity.setHeight("-1px"); //currentCity.setFilteringMode(FilteringMode.CONTAINS); addressGroup.addComponent(currentCity); currentPostcode = new NativeSelect(""); //currentPostcode.setInputPrompt("??"); currentPostcode.setItemCaptionPropertyId("name"); currentPostcode.setImmediate(true); currentPostcode.setNullSelectionAllowed(false); currentPostcode.setWidth("-1px"); currentPostcode.setHeight("-1px"); //currentPostcode.setFilteringMode(FilteringMode.CONTAINS); addressGroup.addComponent(currentPostcode); isSameCurrentAddress = new CheckBox( "?"); isSameCurrentAddress.setImmediate(true); isSameCurrentAddress.setWidth("-1px"); isSameCurrentAddress.setHeight("-1px"); isSameCurrentAddress.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { if ((boolean) event.getProperty().getValue()) { censusAddress.setValue(currentAddress.getValue()); censusProvince.setValue(currentProvince.getValue()); censusDistrict.setValue(currentDistrict.getValue()); censusCity.setValue(currentCity.getValue()); censusPostcode.setValue(currentPostcode.getValue()); } else { censusAddress.setValue(null); censusProvince.setValue(null); censusDistrict.setValue(null); censusCity.setValue(null); censusPostcode.setValue(null); } } } }); addressGroup.addComponent(isSameCurrentAddress); censusAddress = new TextArea(""); censusAddress.setInputPrompt(" "); censusAddress.setImmediate(false); censusAddress.setWidth("-1px"); censusAddress.setHeight("-1px"); censusAddress.setNullRepresentation(""); addressGroup.addComponent(censusAddress); censusProvince = new NativeSelect("", new Province()); //censusProvince.setInputPrompt("??"); censusProvince.setItemCaptionPropertyId("name"); censusProvince.setImmediate(true); censusProvince.setNullSelectionAllowed(false); censusProvince.setWidth("-1px"); censusProvince.setHeight("-1px"); //censusProvince.setFilteringMode(FilteringMode.CONTAINS); censusProvince.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) censusDistrict.setContainerDataSource( new District(Integer.parseInt(event.getProperty().getValue().toString()))); } }); addressGroup.addComponent(censusProvince); censusDistrict = new NativeSelect(""); //censusDistrict.setInputPrompt("??"); censusDistrict.setItemCaptionPropertyId("name"); censusDistrict.setImmediate(true); censusDistrict.setNullSelectionAllowed(false); censusDistrict.setWidth("-1px"); censusDistrict.setHeight("-1px"); //censusDistrict.setFilteringMode(FilteringMode.CONTAINS); censusDistrict.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { censusCity.setContainerDataSource( new City(Integer.parseInt(event.getProperty().getValue().toString()))); censusPostcode.setContainerDataSource( new Postcode(Integer.parseInt(event.getProperty().getValue().toString()))); } } }); addressGroup.addComponent(censusDistrict); censusCity = new NativeSelect(""); //censusCity.setInputPrompt("??"); censusCity.setItemCaptionPropertyId("name"); censusCity.setImmediate(true); censusCity.setNullSelectionAllowed(false); censusCity.setWidth("-1px"); censusCity.setHeight("-1px"); //censusCity.setFilteringMode(FilteringMode.CONTAINS); addressGroup.addComponent(censusCity); censusPostcode = new NativeSelect( ""); //censusPostcode.setInputPrompt("??"); censusPostcode.setItemCaptionPropertyId("name"); censusPostcode.setImmediate(true); censusPostcode.setNullSelectionAllowed(false); censusPostcode.setWidth("-1px"); censusPostcode.setHeight("-1px"); //censusPostcode.setFilteringMode(FilteringMode.CONTAINS); addressGroup.addComponent(censusPostcode); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth("100%"); addressGroup.addComponent(buttonLayout); licensessBack = new Button(FontAwesome.ARROW_LEFT); licensessBack.setWidth("100%"); licensessBack.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { setSelectedTab(licenseeGroup); } }); buttonLayout.addComponents(licensessBack); fatherNext = new Button(FontAwesome.SAVE); fatherNext.setWidth("100%"); fatherNext.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { ConfirmDialog.show(UI.getCurrent(), "", "? ?", "", "", new ConfirmDialog.Listener() { private static final long serialVersionUID = 1L; public void onClose(ConfirmDialog dialog) { /* ? * ? ? * ? ?? */ if (dialog.isConfirmed()) { isInsertParents = true; setSelectedTab(fatherGroup); } else { isInsertParents = false; finish.click(); } } }); } }); buttonLayout.addComponents(fatherNext); }