public Object getPropertyValue(Object id) { if (PROP_ID.equals(id)) return formComp.getId() == null ? "" : formComp.getId(); else if (PROP_DATASET.equals(id)) return formComp.getDataset() == null ? "" : formComp.getDataset(); // else if(PROP_POSITION.equals(id)) // return formComp.getPosition() == null?"":formComp.getPosition(); else if (PROP_COLUMNCOUNT.equals(id)) return formComp.getColumnCount() == null ? "" : formComp.getColumnCount().toString(); else if (PROP_RENDERTYPE.equals(id)) { Integer newvalue = new Integer(formComp.getRenderType()); if (newvalue == 1) return renderType[0]; else if (newvalue == 2) return renderType[1]; else if (newvalue == 3) return renderType[2]; return newvalue.toString(); } else if (PROP_CAPTION.equals(id)) return formComp.getCaption() == null ? "" : formComp.getCaption(); // else if(PROP_HEIGHT.equals(id)) // return formComp.getHeight()==null?"":formComp.getHeight(); else if (PROP_ROWHEIGHT.equals(id)) return String.valueOf(formComp.getRowHeight()); else if (PROP_WITHFORM.equals(id)) return formComp.isWithForm() == true ? new Integer(0) : new Integer(1); else if (PROP_BGCOLOR.equals(id)) return formComp.getBackgroundColor() == null ? "" : formComp.getBackgroundColor(); else if (PROP_RENDERHIDDENELE.equals(id)) return formComp.isRenderHiddenEle() == true ? new Integer(0) : new Integer(1); else if (PROP_ELEWIDTH.equals(id)) return String.valueOf(formComp.getEleWidth()); else if (PROP_LABELMINWIDTH.equals(id)) { return String.valueOf(formComp.getLabelMinWidth()); } else return super.getPropertyValue(id); }
public void setPropertyValue(Object id, Object value) { super.setPropertyValue(id, value); if (PROP_DATASET.equals(id)) { formComp.setDataset((String) value); fireStructureChange(PROP_FORM_ELEMENT, formComp); } // else if(PROP_POSITION.equals(id)) // formComp.setPosition((String)value); else if (PROP_COLUMNCOUNT.equals(id)) formComp.setColumnCount(Integer.valueOf((String) value)); else if (PROP_RENDERTYPE.equals(id)) { if (value.equals(renderType[0])) formComp.setRenderType(1); else if (value.equals(renderType[1])) formComp.setRenderType(2); else if (value.equals(renderType[2])) formComp.setRenderType(3); } else if (PROP_CAPTION.equals(id)) { String oldValue = formComp.getCaption(); if ((oldValue == null && value != null) || (oldValue != null && value != null && !oldValue.equals(value))) { formComp.setCaption((String) value); FormEditor.getActiveEditor().refreshTreeItemText(formComp); } } else if (PROP_ROWHEIGHT.equals(id)) formComp.setRowHeight(Integer.valueOf((String) value)); else if (PROP_WITHFORM.equals(id)) { boolean truevalue = false; if ((Integer) value == 0) truevalue = true; formComp.setWithForm(truevalue); } else if (PROP_BGCOLOR.equals(id)) formComp.setBackgroundColor((String) value); else if (PROP_RENDERHIDDENELE.equals(id)) { boolean truevalue = false; if ((Integer) value == 0) truevalue = true; formComp.setRenderHiddenEle(truevalue); } else if (PROP_ELEWIDTH.equals(id)) { Integer width = Integer.valueOf((String) value); formComp.setEleWidth(width); } else if (PROP_LABELMINWIDTH.equals(id)) { formComp.setLabelMinWidth((Integer.valueOf((String) value))); } }