public Part (Line line, PositionRef position, int length) { this.position = position; this.line = line; this.length = length; previousOffset = position.getOffset(); }
/** Offset of the Line.Part*/ int getOffset() { return position.getOffset(); }
/** Offset of the Line.Part*/ int getOffset() { return position.getOffset(); }
public Part (Line line, PositionRef position, int length) { this.position = position; this.line = line; this.length = length; previousOffset = position.getOffset(); }
public Part(Line line, PositionRef position, int length) { this.position = position; this.line = line; previousOffset = position.getOffset(); this.length = limitLength(length); }
/** Finds the text contained in this range. * @return the text * @exception IOException if any I/O problem occurred during document loading (if that was necessary) * @exception BadLocationException if the positions are out of the bounds of the document */ public String getText() throws BadLocationException, IOException { StyledDocument doc = begin.getCloneableEditorSupport().openDocument(); int p1 = begin.getOffset(); int p2 = end.getOffset(); return doc.getText(p1, p2 - p1); }
/** Finds the text contained in this range. * @return the text * @exception IOException if any I/O problem occurred during document loading (if that was necessary) * @exception BadLocationException if the positions are out of the bounds of the document */ public String getText() throws BadLocationException, IOException { StyledDocument doc = begin.getCloneableEditorSupport().openDocument(); int p1 = begin.getOffset(); int p2 = end.getOffset(); return doc.getText(p1, p2 - p1); }
/** Finds the text contained in this range. * @return the text * @exception IOException if any I/O problem occurred during document loading (if that was necessary) * @exception BadLocationException if the positions are out of the bounds of the document */ public String getText() throws BadLocationException, IOException { StyledDocument doc = begin.getCloneableEditorSupport().openDocument(); int p1 = begin.getOffset(); int p2 = end.getOffset(); return doc.getText(p1, p2 - p1); }
void addChange(ModificationResult.Difference diff) { changes.add(new ChangeInfo( diff.getStartPosition().getOffset() - originalPosition, diff.getOldText() != null ? diff.getOldText().length() : 0, diff.getNewText())); }
public Lookup getLookup() { Object composite = ElementGripFactory.getDefault().get(parentFile, bounds.getBegin().getOffset()); if (composite == null) { composite = parentFile; } return Lookups.singleton(composite); }
public Lookup getLookup() { Object composite = ElementGripFactory.getDefault().get(parentFile, bounds.getBegin().getOffset()); if (composite==null) composite = parentFile; return Lookups.fixed(composite, diff); }
@Override public Lookup getLookup() { Object composite = null; if (bounds!=null) { composite = ElementGripFactory.getDefault().get(parentFile, bounds.getBegin().getOffset()); } if (composite==null) { composite = parentFile; } return Lookups.fixed(composite, diff); }
public Lookup getLookup() { Object composite = ElementGripFactory.getDefault().get(parentFile, bounds.getBegin().getOffset()); if (composite==null) composite = parentFile; return Lookups.fixed(composite, diff); }
@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; }