/** Create a position reference for the given offset. * The position moves as the document is modified and * reacts to closing and opening of the document. * * @param offset the offset to create position at * @param bias the Position.Bias for new creating position. * @return position reference for that offset */ public final PositionRef createPositionRef(int offset, Position.Bias bias) { return new PositionRef(getPositionManager(), offset, bias); }
/** Create a position reference for the given offset. * The position moves as the document is modified and * reacts to closing and opening of the document. * * @param offset the offset to create position at * @param bias the Position.Bias for new creating position. * @return position reference for that offset */ public final PositionRef createPositionRef (int offset, Position.Bias bias) { return new PositionRef (getPositionManager (), offset, bias); }
/** Create a position reference for the given offset. * The position moves as the document is modified and * reacts to closing and opening of the document. * * @param offset the offset to create position at * @param bias the Position.Bias for new creating position. * @return position reference for that offset */ public final PositionRef createPositionRef (int offset, Position.Bias bias) { return new PositionRef (getPositionManager (), offset, bias); }
@Override public Line.Part createPart(int column, int length) { DocumentLine.Part part = new DocumentLine.Part( this, new PositionRef( pos.getCloneableEditorSupport().getPositionManager(), pos.getOffset() + column, Position.Bias.Forward ), length ); addLinePart(part); return part; }
/** This method will be used for annotation of part of the text on the line.*/ public Line.Part createPart( int column, int length ) { DocumentLine.Part part = new DocumentLine.Part(this, new PositionRef( pos.getCloneableEditorSupport().getPositionManager (), pos.getOffset() + column, Position.Bias.Forward), length); addLinePart(part); return part; }
/** This method will be used for annotation of part of the text on the line.*/ public Line.Part createPart( int column, int length ) { DocumentLine.Part part = new DocumentLine.Part(this, new PositionRef( pos.getCloneableEditorSupport().getPositionManager (), pos.getOffset() + column, Position.Bias.Forward), length); addLinePart(part); return part; }
/** Creates a Line for given offset. * @param offset the begining of line * @return line that should represent the given line */ public Line createLine(int offset) { PositionRef ref = new PositionRef(support.getPositionManager(), offset, Position.Bias.Forward); return new SupportLine(support.getLookup(), ref, support); }
/** Find line object in the line set corresponding to current line number. * * @param line number of the line * @return line object * @exception IndexOutOfBoundsException if <code>line</code> is an invalid index for the original set of lines */ public Line getCurrent(int line) throws IndexOutOfBoundsException { PositionRef ref = new PositionRef(support.getPositionManager(), line, 0, Position.Bias.Forward); // obj can be null, sorry... org.openide.util.Lookup obj = support.getLookup(); return this.registerLine(new SupportLine(obj, ref, support)); }
/** Find line object in the line set corresponding to current line number. * * @param line number of the line * @return line object * @exception IndexOutOfBoundsException if <code>line</code> is an invalid index for the original set of lines */ public Line getCurrent (int line) throws IndexOutOfBoundsException { PositionRef ref = new PositionRef (support.getPositionManager (), line, 0, Position.Bias.Forward); // obj can be null, sorry... org.openide.util.Lookup obj = support.getLookup (); return this.registerLine(new SupportLine(obj, ref, support)); }
/** Find line object in the line set corresponding to current line number. * * @param line number of the line * @return line object * @exception IndexOutOfBoundsException if <code>line</code> is an invalid index for the original set of lines */ public Line getCurrent (int line) throws IndexOutOfBoundsException { PositionRef ref = new PositionRef (support.getPositionManager (), line, 0, Position.Bias.Forward); // obj can be null, sorry... org.openide.util.Lookup obj = support.getLookup (); return this.registerLine(new SupportLine(obj, ref, support)); }
/** Creates a Line for given offset. * @param offset the begining of line * @return line that should represent the given line */ public Line createLine (int offset) { StyledDocument doc = support.getDocument(); if (doc == null) // do nothing - document was probably closed return null; PositionRef ref = new PositionRef( support.getPositionManager (), offset, Position.Bias.Forward ); return new SupportLine (support.getLookup (), ref, support); }
/** Creates a Line for given offset. * @param offset the begining of line * @return line that should represent the given line */ public Line createLine (int offset) { StyledDocument doc = support.getDocument(); if (doc == null) // do nothing - document was probably closed return null; PositionRef ref = new PositionRef( support.getPositionManager (), offset, Position.Bias.Forward ); return new SupportLine (support.getLookup (), ref, support); }
pos = new PositionRef(support.getPositionManager(), lineStartOffset, Position.Bias.Forward);
CloneableEditorSupport support = pos.getCloneableEditorSupport(); pos = new PositionRef( support.getPositionManager(), lineStartOffset, Position.Bias.Forward );
CloneableEditorSupport support = pos.getCloneableEditorSupport(); pos = new PositionRef( support.getPositionManager(), lineStartOffset, Position.Bias.Forward );