Package org.eclipse.pde.internal.ui.wizards.templates

Examples of org.eclipse.pde.internal.ui.wizards.templates.ControlStack


    int readCharacterCount = 0;
    StringBuffer keyStringBuffer = new StringBuffer();
    StringBuffer outStringBuffer = new StringBuffer();
    StringBuffer preStringBuffer = new StringBuffer();
    boolean isOnNewLine = true;
    ControlStack preControlStack = new ControlStack();
    preControlStack.setValueProvider(this);

    boolean shouldReplace = false;
    boolean shouldPreProcess = false;
    boolean foundEscapeCharacter = false;
    while (readCharacterCount != -1) {
      readCharacterCount = inputStreamReader.read(characterBuffer);
     
      for (int ii = 0; ii < readCharacterCount; ii++) {
        char currentCharacter = characterBuffer[ii];

        if (foundEscapeCharacter) {
          StringBuffer stringBuffer;
         
          if (shouldPreProcess) {
            stringBuffer = preStringBuffer;
          } else {
            stringBuffer = outStringBuffer;
          }
         
          stringBuffer.append(currentCharacter);
          foundEscapeCharacter = false;
         
          continue;
        }

        if (isOnNewLine && currentCharacter == '%') {
          // PreProcessor line.
          shouldPreProcess = true;
          preStringBuffer.delete(0, preStringBuffer.length());
         
          continue;
        }
       
        if (shouldPreProcess) {
          if (currentCharacter == '\\') {
            foundEscapeCharacter = true;
           
            continue;
          }
         
          if (currentCharacter == '\n') {
            // Handle line.
            shouldPreProcess = false;
            isOnNewLine = true;
            String line = preStringBuffer.toString().trim();
            preControlStack.processLine(line);
           
            continue;
          }
         
          preStringBuffer.append(currentCharacter);

          continue;
        }

        if (preControlStack.getCurrentState() == false) {
          continue;
        }

        if (currentCharacter == '$') {
          if (shouldReplace) {
View Full Code Here

TOP

Related Classes of org.eclipse.pde.internal.ui.wizards.templates.ControlStack

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.