当前位置: 首页>>代码示例>>Java>>正文


Java ExpImageNode类代码示例

本文整理汇总了Java中org.pegdown.ast.ExpImageNode的典型用法代码示例。如果您正苦于以下问题:Java ExpImageNode类的具体用法?Java ExpImageNode怎么用?Java ExpImageNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExpImageNode类属于org.pegdown.ast包,在下文中一共展示了ExpImageNode类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(final ExpImageNode ein) {
    // We always have a URL, relative or not

    final ArrayList<String> alt = new ArrayList<String>();
    boolean found = findByClass(ein, TextNode.class, new FindPredicate<TextNode>() {

        @Override
        public boolean f(TextNode node, Node parent, int index) {
            alt.add(node.getText());
            return true;
        }
    });

    if (!found) {
        throw new IllegalStateException("The alt name should be mandatory in Markdown for images: " + ein.url);
    }

    String titlePart = isNotBlank(ein.title) ? format("|title=\"%s\"", ein.title) : "";
    _buffer.append( format( "!%s|alt=\"%s\"%s!", ein.url, alt.get(0), titlePart));

}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:23,代码来源:ToConfluenceSerializer.java

示例2: BlockRule

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
Rule BlockRule() {
  StringBuilderVar style = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      Optional(
          String("style="),
          Sequence(OneOrMore(Letter()), style.append(match()), Spn1())),
      Sequence(Body(), body.append(match())),
      EndMarker(),
      push(
          new ExpImageNode("title",
              createWebsequenceUrl(style.getString(), body.getString()),
              new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:18,代码来源:PegdownWebSequencelPlugin.java

示例3: BlockRule

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
Rule BlockRule() {
  ParamVar<String, String> params = new ParamVar<String, String>();
  StringBuilderVar name = new StringBuilderVar();
  StringBuilderVar value = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      ZeroOrMore(
          Sequence(
              ParameterName(), name.append(match()),
              String("="),
              OneOrMore(Alphanumeric()), value.append(match())),
          Sp(),
          params.put(name.getString(), value.getString()),
          name.clear(), value.clear()),
      Body(),
      body.append(match()),
      EndMarker(),
      push(
          new ExpImageNode(
              "title", createYumlUrl(params.get(), body.getString()), new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:25,代码来源:PegdownYumlPlugin.java

示例4: process

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
    RefImageNode refImage = (RefImageNode) node;

    @SuppressWarnings("unchecked")
    TextNode text = (TextNode) lookupChild(refImage.referenceKey, TextNode.class);

    if (text == null) {
        log.warn("Unknown reference image structure... {}", refImage);
        context.processChildren(level, node);
        return;
    }

    References.Ref ref = context.references().lookup(text.getText());
    if (ref != null) {
        Node altNode = refImage.getChildren().get(0);
        context.process(level, new ExpImageNode(ref.title(), ref.url(), altNode));
        return;
    }

    log.warn("Reference not found for image {}", text.getText());
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:23,代码来源:RefImageNodeProcessor.java

示例5: render

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override public AndroidXMLNode render() {
  ExpImageNode imageNode = (ExpImageNode)rootNode.getChildren().get(0);

  String imageFilenameWithoutExtension = imageNode.url.substring(0,
      imageNode.url.lastIndexOf('.'));

  String drawableSrc;

  if (namespace != null) {
    drawableSrc = String.format("@drawable/%s_%s", namespace, imageFilenameWithoutExtension);
  } else {
    drawableSrc = String.format("@drawable/%s", imageFilenameWithoutExtension);
  }

  Map<String, String> attributes = AndroidXMLConstants.getDefaultLayoutSizes();
  attributes.put(AndroidXMLConstants.ADJUST_VIEW_BOUNDS, AndroidXMLConstants.TRUE);
  attributes.put(AndroidXMLConstants.SOURCE, drawableSrc);
  attributes.put(AndroidXMLConstants.STYLE, "@style/markdroid_image");

  AndroidXMLNode imageViewNode = new AndroidXMLNode(AndroidXMLConstants.IMAGE_VIEW, attributes);
  return imageViewNode;
}
 
开发者ID:mindsnacks,项目名称:penmanship,代码行数:23,代码来源:ImageGroupHandler.java

示例6: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
public void visit(final ExpImageNode node) {
}
 
开发者ID:miurahr,项目名称:omegat-markdown-plugin,代码行数:3,代码来源:AbstractMarkdownSerializer.java

示例7: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(ExpImageNode arg0) {
        // TODO Auto-generated method stub

}
 
开发者ID:daisy,项目名称:pipeline-gui,代码行数:6,代码来源:MarkdownToJavafx.java

示例8: render

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
  public Rendering render (final ExpImageNode node, final String text) {
return modifyRendering (super.render (node, text));
  }
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:5,代码来源:Docs.java

示例9: isValidImageNode

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
private static boolean isValidImageNode(Node node) {
  return node.getClass().equals(ExpImageNode.class);
}
 
开发者ID:mindsnacks,项目名称:penmanship,代码行数:4,代码来源:ImageGroupHandler.java

示例10: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override public void visit(ExpImageNode node) {
  //To change body of implemented methods use File | Settings | File Templates.
}
 
开发者ID:mindsnacks,项目名称:penmanship,代码行数:4,代码来源:BaseVisitor.java

示例11: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(ExpImageNode node) {

}
 
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:DocTestingVisitor.java

示例12: visit

import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(@NotNull ExpImageNode node) {

}
 
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:CodeExtractionVisitor.java


注:本文中的org.pegdown.ast.ExpImageNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。