Package net.java.textilej.parser

Examples of net.java.textilej.parser.Attributes


 
  @Override
  public int processLineContent(String line,int offset) {
    if (blockLineCount == 0) {
      listState = new Stack<ListState>();
      Attributes attributes = new Attributes();
      String listSpec = matcher.group(1);
      int level = calculateLevel(listSpec);
      BlockType type = calculateType(listSpec);
     
      // 0-offset matches may start with the "*** " prefix.
      Textile.configureAttributes(attributes,matcher, 2,true);
      offset = matcher.start(LINE_REMAINDER_GROUP_OFFSET);
     
      listState.push(new ListState(1,type));
      builder.beginBlock(type, attributes);
     
      adjustLevel(matcher, level, type);
    } else {
      Matcher matcher = startPattern.matcher(line);
      if (!matcher.matches()) {
        setClosed(true);
        return 0;
      }
      String listSpec = matcher.group(1);
      int level = calculateLevel(listSpec);
      BlockType type = calculateType(listSpec);
      offset = matcher.start(LINE_REMAINDER_GROUP_OFFSET);
     
      adjustLevel(matcher, level, type);
    }
    ++blockLineCount;
   
    ListState listState = this.listState.peek();
    if (listState.openItem) {
      builder.endBlock();
    }
    listState.openItem = true;
    builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
   
    dialect.emitMarkupLine(getParser(),state,line, offset);
   
    return -1;
  }
View Full Code Here


      level != previousState.level || previousState.type != type;
      previousState = listState.peek()) {
     
      if (level > previousState.level) {
        if (!previousState.openItem) {
          builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
          previousState.openItem = true;
        }

        Attributes blockAttributes = new Attributes();
        if (previousState.level+1 == level) {
          Textile.configureAttributes(blockAttributes,matcher, 2,true);
        }
       
        listState.push(new ListState(previousState.level+1,type));
        builder.beginBlock(type,blockAttributes);
      } else {
        closeOne();
        if (listState.isEmpty()) {
          Attributes blockAttributes = new Attributes();
          Textile.configureAttributes(blockAttributes,matcher, 2,true);

          listState.push(new ListState(1,type));
          builder.beginBlock(type, blockAttributes);
        }
View Full Code Here

      return;
    }
    if ((item.getLevel()+1) > maxLevel) {
      return;
    }
    Attributes nullAttributes = new Attributes();
   
    builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes(null,null,"list-style: "+style+";",null));
    for (OutlineItem child: item.getChildren()) {
      builder.beginBlock(BlockType.LIST_ITEM, nullAttributes);
      builder.link('#'+child.getId(), child.getLabel());
      emitToc(child);
      builder.endBlock();
View Full Code Here

  }

  @Override
  public int processLineContent(String line,int offset) {
    if (blockLineCount == 0) {
      Attributes attributes = new Attributes();
      if (offset == 0) {
        // 0-offset matches may start with the "p. " prefix.
        Matcher matcher = startPattern.matcher(line);
        if (matcher.matches()) {
          Textile.configureAttributes(attributes,matcher, 1,true);
View Full Code Here

     * @see net.java.textilej.parser.markup.Block#processLineContent(java.lang.String, int)
     */
    @Override
    public int processLineContent(String line, int offset) {
        if (blockLineCount == 0) {
            Attributes attributes = new Attributes();

            builder.beginBlock(BlockType.PARAGRAPH, attributes);
        }

        if (dialect.isEmptyLine(line)) {
View Full Code Here


    @Override
    public int processLineContent(String line, int offset) {
        if (blockLineCount == 0) {
            Attributes attributes = new Attributes();

            builder.beginBlock(BlockType.PARAGRAPH, attributes);
        }

        if (dialect.isEmptyLine(line)) {
View Full Code Here

TOP

Related Classes of net.java.textilej.parser.Attributes

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.