java code viewer_Java CodeView类代码示例
import io.github.kbiakov.codeview.CodeView; //導(dǎo)入依賴的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);
}
}
}
總結(jié)
以上是生活随笔為你收集整理的java code viewer_Java CodeView类代码示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java boxplot_Matlab
- 下一篇: java美元兑换,(Java实现) 美元