/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor) { super(parent, anchor); super.setShapeType(OBJECT_TYPE_COMBO_BOX); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX); }
@Override protected EscherContainerRecord createSpContainer() { EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherClientDataRecord clientData = new EscherClientDataRecord(); spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER); spContainer.setOptions((short) 0x000F); sp.setRecordId(EscherSpRecord.RECORD_ID); sp.setOptions((short) ((EscherAggregate.ST_HOSTCONTROL << 4) | 0x2)); sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE); opt.setRecordId(EscherOptRecord.RECORD_ID); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 17039620)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000)); opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00020000)); HSSFClientAnchor userAnchor = (HSSFClientAnchor) getAnchor(); userAnchor.setAnchorType(AnchorType.DONT_MOVE_DO_RESIZE); EscherRecord anchor = userAnchor.getEscherAnchor(); clientData.setRecordId(EscherClientDataRecord.RECORD_ID); clientData.setOptions((short) 0x0000); spContainer.addChildRecord(sp); spContainer.addChildRecord(opt); spContainer.addChildRecord(anchor); spContainer.addChildRecord(clientData); return spContainer; }
@Override protected EscherContainerRecord createSpContainer() { EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherClientDataRecord clientData = new EscherClientDataRecord(); spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER); spContainer.setOptions((short) 0x000F); sp.setRecordId(EscherSpRecord.RECORD_ID); sp.setOptions((short) ((EscherAggregate.ST_HOSTCONTROL << 4) | 0x2)); sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE); opt.setRecordId(EscherOptRecord.RECORD_ID); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 17039620)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000)); opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00020000)); HSSFClientAnchor userAnchor = (HSSFClientAnchor) getAnchor(); userAnchor.setAnchorType(1); EscherRecord anchor = userAnchor.getEscherAnchor(); clientData.setRecordId(EscherClientDataRecord.RECORD_ID); clientData.setOptions((short) 0x0000); spContainer.addChildRecord(sp); spContainer.addChildRecord(opt); spContainer.addChildRecord(anchor); spContainer.addChildRecord(clientData); return spContainer; }
break; case CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX: shape = new HSSFCombobox(container, objRecord); break; case CommonObjectDataSubRecord.OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING:
public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor) { super(parent, anchor); super.setShapeType(OBJECT_TYPE_COMBO_BOX); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX); }
@Override protected EscherContainerRecord createSpContainer() { EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherClientDataRecord clientData = new EscherClientDataRecord(); spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER); spContainer.setOptions((short) 0x000F); sp.setRecordId(EscherSpRecord.RECORD_ID); sp.setOptions((short) ((EscherAggregate.ST_HOSTCONTROL << 4) | 0x2)); sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE); opt.setRecordId(EscherOptRecord.RECORD_ID); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 17039620)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008)); opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000)); opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00020000)); HSSFClientAnchor userAnchor = (HSSFClientAnchor) getAnchor(); userAnchor.setAnchorType(AnchorType.DONT_MOVE_DO_RESIZE); EscherRecord anchor = userAnchor.getEscherAnchor(); clientData.setRecordId(EscherClientDataRecord.RECORD_ID); clientData.setOptions((short) 0x0000); spContainer.addChildRecord(sp); spContainer.addChildRecord(opt); spContainer.addChildRecord(anchor); spContainer.addChildRecord(clientData); return spContainer; }
/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor) { super(parent, anchor); super.setShapeType(OBJECT_TYPE_COMBO_BOX); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX); }
/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
break; case CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX: shape = new HSSFCombobox(container, objRecord); break; case CommonObjectDataSubRecord.OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING:
break; case CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX: shape = new HSSFCombobox(container, objRecord); break; case CommonObjectDataSubRecord.OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING: