欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > java >内容正文

java

java code viewer_Java CodeView类代码示例

发布时间:2024/7/19 java 29 豆豆
生活随笔 收集整理的这篇文章主要介绍了 java code viewer_Java CodeView类代码示例 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

import io.github.kbiakov.codeview.CodeView; //导入依赖的package包/类

public void setToken(List tokens, List attachmentList) {

removeAllViews();

mAttachmentList = attachmentList;

mTokenList = tokens;

for (TOKEN token : tokens) {

if (token instanceof ATTACHMENT) {

mAttachmentList.remove(((ATTACHMENT) token).attachment);

}

}

resetTokenIndex();

List result = until(END.class);

if (mShowRemainingAtt) {

// remaining attachments will show at the bottom of view

for (Attachment att : mAttachmentList) {

append(result, attachment(att));

}

}

if (result == null) {

return;

}

for (final Object o : result) {

if (o instanceof TextWithFormula) {

final TextWithFormula textWithFormula = (TextWithFormula) o;

final LaTeXtView textView = new LaTeXtView(mContext);

textView.setTextWithFormula(textWithFormula);

textView.setMovementMethod(LinkMovementMethod.getInstance());

myAddView(textView);

} else if (o instanceof CodeView) {

myAddView((CodeView) o);

} else if (o instanceof ImageView) {

myAddView((ImageView) o);

} else if (o instanceof HorizontalScrollView) {

myAddView((HorizontalScrollView) o);

} else if (o instanceof QuoteView) {

myAddView((QuoteView) o);

}

}

}

总结

以上是生活随笔为你收集整理的java code viewer_Java CodeView类代码示例的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。