Package net.java.textilej.parser

Examples of net.java.textilej.parser.ListAttributes


  }
 
  @Override
  public int processLineContent(String line,int offset) {
    if (blockLineCount == 0) {
      ListAttributes attributes = new ListAttributes();
      String spaces = matcher.group(1);
      String listSpec = matcher.group(2);
      String numericListSpec = matcher.group(3);
     
      if (numericListSpec != null && !"1".equals(numericListSpec)) {
        attributes.setStart(numericListSpec);
      }
     
      int level = calculateLevel(spaces);
     
      BlockType type = listSpec == null?BlockType.NUMERIC_LIST:BlockType.BULLETED_LIST;
     
      if (type == BlockType.BULLETED_LIST && "-".equals(listSpec)) {
        attributes.setCssStyle("list-style: square");
      }
     
      offset = matcher.start(LINE_REMAINDER_GROUP_OFFSET);
   
      listState.push(new ListState(level,spaces.length(),type));
      builder.beginBlock(type, attributes);
    } else {
      ListAttributes attributes = new ListAttributes();
      Matcher matcher = startPattern.matcher(line);
      if (!matcher.matches()) {
        setClosed(true);
        return 0;
      }
      String spaces = matcher.group(1);
      String listSpec = matcher.group(2);
      String numericListSpec = matcher.group(3);

      if (numericListSpec != null && !"1".equals(numericListSpec)) {
        attributes.setStart(numericListSpec);
      }
     
      int level = calculateLevel(spaces);
     
      BlockType type = listSpec == null?BlockType.NUMERIC_LIST:BlockType.BULLETED_LIST;
View Full Code Here



  private void applyListAttributes(Attributes attributes) {
    applyAttributes(attributes);
    if (attributes instanceof ListAttributes) {
      ListAttributes listAttributes = (ListAttributes) attributes;
      if (listAttributes.getStart() != null) {
        writer.writeAttribute("start", listAttributes.getStart());
      }
    }
  }
View Full Code Here

TOP

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

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.