Examples of RtfDestination


Examples of com.lowagie.text.rtf.parser.destinations.RtfDestination

//          if(groupLevel < 1 && this.isImportFragment()) return; //return errOK;
//          if(groupLevel < 0 && this.isImportFull()) return; //return errStackUnderflow;
//          if(groupLevel < 0 && this.isConvert()) return; //return errStackUnderflow;
         
    }// end while(reader.read(nextChar) != -1)
    RtfDestination dest = this.getCurrentDestination();
    if(dest != null) {
      dest.closeDestination();
    }
  }
View Full Code Here

Examples of com.lowagie.text.rtf.parser.destinations.RtfDestination

   * @since 2.0.8
   */
  public final boolean handleControlword(RtfCtrlWordData ctrlWordDataIn){
    boolean result = false;
    this.ctrlWordData = ctrlWordDataIn;
    RtfDestination dest = null;
    boolean handled = false;
   
    this.ctrlWordData.prefix  = this.ctrlWordPrefix;
    this.ctrlWordData.suffix  = this.ctrlWordSuffix;
    this.ctrlWordData.newGroup = this.rtfParser.getState().newGroup;
    this.ctrlWordData.ctrlWordType = this.ctrlWordType;
    this.ctrlWordData.specialHandler = this.specialHandler;
   
    if(!this.ctrlWordData.hasParam && this.passDefaultParameterValue) {
      this.ctrlWordData.hasParam = true;
      this.ctrlWordData.param = Integer.toString(this.defaultParameterValue);
    }

    if(debug) {
      printDebug("handleKeyword: [" + this.ctrlWordData.ctrlWord + "] param=" + ctrlWordDataIn.param);
      RtfParser.outputDebug(this.rtfParser.getRtfDocument(), this.rtfParser.getLevel()+1, "RtfCtrlWordHandler debug Start: " + this.ctrlWordData.ctrlWord + " ");
    }
    if(this.ctrlWordData.ctrlWord.equals("*")) {
      return true;
    }
   
    if(!beforeControlWord()) {
      return true;
    }
   
    switch(this.ctrlWordType) {
    case RtfCtrlWordType.FLAG:
    case RtfCtrlWordType.TOGGLE:
    case RtfCtrlWordType.VALUE:
      dest = this.rtfParser.getCurrentDestination();
      if(dest != null) {
        handled = dest.handleControlWord(this.ctrlWordData);
      }
      break;
   
    case RtfCtrlWordType.SYMBOL:
      dest = this.rtfParser.getCurrentDestination();
      if(dest != null) {
        String data = null;
        // if doing an import, then put the control word in the output stream through the character handler
        if(this.rtfParser.isImport()) {
          data = this.ctrlWordPrefix + this.ctrlWordData.ctrlWord + this.ctrlWordSuffix;
        }
        if(this.rtfParser.isConvert()) {
          data = this.specialHandler;
        }
       
        // If there is a substitute character, process the character.
        // If no substitute character, then provide special handling in the destination for the ctrl word.
        if(data != null) {
          for(int idx=0; idx< data.length(); idx++) {
            handled = dest.handleCharacter(data.charAt(idx));
          }
        } else {
          handled = dest.handleControlWord(this.ctrlWordData);
        }
      }
      break;

    case RtfCtrlWordType.DESTINATION_EX:
    case RtfCtrlWordType.DESTINATION:
      // set the destination
      int x=0;
      if("shppict".equals(this.ctrlWord) || "nonshppict".equals(this.ctrlWord)) {
        x++;
      }
      handled = this.rtfParser.setCurrentDestination(this.ctrlWord);
      // let destination handle the ctrl word now.
      dest = this.rtfParser.getCurrentDestination();
      if(dest != null) {
        if(dest.getNewTokeniserState() == RtfParser.TOKENISER_IGNORE_RESULT) {
          handled = dest.handleControlWord(this.ctrlWordData);
        }
        else {
          this.rtfParser.setTokeniserState(dest.getNewTokeniserState());
        }
      }

      break;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.