public Field createField(Item item, Object propertyId, Component uiContext) { String pid = (String) propertyId; PersistentClass entity = ConfigurationMapping.getConfigurationEntity(AddressType.class.getName()); if ("name".equals(pid)) { TextField textField = new TextField( FactoryI18nManager.getI18nManager() .getMessage(Messages.ADDRESS_TYPE_ABM_TABLE_AND_FORM_NAME)); textField.setNullRepresentation(""); textField.setRequired(true); textField.setMaxLength(ConfigurationMapping.getColumnSize("name", entity)); return textField; } else if ("comment".equals(pid)) { TextArea textArea = new TextArea( FactoryI18nManager.getI18nManager() .getMessage(Messages.ADDRESS_TYPE_ABM_TABLE_AND_FORM_COMMENT)); textArea.setWidth("250"); textArea.setHeight("50"); textArea.setNullRepresentation(""); textArea.setMaxLength(ConfigurationMapping.getColumnSize("comment", entity)); // textArea.setRequired(false); // textArea.setMaxLength(maxLength) // textArea.setHeight(height); // textArea.setWidth(width); // textArea.setEnabled(enabled); // textArea.setIcon(icon); return textArea; } return null; }
protected void initDescription() { TextArea descriptionField = new TextArea(i18nManager.getMessage(Messages.RELATED_CONTENT_DESCRIPTION)); descriptionField.setWidth(100, UNITS_PERCENTAGE); descriptionField.setHeight(50, UNITS_PIXELS); form.addField("description", descriptionField); }
public CommentLayout() { comment = new TextArea(""); comment.setWidth("1300"); comment.setHeight("300"); comment.setNullRepresentation(""); comment.setMaxLength(254); addComponent(comment); }
BuilderDrawer() { if (drawerResource != null) { Embedded drawerBkg = new Embedded(null, drawerResource); addComponent(drawerBkg, "top:0px;left:0px"); } content = new TextArea(); // only shows if no focus, and if we don't have focus, it's not normally showing // content.setInputPrompt("Type here to add to this card chain."); content.setWordwrap(true); content.setImmediate(true); content.setTextChangeEventMode(TextChangeEventMode.LAZY); content.setTextChangeTimeout(500); // cause exception w/ 2 windows? // content.setDebugId(CardTypeManager.getCardContentDebugId(ct)); content.setId( CardDebug.getCardContentDebugId(ct)); // CardTypeManager.getCardContentDebugId(ct)); content.addTextChangeListener(new characterTypedHandler()); content.setWidth(CARDLISTHEADER_DRAWER_TEXT_W); content.setHeight(CARDLISTHEADER_DRAWER_TEXT_H); content.addStyleName("m-white-background"); addComponent(content, CARDLISTHEADER_DRAWER_TEXT_POS); count = new Label("0/140"); count.setWidth(CARDLISTHEADER_DRAWER_COUNT_W); count.setHeight(CARDLISTHEADER_DRAWER_COUNT_H); count.addStyleName("m-cardbuilder-count-text"); addComponent(count, CARDLISTHEADER_DRAWER_COUNT_POS); cancelButt = new NativeButton("cancel"); cancelButt.setWidth(CARDLISTHEADER_DRAWER_CANCEL_W); cancelButt.setHeight(CARDLISTHEADER_DRAWER_CANCEL_H); cancelButt.addStyleName("borderless"); cancelButt.addStyleName("m-cardbuilder-button-text"); cancelButt.addClickListener(new CancelHandler()); addComponent(cancelButt, CARDLISTHEADER_DRAWER_CANCEL_POS); submitButt = new NativeButton("submit"); // cause exception w/ 2 windows? // submitButt.setDebugId(CardTypeManager.getCardSubmitDebugId(ct)); submitButt.setId( CardDebug.getCardSubmitDebugId(ct)); // CardTypeManager.getCardSubmitDebugId(ct)); submitButt.setWidth(CARDLISTHEADER_DRAWER_OKBUTT_W); submitButt.setHeight(CARDLISTHEADER_DRAWER_OKBUTT_H); submitButt.addStyleName("borderless"); submitButt.addStyleName("m-cardbuilder-button-text"); submitButt.addClickListener(new CardPlayHandler()); addComponent(submitButt, CARDLISTHEADER_DRAWER_OKBUTT_POS); setWidth(CARDLISTHEADER_DRAWER_W); setHeight(CARDLISTHEADER_DRAWER_H); }
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("-1px"); horizontalLayout_1.setHeight("-1px"); horizontalLayout_1.setMargin(false); horizontalLayout_1.setSpacing(true); // textAreaDescription textAreaDescription = new TextArea(); textAreaDescription.setCaption("Enter A Description"); textAreaDescription.setImmediate(false); textAreaDescription.setWidth("50.0%"); textAreaDescription.setHeight("-1px"); horizontalLayout_1.addComponent(textAreaDescription); // textFieldFilter textFieldFilter = new TextField(); textFieldFilter.setCaption("Filter Function By ID"); textFieldFilter.setImmediate(false); textFieldFilter.setWidth("-1px"); textFieldFilter.setHeight("-1px"); horizontalLayout_1.addComponent(textFieldFilter); horizontalLayout_1.setComponentAlignment(textFieldFilter, new Alignment(9)); // comboBoxDatatypeFilter comboBoxDatatypeFilter = new ComboBox(); comboBoxDatatypeFilter.setCaption("Filter By Data Type"); comboBoxDatatypeFilter.setImmediate(false); comboBoxDatatypeFilter.setWidth("-1px"); comboBoxDatatypeFilter.setHeight("-1px"); horizontalLayout_1.addComponent(comboBoxDatatypeFilter); horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter, new Alignment(9)); // checkBoxFilterIsBag checkBoxFilterIsBag = new CheckBox(); checkBoxFilterIsBag.setCaption("Is Bag Filter"); checkBoxFilterIsBag.setImmediate(false); checkBoxFilterIsBag.setWidth("-1px"); checkBoxFilterIsBag.setHeight("-1px"); horizontalLayout_1.addComponent(checkBoxFilterIsBag); horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag, new Alignment(9)); return horizontalLayout_1; }
private void initUI() { addStyleName(Reindeer.WINDOW_LIGHT); setModal(true); setHeight("90%"); setWidth("60%"); center(); HorizontalLayout bottom = new HorizontalLayout(); bottom.setStyleName(ExplorerLayout.THEME); bottom.setSizeFull(); // bottom.setMargin(true); bottom.setSpacing(true); bottom.addStyleName(Runo.LAYOUT_DARKER); this.setContent(bottom); scheduleEventFieldGroup = new FieldGroup(); scheduleEventFieldGroup.setBuffered(true); if (currentBeanItem != null) { scheduleEventFieldGroup.setItemDataSource(currentBeanItem); } line = new GridLayout(4, 20); line.addStyleName("v-gridlayout"); line.setWidth("100%"); line.setSpacing(true); line.setMargin(true); final Label lbTitle = CommonFieldHandler.createLable("计划名称:"); line.addComponent(lbTitle); line.setComponentAlignment(lbTitle, Alignment.MIDDLE_RIGHT); final TextField txtTitle = new TextField(); txtTitle.setWidth("80%"); scheduleEventFieldGroup.bind(txtTitle, "name"); line.addComponent(txtTitle, 1, 0, 3, 0); line.setComponentAlignment(txtTitle, Alignment.MIDDLE_LEFT); Label label2 = CommonFieldHandler.createLable("开始时间:"); line.addComponent(label2, 0, 1, 0, 1); line.setComponentAlignment(label2, Alignment.MIDDLE_RIGHT); // 创建一个时间后台变化的listener BlurListener startTimeListener = createTimeReCountListener(); DateField startDateField = CommonFieldHandler.createDateField("", false); scheduleEventFieldGroup.bind(startDateField, "startDate"); startDateField.addBlurListener(startTimeListener); line.addComponent(startDateField, 1, 1, 1, 1); line.setComponentAlignment(startDateField, Alignment.MIDDLE_LEFT); Label label3 = CommonFieldHandler.createLable("估算时间:"); line.addComponent(label3, 2, 1, 2, 1); line.setComponentAlignment(label3, Alignment.MIDDLE_RIGHT); HorizontalLayout hlay = new HorizontalLayout(); final TextField estimateField = new TextField(); estimateField.setValue("1"); estimateField.setWidth("60px"); estimateField.setNullSettingAllowed(false); BlurListener timeReCountListener = createTimeReCountListener(); estimateField.addBlurListener(timeReCountListener); scheduleEventFieldGroup.bind(estimateField, "estimate"); hlay.addComponent(estimateField); Map<Object, String> data = new HashMap(); data.put(0, "天"); data.put(1, "时"); data.put(2, "分"); // WW_TODO 估算时间单位 ComboBox unit_cb = createComboBox(data, "55px"); scheduleEventFieldGroup.bind(unit_cb, "estimateUnit"); hlay.addComponent(unit_cb); line.addComponent(hlay, 3, 1, 3, 1); line.setComponentAlignment(hlay, Alignment.MIDDLE_LEFT); Label label4 = CommonFieldHandler.createLable("到期时间:"); line.addComponent(label4, 0, 2, 0, 2); line.setComponentAlignment(label4, Alignment.MIDDLE_RIGHT); completionDateField = CommonFieldHandler.createDateField("", false); line.addComponent(completionDateField, 1, 2, 1, 2); line.setComponentAlignment(completionDateField, Alignment.MIDDLE_LEFT); scheduleEventFieldGroup.bind(completionDateField, "completionDate"); // line.setExpandRatio(completionDateField, 1.0f); Label label6 = CommonFieldHandler.createLable("消耗时间:"); line.addComponent(label6, 2, 2, 2, 2); line.setComponentAlignment(label6, Alignment.MIDDLE_RIGHT); TextField gs1 = new TextField(); gs1.setValue("20%"); gs1.setInputPrompt("50%"); scheduleEventFieldGroup.bind(gs1, "useup"); line.addComponent(gs1, 3, 2, 3, 2); line.setComponentAlignment(gs1, Alignment.MIDDLE_LEFT); Label label5 = CommonFieldHandler.createLable("优先级:"); // label.setWidth("80px"); line.addComponent(label5, 0, 3, 0, 3); line.setComponentAlignment(label5, Alignment.MIDDLE_RIGHT); Map<Object, String> dtp = new HashMap(); dtp.put(0, "底"); dtp.put(1, "中"); dtp.put(2, "高"); ComboBox selectPriority = createComboBox(dtp, "100px"); // NativeSelect select = new NativeSelect(); // select.addItem("无"); // select.addItem("0(最低)"); // String itemId = "1(中)"; // select.addItem(itemId); // select.addItem("2(高)"); selectPriority.setNullSelectionAllowed(false); selectPriority.select(2); scheduleEventFieldGroup.bind(selectPriority, "priority"); line.addComponent(selectPriority, 1, 3, 1, 3); line.setComponentAlignment(selectPriority, Alignment.MIDDLE_LEFT); Label label1 = CommonFieldHandler.createLable("完成百分比:"); line.addComponent(label1, 2, 3, 2, 3); line.setComponentAlignment(label1, Alignment.MIDDLE_RIGHT); TextField tf = new TextField(); tf.setInputPrompt("50%"); line.addComponent(tf, 3, 3, 3, 3); line.setComponentAlignment(tf, Alignment.MIDDLE_LEFT); Label label7 = CommonFieldHandler.createLable("关联日程:"); line.addComponent(label7, 0, 4, 0, 4); line.setComponentAlignment(label7, Alignment.MIDDLE_RIGHT); CheckBox relatedCalendar_cb = new CheckBox(); relatedCalendar_cb.setValue(false); line.addComponent(relatedCalendar_cb, 1, 4, 1, 4); line.setComponentAlignment(relatedCalendar_cb, Alignment.MIDDLE_LEFT); scheduleEventFieldGroup.bind(relatedCalendar_cb, "relatedCalendar"); Label lbStatus = CommonFieldHandler.createLable("计划状态:"); lbStatus.setWidth("20px"); line.addComponent(lbStatus, 2, 4, 2, 4); line.setComponentAlignment(lbStatus, Alignment.MIDDLE_RIGHT); Map<Object, String> sta = new HashMap(); sta.put(0, "新建"); sta.put(1, "完成"); sta.put(2, "关闭"); sta.put(3, "取消"); ComboBox sectStatus = createComboBox(sta, "100px"); sectStatus.setNullSelectionAllowed(false); scheduleEventFieldGroup.bind(sectStatus, "status"); line.addComponent(sectStatus, 3, 4, 3, 4); line.setComponentAlignment(sectStatus, Alignment.MIDDLE_LEFT); Label label8 = CommonFieldHandler.createLable("关联外部任务:"); label8.setWidth("20px"); line.addComponent(label8, 0, 5, 0, 5); line.setComponentAlignment(label8, Alignment.MIDDLE_RIGHT); CheckBox cb = new CheckBox(); cb.setValue(true); line.addComponent(cb, 1, 5, 1, 5); line.setComponentAlignment(cb, Alignment.MIDDLE_LEFT); scheduleEventFieldGroup.bind(cb, "relatedTask"); Label label9 = CommonFieldHandler.createLable("外部任务类型:"); label9.setWidth("20px"); line.addComponent(label9, 2, 5, 2, 5); line.setComponentAlignment(label9, Alignment.MIDDLE_RIGHT); Map<Object, String> oat = new HashMap(); oat.put(0, "外包任务"); oat.put(1, "外包任务-类型2"); ComboBox select2 = createComboBox(oat, "150px"); // NativeSelect select2 = new NativeSelect(); // select2.addItem("外包任务"); // select2.addItem("外包任务-类型2"); select2.setNullSelectionAllowed(false); scheduleEventFieldGroup.bind(select2, "type"); line.addComponent(select2, 3, 5, 3, 5); line.setComponentAlignment(select2, Alignment.MIDDLE_LEFT); // select2.select("Timed"); Label lbOwnGrp = CommonFieldHandler.createLable("计划分配团队:"); lbOwnGrp.setWidth("20px"); line.addComponent(lbOwnGrp, 0, 6, 0, 6); line.setComponentAlignment(lbOwnGrp, Alignment.MIDDLE_RIGHT); // NativeSelect sectOwnGrp = new NativeSelect(); Map<Object, String> groupsMap = teamService.queryTeamOfUser(LoginHandler.getLoggedInUser().getId()); groupsMap.put("", "请选择"); ComboBox sectOwnGrp = createComboBox(groupsMap, "150px"); // for (String p : groupsMap.keySet()) { // String title = groupsMap.get(p); // sectOwnGrp.addItem(p); // sectOwnGrp.setItemCaption(p, title); // } sectOwnGrp.setNullSelectionAllowed(false); ValueChangeListener valueChangeListener = createValueChangeListener(); sectOwnGrp.addValueChangeListener(valueChangeListener); sectOwnGrp.setImmediate(true); scheduleEventFieldGroup.bind(sectOwnGrp, "assignedTeam"); line.addComponent(sectOwnGrp, 1, 6, 1, 6); line.setComponentAlignment(sectOwnGrp, Alignment.MIDDLE_LEFT); final Label lbOwner = CommonFieldHandler.createLable("计划分配用户:"); lbOwner.setWidth("20px"); line.addComponent(lbOwner, 2, 6, 2, 6); line.setComponentAlignment(lbOwner, Alignment.MIDDLE_RIGHT); // sectOwner = new NativeSelect(); // sectOwner.addItem("请选择"); sectOwner.setNullSelectionAllowed(false); scheduleEventFieldGroup.bind(sectOwner, "assignedUser"); line.addComponent(sectOwner, 3, 6, 3, 6); line.setComponentAlignment(sectOwner, Alignment.MIDDLE_LEFT); final Label lbDesc = CommonFieldHandler.createLable("计划描述:"); lbDesc.setWidth("15px"); line.addComponent(lbDesc, 0, 7, 0, 7); line.setComponentAlignment(lbDesc, Alignment.MIDDLE_RIGHT); final TextArea taDesc = CommonFieldHandler.createTextArea(""); taDesc.setWidth("85%"); taDesc.setHeight("290px"); scheduleEventFieldGroup.bind(taDesc, "description"); line.addComponent(taDesc, 1, 7, 3, 13); line.setComponentAlignment(taDesc, Alignment.MIDDLE_LEFT); // CKEditorConfig config = new CKEditorConfig(); final Button updateSave = new Button("保存"); updateSave.addClickListener( new ClickListener() { @SuppressWarnings("unchecked") public void buttonClick(ClickEvent event) { // WW_TODO 修改保存到数据库 Todo fieldGroupTodo = saveFieldGroupToDB(); fireEvent( new SubmitEvent( updateSave, SubmitEvent.SUBMITTED, scheduleEventFieldGroup.getItemDataSource())); // close popup window close(); /* * Todo fieldGroupTodo = saveFieldGroupToDB(); //reflash current * Item copyBeanValueToContainer(hContainer,(BeanItem<Todo>)( * scheduleEventFieldGroup.getItemDataSource())); //刷新日历 * main.refreshCalendarView(); Notification.show("保存成功", * Notification.Type.HUMANIZED_MESSAGE); //如果有外部流程,启动外部流程 if * (fieldGroupTodo.getRelatedTask()) { ViewToolManager * .showPopupWindow(new ActivityStartPopupWindow( "1111")); } */ if (fieldGroupTodo.getRelatedTask()) { ViewToolManager.showPopupWindow(new ActivityStartPopupWindow("1111")); } } }); line.addComponent(updateSave, 3, 14, 3, 14); line.setComponentAlignment(updateSave, Alignment.MIDDLE_RIGHT); // line.setExpandRatio(updateSave, 1.0f); bottom.addComponent(line); }
private void buildView() { logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Painting PurchaseEnquiry UI"); // Initialization for Purchase Enquire Details user input components tfEnqNo = new TextField("Enquiry No"); tfEnqNo.setMaxLength(40); tfEnqQty = new TextField(); tfEnqQty.setValue("0"); tfEnqQty.setWidth("90"); dfDueDate = new GERPPopupDateField("Due Date"); dfDueDate.setInputPrompt("Select Date"); dfEnqDate = new GERPPopupDateField("Enquiry Date"); dfEnqDate.setInputPrompt("Select Date"); taEnqDtlRem = new TextArea("Remarks"); taEnqDtlRem.setMaxLength(40); taEnqDtlRem.setWidth("150"); taEnqDtlRem.setHeight("50"); taEnqRem = new TextArea("Remarks"); taEnqRem.setHeight("50"); taEnqDtlRem.setMaxLength(100); cbBranch = new GERPComboBox("Branch Name"); cbBranch.setItemCaptionPropertyId("branchName"); loadBranchList(); try { ApprovalSchemaDM obj = serviceSmsPurEnqHdr.getReviewerId(companyid, appScreenId, branchId, roleId).get(0); if (obj.getApprLevel().equals("Approver")) { cbEnqStatus = new GERPComboBox("Status", BASEConstants.T_SMS_P_ENQUIRY_HDR, BASEConstants.RP_STATUS); } else { cbEnqStatus = new GERPComboBox( "Status", BASEConstants.T_SMS_P_ENQUIRY_HDR, BASEConstants.PE_STATUS_RV); } } catch (Exception e) { logger.info(e.getMessage()); } cbEnqStatus.setWidth("120"); cbEnqDtlStatus = new GERPComboBox("Status", BASEConstants.M_GENERIC_TABLE, BASEConstants.M_GENERIC_COLUMN); lsProduct = new ListSelect("Product Name"); lsProduct.setItemCaptionPropertyId("prodname"); lsProduct.setMultiSelect(true); loadProduct(); lsProduct.setImmediate(true); lsProduct.addValueChangeListener( new ValueChangeListener() { /** */ private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { String[] split = lsProduct .getValue() .toString() .replaceAll("\\[", "") .replaceAll("\\]", "") .split(","); for (String obj : split) { if (obj.trim().length() > 0) { cbUom.setReadOnly(false); cbUom.setValue( serviceProduct .getProductList( companyid, Long.valueOf(obj.trim()), null, null, null, null, null, "F") .get(0) .getUom()); cbUom.setReadOnly(true); } } } }); cbUom = new TextField(); cbUom.setWidth("77"); cbUom.setHeight("23"); lsVendorName = new ListSelect("Vendor Name "); lsVendorName.setMultiSelect(true); lsVendorName.setItemCaptionPropertyId("vendorName"); loadVendorList(); lsVendorName.setWidth("150"); lsVendorName.setHeight("75"); hlSearchLayout = new GERPAddEditHLayout(); assembleSearchLayout(); hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout)); resetFields(); loadSrchRslt(); loadPurDtl(); btnaddSpec.setStyleName("add"); btnaddSpec.addClickListener( new ClickListener() { // Click Listener for Add and Update private static final long serialVersionUID = 6551953728534136363L; @Override public void buttonClick(ClickEvent event) { if (dtlValidation()) { saveEnqDtl(); } } }); btndelete.setEnabled(false); // ClickListener for Enquire Detail Tale tblSmsEnqDtl.addItemClickListener( new ItemClickListener() { private static final long serialVersionUID = 1L; @Override public void itemClick(ItemClickEvent event) { if (tblSmsEnqDtl.isSelected(event.getItemId())) { tblSmsEnqDtl.setImmediate(true); btnaddSpec.setCaption("Add"); btnaddSpec.setStyleName("savebt"); btndelete.setEnabled(false); enqDtlresetFields(); } else { ((AbstractSelect) event.getSource()).select(event.getItemId()); btnaddSpec.setCaption("Update"); btnaddSpec.setStyleName("savebt"); btndelete.setEnabled(true); editSmsPurDetail(); } } }); btndelete.addClickListener( new ClickListener() { // Click Listener for Add and Update private static final long serialVersionUID = 6551953728534136363L; @Override public void buttonClick(ClickEvent event) { if (btndelete == event.getButton()) { deleteDetails(); } } }); }
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("580px"); mainLayout.setHeight("360px"); mainLayout.setMargin(true); // top-level component properties setWidth("580px"); setHeight("360px"); // descriptionField descriptionField = new TextField(); descriptionField.setCaption("Descripción"); descriptionField.setImmediate(false); descriptionField.setWidth("380px"); descriptionField.setHeight("-1px"); mainLayout.addComponent(descriptionField, "top:112.0px;left:180.0px;"); // idField idField = new TextField(); idField.setCaption("Id"); idField.setImmediate(false); idField.setWidth("400px"); idField.setHeight("-1px"); idField.setRequired(true); mainLayout.addComponent(idField, "top:20.0px;left:20.0px;"); // nameField nameField = new TextField(); nameField.setCaption("Nombre"); nameField.setImmediate(false); nameField.setWidth("140px"); nameField.setHeight("-1px"); nameField.setRequired(true); mainLayout.addComponent(nameField, "top:112.0px;left:20.0px;"); // packageNameField packageNameField = new TextField(); packageNameField.setCaption("Paquete"); packageNameField.setImmediate(false); packageNameField.setWidth("400px"); packageNameField.setHeight("-1px"); packageNameField.setRequired(true); mainLayout.addComponent(packageNameField, "top:64.0px;left:20.0px;"); // versionField versionField = new TextField(); versionField.setCaption("Versión"); versionField.setImmediate(false); versionField.setWidth("120px"); versionField.setHeight("-1px"); versionField.setRequired(true); mainLayout.addComponent(versionField, "top:64.0px;left:440.0px;"); // activeField activeField = new CheckBox(); activeField.setCaption("Activo"); activeField.setImmediate(false); activeField.setWidth("-1px"); activeField.setHeight("-1px"); activeField.setRequired(true); mainLayout.addComponent(activeField, "top:20.0px;left:507.0px;"); // fileField fileField = new FileField(); fileField.setImmediate(false); fileField.setWidth("540px"); fileField.setHeight("-1px"); mainLayout.addComponent(fileField, "top:160.0px;left:20.0px;"); // errorMessageField errorMessageField = new TextArea(); errorMessageField.setCaption("Mensaje Error"); errorMessageField.setImmediate(false); errorMessageField.setWidth("540px"); errorMessageField.setHeight("120px"); mainLayout.addComponent(errorMessageField, "top:220.0px;left:20.0px;"); return mainLayout; }
@AutoGenerated private AbsoluteLayout buildGeneralLayout() { // common part: create layout generalLayout = new AbsoluteLayout(); generalLayout.setImmediate(false); generalLayout.setWidth("100.0%"); generalLayout.setHeight("100.0%"); generalLayout.setMargin(false); // photoField photoField = new ImageField(); photoField.setImmediate(false); photoField.setWidth("420px"); photoField.setHeight("140px"); generalLayout.addComponent(photoField, "top:20.0px;left:10.0px;"); // vatField vatField = new TextField(); vatField.setCaption("CIF/NIF"); vatField.setImmediate(false); vatField.setWidth("120px"); vatField.setHeight("-1px"); generalLayout.addComponent(vatField, "top:16.0px;left:435.0px;"); // clientTypeField clientTypeField = new ComboBox(); clientTypeField.setCaption("Tipo"); clientTypeField.setImmediate(false); clientTypeField.setDescription("Tipo Cliente"); clientTypeField.setWidth("-1px"); clientTypeField.setHeight("-1px"); clientTypeField.setRequired(true); generalLayout.addComponent(clientTypeField, "top:54.0px;left:435.0px;"); // clientGroupField clientGroupField = new ComboBox(); clientGroupField.setCaption("Grupo"); clientGroupField.setImmediate(false); clientGroupField.setWidth("-1px"); clientGroupField.setHeight("-1px"); clientGroupField.setRequired(true); generalLayout.addComponent(clientGroupField, "top:92.0px;left:435.0px;"); // phoneField phoneField = new TextField(); phoneField.setCaption("Teléfono 01"); phoneField.setImmediate(false); phoneField.setWidth("115px"); phoneField.setHeight("-1px"); generalLayout.addComponent(phoneField, "top:16.0px;left:653.0px;"); // faxField faxField = new TextField(); faxField.setCaption("Fax"); faxField.setImmediate(false); faxField.setWidth("115px"); faxField.setHeight("-1px"); generalLayout.addComponent(faxField, "top:54.0px;left:779.0px;"); // facebookIdField facebookIdField = new TextField(); facebookIdField.setCaption("Facebook Id"); facebookIdField.setImmediate(false); facebookIdField.setWidth("242px"); facebookIdField.setHeight("24px"); generalLayout.addComponent(facebookIdField, "top:90.0px;left:653.0px;"); // mobileField mobileField = new TextField(); mobileField.setCaption("Teléfono 02"); mobileField.setImmediate(false); mobileField.setWidth("115px"); mobileField.setHeight("-1px"); generalLayout.addComponent(mobileField, "top:16.0px;left:780.0px;"); // descriptionField descriptionField = new TextField(); descriptionField.setCaption("Descripción"); descriptionField.setImmediate(false); descriptionField.setWidth("460px"); descriptionField.setHeight("-1px"); generalLayout.addComponent(descriptionField, "top:132.0px;left:435.0px;"); // commentField commentField = new TextArea(); commentField.setCaption("Comentarios"); commentField.setImmediate(false); commentField.setWidth("885px"); commentField.setHeight("70px"); generalLayout.addComponent(commentField, "top:206.0px;left:11.0px;"); // emailField emailField = new TextField(); emailField.setCaption("Email"); emailField.setImmediate(false); emailField.setWidth("460px"); emailField.setHeight("-1px"); generalLayout.addComponent(emailField, "top:172.0px;left:435.0px;"); return generalLayout; }
private void buildWorkSpace() { mainLayout.addTab(workSpace, "Work Space"); workSpace.setSizeFull(); final TextField className = new TextField("Correlator Class Name"); final TextArea classCode = new TextArea("Correlator Code"); final TextField builderClassName = new TextField("Builder Class Name"); final TextArea builderClassCode = new TextArea("Builder Code"); final CheckBox withBuilder = new CheckBox("Correlator comes with builder?"); withBuilder.setImmediate(true); withBuilder.addListener( new Property.ValueChangeListener() { public void valueChange(Property.ValueChangeEvent event) { if (withBuilder.booleanValue()) { builderClassName.setVisible(true); builderClassCode.setVisible(true); } else { builderClassName.setVisible(false); builderClassCode.setVisible(false); } } }); final Button compile = new Button("Add Correlator"); compile.addListener( new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { if (!withBuilder.booleanValue()) { CorrelatorFromCodeFactory.createCorrelator( (String) helper.getBean("classPath"), className.getValue().toString(), classCode.getValue().toString(), correlatorBuilderManager, feed, correlatorPool, null, null, null); } else { RuntimeJavaFileCompiler.compile( (String) helper.getBean("classPath"), className.getValue().toString(), classCode.getValue().toString()); CorrelatorBuilderFromCodeFactory.createCorrelatorBuilder( (String) helper.getBean("classPath"), builderClassName.getValue().toString(), builderClassCode.getValue().toString(), correlatorBuilderManager, feed, correlatorPool); } } }); workSpace.addComponent(className); workSpace.addComponent(classCode); workSpace.addComponent(withBuilder); workSpace.addComponent(builderClassName); workSpace.addComponent(builderClassCode); builderClassName.setVisible(false); builderClassCode.setVisible(false); workSpace.addComponent(compile); classCode.setWidth("100%"); classCode.setHeight("500px"); builderClassCode.setWidth("100%"); builderClassCode.setHeight("500px"); }