public CharSequence subSequence(final int start, final int end) { // First we will try to avoid computing the complete String if (start >= this.prefix.length() && end < (this.prefix.length() + getContentLength())) { return contentSubSequence((start - this.prefix.length()), (end - this.prefix.length())); } return getComment().subSequence(start, end); }
@Override public void handleComment(final IComment comment) { this.events.add(Comment.asEngineComment(comment)); // The engine event we might have created is not forwarded - this makes cache creating transparent to the handler chain super.handleComment(comment); }
public char charAt(final int index) { if (index < this.prefix.length()) { return this.prefix.charAt(index); } final int prefixedContentLen = this.prefix.length() + getContentLength(); if (index >= prefixedContentLen) { return this.suffix.charAt(index - prefixedContentLen); } return charAtContent(index - this.prefix.length()); }
@Override public String toString() { return getComment(); }
Comment comment = Comment.asEngineComment(icomment); comment = new Comment(comment.prefix, structureHandler.setContentValue, comment.suffix);
public IComment createComment(final CharSequence content) { checkRestrictedEventForTextTemplateMode("Comment"); return new Comment(content); }
public String getComment() { String c = this.computedCommentStr; if (c == null) { this.computedCommentStr = c = this.prefix + getContentText() + this.suffix; } return c; }
public void write(final Writer writer) throws IOException { writer.write(this.prefix); writeContent(writer); writer.write(this.suffix); }
public int length() { return this.prefix.length() + getContentLength() + this.suffix.length(); }
public static boolean isInlineable(final IComment comment) { if (comment == null) { return false; } if (comment instanceof Comment) { return ((Comment) comment).isInlineable(); } return computeInlineable(comment.getContent()); }
public static boolean isWhitespace(final IComment comment) { if (comment == null) { return false; } if (comment instanceof Comment) { return ((Comment) comment).isWhitespace(); } return computeWhitespace(comment.getContent()); }
holder.txtComment.setText(cmt.getComment()); holder.btnDelete.setClickable(true); holder.btnDelete.setImageResource(android.R.drawable.ic_delete);
@Override public void handleComment( final char[] buffer, final int contentOffset, final int contentLen, final int outerOffset, final int outerLen, final int line, final int col) throws ParseException { final String prefix = new String(buffer, outerOffset, (contentOffset - outerOffset)); final String content = new String(buffer, contentOffset, contentLen); final String suffix = new String(buffer, contentOffset + contentLen, (outerOffset + outerLen) - (contentOffset + contentLen)); this.templateHandler.handleComment( new Comment(prefix, content, suffix, this.templateName, this.lineOffset + line, (line == 1? this.colOffset : 0) + col)); }
public String getContent() { return getContentText(); }
static Comment asEngineComment(final IComment comment) { if (comment instanceof Comment) { return (Comment) comment; } return new Comment(comment.getContent(), comment.getTemplateName(), comment.getLine(), comment.getCol()); }
return Comment.asEngineComment((IComment) event);