/** * Insert a {@link CString} record that stores the user's date. * * @return the created {@link CString} record that stores the user's date. */ public CString addUserDateAtom(){ if(csDate != null) return csDate; csDate = new CString(); csDate.setOptions(USERDATEATOM << 4); addChildAfter(csDate, hdAtom); return csDate; }
/** * Gets the name that appears in the paste special dialog. * * @return the name that appears in the paste special dialog. */ public String getClipboardName() { return clipboardName == null ? null : clipboardName.getText(); }
/** * Set the text of this comment */ public void setText(String text) { commentRecord.setText(text); }
/** * Go through our child records, picking out the ones that are * interesting, and saving those for use by the easy helper * methods. */ private void findInterestingChildren() { for(Record r : _children){ if (r instanceof CString){ CString cs = (CString)r; int recInstance = cs.getOptions() >> 4; switch(recInstance){ case 0: authorRecord = cs; break; case 1: commentRecord = cs; break; case 2: authorInitialsRecord = cs; break; } } else if (r instanceof Comment2000Atom){ commentAtom = (Comment2000Atom)r; } else { logger.log(POILogger.WARN, "Unexpected record with type="+r.getRecordType()+" in Comment2000: " + r.getClass().getName()); } } }
/** * Create a new ExVideoContainer, with blank fields */ public ExVideoContainer() { // Setup our header block _header = new byte[8]; _header[0] = 0x0f; // We are a container record LittleEndian.putShort(_header, 2, (short)getRecordType()); _children = new Record[2]; _children[0] = mediaAtom = new ExMediaAtom(); _children[1] = pathAtom = new CString(); }
public void setLinkOptions(int options) { if(linkDetailsB != null) { linkDetailsB.setOptions(options); } }
/** * Go through our child records, picking out the ones that are * interesting, and saving those for use by the easy helper * methods. */ private void findInterestingChildren() { for(Record r : _children){ if (r instanceof CString){ CString cs = (CString)r; int recInstance = cs.getOptions() >> 4; switch(recInstance){ case 0: authorRecord = cs; break; case 1: commentRecord = cs; break; case 2: authorInitialsRecord = cs; break; default: break; } } else if (r instanceof Comment2000Atom){ commentAtom = (Comment2000Atom)r; } else { logger.log(POILogger.WARN, "Unexpected record with type="+r.getRecordType()+" in Comment2000: " + r.getClass().getName()); } } }
/** * Create a new ExVideoContainer, with blank fields */ public ExVideoContainer() { // Setup our header block _header = new byte[8]; _header[0] = 0x0f; // We are a container record LittleEndian.putShort(_header, 2, (short)getRecordType()); _children = new Record[2]; _children[0] = mediaAtom = new ExMediaAtom(); _children[1] = pathAtom = new CString(); }
/** * Insert a {@link CString} record that stores the user's date. * * @return the created {@link CString} record that stores the user's date. */ public CString addUserDateAtom(){ if(csDate != null) return csDate; csDate = new CString(); csDate.setOptions(USERDATEATOM << 4); addChildAfter(csDate, hdAtom); return csDate; }
/** * Gets the name that appears in the paste special dialog. * * @return the name that appears in the paste special dialog. */ public String getClipboardName() { return clipboardName == null ? null : clipboardName.getText(); }
/** * Sets the URL of the link * TODO: Figure out if we should always set both */ public void setLinkURL(String url) { if(linkDetailsB != null) { linkDetailsB.setText(url); } } public void setLinkTitle(String title) {
protected HeadersFootersContainer(byte[] source, int start, int len) { // Grab the header _header = new byte[8]; System.arraycopy(source,start,_header,0,8); _children = Record.findChildRecords(source,start+8,len-8); for(int i=0; i < _children.length; i++){ if(_children[i] instanceof HeadersFootersAtom) hdAtom = (HeadersFootersAtom)_children[i]; else if(_children[i] instanceof CString) { CString cs = (CString)_children[i]; int opts = cs.getOptions() >> 4; switch(opts){ case USERDATEATOM: csDate = cs; break; case HEADERATOM: csHeader = cs; break; case FOOTERATOM: csFooter = cs; break; default: logger.log(POILogger.WARN, "Unexpected CString.Options in HeadersFootersContainer: " + opts); break; } } else { logger.log(POILogger.WARN, "Unexpected record in HeadersFootersContainer: " + _children[i]); } } }
/** * Insert a {@link CString} record that stores the user's date. * * @return the created {@link CString} record that stores the user's date. */ public CString addHeaderAtom(){ if(csHeader != null) return csHeader; csHeader = new CString(); csHeader.setOptions(HEADERATOM << 4); Record r = hdAtom; if(csDate != null) r = hdAtom; addChildAfter(csHeader, r); return csHeader; }
/** * Gets a string representation of this object, primarily for debugging. * @return a string representation of this object. */ public String toString() { return getText(); } }
/** * Sets the URL of the link * TODO: Figure out if we should always set both */ public void setLinkURL(String url) { if(linkDetailsB != null) { linkDetailsB.setText(url); } }
protected HeadersFootersContainer(byte[] source, int start, int len) { // Grab the header _header = new byte[8]; System.arraycopy(source,start,_header,0,8); _children = Record.findChildRecords(source,start+8,len-8); for(int i=0; i < _children.length; i++){ if(_children[i] instanceof HeadersFootersAtom) hdAtom = (HeadersFootersAtom)_children[i]; else if(_children[i] instanceof CString) { CString cs = (CString)_children[i]; int opts = cs.getOptions() >> 4; switch(opts){ case USERDATEATOM: csDate = cs; break; case HEADERATOM: csHeader = cs; break; case FOOTERATOM: csFooter = cs; break; default: logger.log(POILogger.WARN, "Unexpected CString.Options in HeadersFootersContainer: " + opts); break; } } else { logger.log(POILogger.WARN, "Unexpected record in HeadersFootersContainer: " + _children[i]); } } }
/** * Insert a {@link CString} record that stores the user's date. * * @return the created {@link CString} record that stores the user's date. */ public CString addHeaderAtom(){ if(csHeader != null) return csHeader; csHeader = new CString(); csHeader.setOptions(HEADERATOM << 4); Record r = hdAtom; if(csDate != null) r = hdAtom; addChildAfter(csHeader, r); return csHeader; }
/** * Gets a string representation of this object, primarily for debugging. * @return a string representation of this object. */ public String toString() { return getText(); } }
public void setLinkTitle(String title) { if(linkDetailsA != null) { linkDetailsA.setText(title); } }
/** * Go through our child records, picking out the ones that are * interesting, and saving those for use by the easy helper methods. */ private void findInterestingChildren() { // First child should be the ExHyperlinkAtom if(_children[0] instanceof ExEmbedAtom) { embedAtom = (ExEmbedAtom)_children[0]; } else { logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type " + _children[0].getRecordType()); } // Second child should be the ExOleObjAtom if (_children[1] instanceof ExOleObjAtom) { oleObjAtom = (ExOleObjAtom)_children[1]; } else { logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type " + _children[1].getRecordType()); } for (int i = 2; i < _children.length; i++) { if (_children[i] instanceof CString){ CString cs = (CString)_children[i]; int opts = cs.getOptions() >> 4; switch(opts){ case 0x1: menuName = cs; break; case 0x2: progId = cs; break; case 0x3: clipboardName = cs; break; } } } }