本文整理汇总了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));
}
示例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("")))
);
}
示例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("")))
);
}
示例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());
}
示例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;
}
示例6: visit
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
public void visit(final ExpImageNode node) {
}
示例7: visit
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(ExpImageNode arg0) {
// TODO Auto-generated method stub
}
示例8: render
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public Rendering render (final ExpImageNode node, final String text) {
return modifyRendering (super.render (node, text));
}
示例9: isValidImageNode
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
private static boolean isValidImageNode(Node node) {
return node.getClass().equals(ExpImageNode.class);
}
示例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.
}
示例11: visit
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(ExpImageNode node) {
}
示例12: visit
import org.pegdown.ast.ExpImageNode; //导入依赖的package包/类
@Override
public void visit(@NotNull ExpImageNode node) {
}