public int adjustStartPos(BaseDocument doc, int startPos) { origStartPos = startPos; try { return Utilities.getRowEnd(doc, startPos); } catch (BadLocationException e) { return startPos; } }
public int adjustLimitPos(BaseDocument doc, int limitPos) { origLimitPos = limitPos; try { return Utilities.getRowEnd(doc, limitPos); } catch (BadLocationException e) { return limitPos; } }
public int adjustStartPos(BaseDocument doc, int startPos) { origStartPos = startPos; try { return Utilities.getRowEnd(doc, startPos); } catch (BadLocationException e) { return startPos; } }
/** Creates a new instance of InlineIncludeHint */ public InlineIncludeHint(BaseDocument doc, int start, String fileName) { this.doc = doc; this.start = start; try { this.end = Utilities.getRowEnd(doc, start); } catch (BadLocationException ble) { this.end = start; } this.fileName = fileName; }
public int adjustLimitPos(BaseDocument doc, int limitPos) { origLimitPos = limitPos; try { return Utilities.getRowEnd(doc, limitPos); } catch (BadLocationException e) { return limitPos; } }
public int adjustLimitPos(BaseDocument doc, int limitPos) { origLimitPos = limitPos; try { return Utilities.getRowEnd(doc, limitPos); } catch (BadLocationException e) { return limitPos; } }
private int getLineEnd(PHPDocNode paramVariable) { int result = paramVariable.getEndOffset(); try { result = Utilities.getRowEnd(doc, paramVariable.getStartOffset()); } catch (BadLocationException ex) { LOGGER.log(Level.FINE, null, ex); } return result; }
private static int getOffset(BaseDocument baseDocument, NamespaceScope namespaceScope) { try { return Utilities.getRowEnd(baseDocument, getReferenceElement(namespaceScope).getOffset()); } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } return 0; }
private int getOffset() { try { return Utilities.getRowEnd(doc, getReferenceElement().getOffset()); } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } return 0; }
/** Reformat the line around the given position. */ public static void reformatLine(BaseDocument doc, int pos) throws BadLocationException { int lineStart = getRowStart(doc, pos); int lineEnd = getRowEnd(doc, pos); reformat(doc, lineStart, lineEnd); }
protected int removeLine(final Document doc, final int line) throws BadLocationException { final int i = Utilities.getRowStartFromLineOffset((BaseDocument)doc, line - 1); doc.remove(i, Utilities.getRowEnd((BaseDocument)doc, i) - i); return i; }
/** Reformat the line around the given position. */ public static void reformatLine(BaseDocument doc, int pos) throws BadLocationException { int lineStart = getRowStart(doc, pos); int lineEnd = getRowEnd(doc, pos); reformat(doc, lineStart, lineEnd); }
public static String getLine(final JTextComponent component, final int offset) { final BaseDocument workingDocument=org.netbeans.editor.Utilities.getDocument(component); try { final int lineStartOffset = org.netbeans.editor.Utilities.getRowStart(workingDocument, offset); final int lineEndOffset = org.netbeans.editor.Utilities.getRowEnd(workingDocument, offset); return String.valueOf(workingDocument.getChars(lineStartOffset, lineEndOffset - lineStartOffset)); } catch (BadLocationException ble) { return ""; } } }
@Override public void implement() throws Exception { int templateOffset = getOffset(); EditList edits = new EditList(doc); edits.replace(templateOffset, 0, "\n" + item.getCustomInsertTemplate(), true, 0); //NOI18N edits.apply(); templateOffset = Utilities.getRowEnd(doc, templateOffset + 1); UiUtils.open(type.getFileObject(), Utilities.getRowEnd(doc, templateOffset + 1) - 1); }
@Override public void implement() throws Exception { int templateOffset = getOffset(); EditList edits = new EditList(doc); edits.replace(templateOffset, 0, "\n" + item.getCustomInsertTemplate(), true, 0); //NOI18N edits.apply(); templateOffset = Utilities.getRowEnd(doc, templateOffset + 1); UiUtils.open(type.getFileObject(), Utilities.getRowEnd(doc, templateOffset + 1) - 1); }
private void createHint(ASTNode block) { int lineEnd = block.getEndOffset(); try { lineEnd = Utilities.getRowEnd(baseDocument, block.getStartOffset()); } catch (BadLocationException ex) { LOGGER.log(Level.FINE, null, ex); } OffsetRange offsetRange = new OffsetRange(block.getStartOffset(), lineEnd); if (showHint(offsetRange, baseDocument)) { hints.add(new Hint(NestedBlocksHint.this, Bundle.NestedBlocksHintText(), fileObject, offsetRange, null, 500)); } }
public void run() { try { final int start=Utilities.getRowStart(doc,offset); final int end=Utilities.getRowEnd(doc,offset); doc.remove(start,end-start+1); } catch (BadLocationException ble) { ErrorManager.getDefault().notify(ble); } RecommentAction.actionPerformed(doc); } });
@Override public void implement() throws Exception { int templateOffset = getOffset(); EditList edits = new EditList(doc); edits.replace(templateOffset, 0, "\n" + templ, true, 0); //NOI18N edits.apply(); templateOffset = Utilities.getRowEnd(doc, templateOffset + 1) - 2; UiUtils.open(clz.getFileObject(), templateOffset); }
@Override public void implement() throws Exception { int templateOffset = getOffset(); EditList edits = new EditList(doc); edits.replace(templateOffset, 0, "\n" + templ, true, 0); //NOI18N edits.apply(); templateOffset = Utilities.getRowEnd(doc, templateOffset + 1) - 2; UiUtils.open(clz.getFileObject(), templateOffset); }
@Override public void implement() throws Exception { int templateOffset = getOffset(); EditList edits = new EditList(doc); edits.replace(templateOffset, 0, "\n" + templ, true, 0); //NOI18N edits.apply(); templateOffset = Utilities.getRowEnd(doc, templateOffset + 1) - 2; UiUtils.open(type.getFileObject(), templateOffset); }