Examples of RtfDestination


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

    this.docGroupLevel++;  // current group level in document
    if (this.getTokeniserState() == TOKENISER_SKIP_GROUP) {
      this.groupSkippedCount++;
    }
 
    RtfDestination dest = this.getCurrentDestination();
    boolean handled = false;
   
    if(dest != null) {
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: before dest.handleOpeningSubGroup()");
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + dest.toString());
      }
      handled = dest.handleOpeningSubGroup();
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: after dest.handleOpeningSubGroup()");
      }
    }

    this.stackState.push(this.currentState);
    this.currentState = new RtfParserState(this.currentState);
    // do not set this true until after the state is pushed
    // otherwise it inserts a { where one does not belong.
    this.currentState.newGroup = true;
    dest = this.getCurrentDestination();
   
    if(debugParser) {
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: handleOpenGroup()");
      if(this.lastCtrlWordParam != null)
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: LastCtrlWord=" + this.lastCtrlWordParam.ctrlWord);
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: grouplevel=" + Integer.toString(groupLevel));
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + dest.toString());
    }

    if(dest != null) {
      handled = dest.handleOpenGroup();
    }
   
    if(debugParser) {
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: after dest.handleOpenGroup(); handled=" + Boolean.toString(handled));
    }
View Full Code Here

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

          RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: LastCtrlWord=" + this.lastCtrlWordParam.ctrlWord);
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: grouplevel=" + Integer.toString(groupLevel));
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + this.getCurrentDestination().toString());
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "");
      }
      RtfDestination dest = this.getCurrentDestination();
      boolean handled = false;
     
      if(dest != null) {
        handled = dest.handleCloseGroup();
      }
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: After dest.handleCloseGroup(); handled = " + Boolean.toString(handled));
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "");
      }
View Full Code Here

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

      return errOK;
    }

    boolean handled = false;

    RtfDestination dest = this.getCurrentDestination();
    if(dest != null) {
      handled = dest.handleCharacter(nextChar);
    }

    return errOK;
  }
View Full Code Here

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

   * Set the current destination object for the current state.
   * @param destination The destination value to set.
   * @since 2.1.3
   */
  public boolean setCurrentDestination(String destination) {
      RtfDestination dest = RtfDestinationMgr.getDestination(destination);
      if(dest != null) {
        this.currentState.destination = dest;
        return false;
      } else {
        this.setTokeniserStateSkipGroup();
View Full Code Here

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

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

    this.docGroupLevel++;  // current group level in document
    if (this.getTokeniserState() == TOKENISER_SKIP_GROUP) {
      this.groupSkippedCount++;
    }
 
    RtfDestination dest = this.getCurrentDestination();
    boolean handled = false;
   
    if(dest != null) {
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: before dest.handleOpeningSubGroup()");
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + dest.toString());
      }
      handled = dest.handleOpeningSubGroup();
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: after dest.handleOpeningSubGroup()");
      }
    }

    this.stackState.push(this.currentState);
    this.currentState = new RtfParserState(this.currentState);
    // do not set this true until after the state is pushed
    // otherwise it inserts a { where one does not belong.
    this.currentState.newGroup = true;
    dest = this.getCurrentDestination();
   
    if(debugParser) {
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: handleOpenGroup()");
      if(this.lastCtrlWordParam != null)
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: LastCtrlWord=" + this.lastCtrlWordParam.ctrlWord);
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: grouplevel=" + Integer.toString(groupLevel));
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + dest.toString());
    }

    if(dest != null) {
      handled = dest.handleOpenGroup();
    }
   
    if(debugParser) {
      RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: after dest.handleOpenGroup(); handled=" + Boolean.toString(handled));
    }
View Full Code Here

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

          RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: LastCtrlWord=" + this.lastCtrlWordParam.ctrlWord);
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: grouplevel=" + Integer.toString(groupLevel));
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: destination=" + this.getCurrentDestination().toString());
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "");
      }
      RtfDestination dest = this.getCurrentDestination();
      boolean handled = false;
     
      if(dest != null) {
        handled = dest.handleCloseGroup();
      }
      if(debugParser) {
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "DEBUG: After dest.handleCloseGroup(); handled = " + Boolean.toString(handled));
        RtfParser.outputDebug(this.rtfDoc, groupLevel, "");
      }
View Full Code Here

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

      return errOK;
    }

    boolean handled = false;

    RtfDestination dest = this.getCurrentDestination();
    if(dest != null) {
      handled = dest.handleCharacter(nextChar);
    }

    return errOK;
  }
View Full Code Here

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

   * Set the current destination object for the current state.
   * @param destination The destination value to set.
   * @since 2.1.3
   */
  public boolean setCurrentDestination(String destination) {
      RtfDestination dest = RtfDestinationMgr.getDestination(destination);
      if(dest != null) {
        this.currentState.destination = dest;
        return false;
      } else {
        this.setTokeniserStateSkipGroup();
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.