Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.NoteRecord


      } else {
        thisStr = '"' + sstRecord.getString(lsrec.getSSTIndex()).toString() + '"';
      }
      break;
    case NoteRecord.sid:
      NoteRecord nrec = (NoteRecord) record;

      thisRow = nrec.getRow();
      thisColumn = nrec.getColumn();
      // TODO: Find object to match nrec.getShapeId()
      thisStr = '"' + "(TODO)" + '"';
      break;
    case NumberRecord.sid:
      NumberRecord numrec = (NumberRecord) record;
View Full Code Here


                               new HashMap<Integer, TextObjectRecord>();
        int i = 0;
        for (Iterator<RecordBase> it = sheet.getRecords().iterator(); it.hasNext();) {
            RecordBase rec = it.next();
            if (rec instanceof NoteRecord) {
                NoteRecord note = (NoteRecord) rec;
                if (note.getRow() == row && note.getColumn() == column) {
                    if(i < noteTxo.size()) {
                        TextObjectRecord txo = noteTxo.get(note.getShapeId());
                        if(txo != null){
                            comment = new HSSFComment(note, txo);
                            comment.setRow(note.getRow());
                            comment.setColumn(note.getColumn());
                            comment.setAuthor(note.getAuthor());
                            comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                            comment.setString(txo.getStr());    
                        } else{
                            log.log(POILogger.WARN, "Failed to match NoteRecord and TextObjectRecord, row: " + row + ", column: " + column);
                         }
                    } else {
View Full Code Here

            //  destination row. Note that comments can
            //  exist for cells which are null
            if(moveComments) {
                // This code would get simpler if NoteRecords could be organised by HSSFRow.
                for(int i=noteRecs.length-1; i>=0; i--) {
                    NoteRecord nr = noteRecs[i];
                    if (nr.getRow() != rowNum) {
                        continue;
                    }
                    HSSFComment comment = getCellComment(rowNum, nr.getColumn());
                    if (comment != null) {
                       comment.setRow(rowNum + n);
                    }
                }
            }
View Full Code Here

      } else {
        thisStr = '"' + sstRecord.getString(lsrec.getSSTIndex()).toString() + '"';
      }
      break;
    case NoteRecord.sid:
      NoteRecord nrec = (NoteRecord) record;

      thisRow = nrec.getRow();
      thisColumn = nrec.getColumn();
      // TODO: Find object to match nrec.getShapeId()
      thisStr = '"' + "(TODO)" + '"';
      break;
    case NumberRecord.sid:
      NumberRecord numrec = (NumberRecord) record;
View Full Code Here

        obj.addSubRecord(e);
        return obj;
    }

    private NoteRecord createNoteRecord(){
        NoteRecord note = new NoteRecord();
        note.setFlags(NoteRecord.NOTE_HIDDEN);
        note.setAuthor("");
        return note;
    }
View Full Code Here

        TextObjectRecord txo = (TextObjectRecord) getTextObjectRecord().cloneViaReserialise();
        EscherContainerRecord spContainer = new EscherContainerRecord();
        byte [] inSp = getEscherContainer().serialize();
        spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
        ObjRecord obj = (ObjRecord) getObjRecord().cloneViaReserialise();
        NoteRecord note = (NoteRecord) getNoteRecord().cloneViaReserialise();
        return new HSSFComment(spContainer, obj, txo, note);
    }
View Full Code Here

        HSSFComment comment = null;
        HashMap txshapes = new HashMap(); //map shapeId and TextObjectRecord
        for (Iterator it = sheet.getRecords().iterator(); it.hasNext(); ) {
           RecordBase rec = (RecordBase) it.next();
           if (rec instanceof NoteRecord){
               NoteRecord note = (NoteRecord)rec;
               if (note.getRow() == row && note.getColumn() == column){
                   TextObjectRecord txo = (TextObjectRecord)txshapes.get(new Integer(note.getShapeId()));
                   comment = new HSSFComment(note, txo);
                   comment.setRow(note.getRow());
                   comment.setColumn(note.getColumn());
                   comment.setAuthor(note.getAuthor());
                   comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                   comment.setString(txo.getStr());
                   break;
               }
           } else if (rec instanceof ObjRecord){
               ObjRecord obj = (ObjRecord)rec;
View Full Code Here

      } else {
        thisStr = '"' + sstRecord.getString(lsrec.getSSTIndex()).toString() + '"';
      }
      break;
    case NoteRecord.sid:
      NoteRecord nrec = (NoteRecord) record;

      thisRow = nrec.getRow();
      thisColumn = nrec.getColumn();
      // TODO: Find object to match nrec.getShapeId()
      thisStr = '"' + "(TODO)" + '"';
      break;
    case NumberRecord.sid:
      NumberRecord numrec = (NumberRecord) record;
View Full Code Here

        thisStr = thisStr.replace(""+quoteChar, ""+quoteChar+""+quoteChar);
        thisStr = quoteChar + thisStr + quoteChar;       
      }
      break;
    case NoteRecord.sid:
      NoteRecord nrec = (NoteRecord) record;

      thisRow = nrec.getRow();
      thisColumn = nrec.getColumn();
      // TODO: Find object to match nrec.getShapeId()
      thisStr = quoteChar + "(TODO)" + quoteChar;
      break;
    case NumberRecord.sid:
      NumberRecord numrec = (NumberRecord) record;
View Full Code Here

        HSSFComment comment = null;
        HashMap txshapes = new HashMap(); //map shapeId and TextObjectRecord
        for (Iterator it = sheet.getRecords().iterator(); it.hasNext(); ) {
           Record rec = ( Record ) it.next();
           if (rec instanceof NoteRecord){
               NoteRecord note = (NoteRecord)rec;
               if (note.getRow() == row && note.getColumn() == column){
                   TextObjectRecord txo = (TextObjectRecord)txshapes.get(new Integer(note.getShapeId()));
                   comment = new HSSFComment(note, txo);
                   comment.setRow(note.getRow());
                   comment.setColumn(note.getColumn());
                   comment.setAuthor(note.getAuthor());
                   comment.setVisible(note.getFlags() == NoteRecord.NOTE_VISIBLE);
                   comment.setString(txo.getStr());
                   break;
               }
           } else if (rec instanceof ObjRecord){
               ObjRecord obj = (ObjRecord)rec;
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.NoteRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.