@Override public void setPropertyValue(Object id, Object value) { JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue(); UPCAComponent jrList = (UPCAComponent) jrElement.getComponent(); if (id.equals(UPCAComponent.PROPERTY_CHECKSUM_MODE)) jrList.setChecksumMode(ChecksumMode.getChecksumMode4Pos((Integer) value)); else super.setPropertyValue(id, value); }
@Override public Object getPropertyValue(Object id) { JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue(); UPCAComponent jrList = (UPCAComponent) jrElement.getComponent(); if (id.equals(UPCAComponent.PROPERTY_CHECKSUM_MODE)) return ChecksumMode.getPos4ChecksumMode(jrList.getChecksumMode()); return super.getPropertyValue(id); }
@Override public void trasnferProperties(JRElement target) { super.trasnferProperties(target); JRDesignComponentElement jrSourceElement = (JRDesignComponentElement) getValue(); UPCAComponent jrSourceBarcode = (UPCAComponent) jrSourceElement.getComponent(); JRDesignComponentElement jrTargetElement = (JRDesignComponentElement) target; UPCAComponent jrTargetBarcode = (UPCAComponent) jrTargetElement.getComponent(); jrTargetBarcode.setChecksumMode(jrSourceBarcode.getChecksumMode()); }
@Override public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) { JRDesignComponentElement el = new JRDesignComponentElement(); UPCAComponent component = new UPCAComponent(); JRDesignExpression exp = new JRDesignExpression(); exp.setText("\"12345678901\""); // $NON-NLS-1$ component.setCodeExpression(exp); el.setComponent(component); el.setComponentKey( new ComponentKey( "http://jasperreports.sourceforge.net/jasperreports/components", "jr", "UPCA")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ DefaultManager.INSTANCE.applyDefault(this.getClass(), el); return el; }