public int getLineNo() { if (line == null) { return 0; } int lineNo = line.getLineNumber(); // Editor numbers lines from 0! lineNo += 1; return lineNo; }
@Override public int getLineNumber() { return line.getLineNumber() + 1; }
/** Composes a human presentable name for the line. The default * implementation uses the name of data object and the line number * to create the display name. * * @return human presentable name that should identify the line */ public String getDisplayName() { return getClass().getName() + ":" + getLineNumber(); // NOI18N }
/** Composes a human presentable name for the line. The default * implementation uses the name of data object and the line number * to create the display name. * * @return human presentable name that should identify the line */ public String getDisplayName () { return getClass().getName() + ":" + getLineNumber(); // NOI18N }
/** Composes a human presentable name for the line. The default * implementation uses the name of data object and the line number * to create the display name. * * @return human presentable name that should identify the line */ public String getDisplayName () { return getClass().getName() + ":" + getLineNumber(); // NOI18N }
/** Computes display name for a line produced * by this {@link CloneableEditorSupport#getLineSet }. The default * implementation reuses messageName and line number of the line. * * @param line the line object to compute display name for * @return display name for the line like "MyFile.java:243" * * @since 4.3 */ protected String messageLine(Line line) { return NbBundle.getMessage(Line.class, "FMT_CESLineDisplayName", messageName(), line.getLineNumber() + 1); }
private synchronized void update() { updatingLine = true; try { lb.setLineNumber(line.getLineNumber() + 1); } finally { updatingLine = false; } }
private void update(Line l) { try { int ln; synchronized (this) { updatingLine = true; ln = l.getLineNumber() + 1; } lb.setLineNumber(ln); } finally { synchronized (this) { updatingLine = false; } } }
private void update(Line l) { try { int ln; synchronized (this) { updatingLine = true; ln = l.getLineNumber() + 1; } lb.setLineNumber(ln); } finally { synchronized (this) { updatingLine = false; } } }
/** Computes display name for a line produced * by this {@link CloneableEditorSupport#getLineSet }. The default * implementation reuses messageName and line number of the line. * * @param line the line object to compute display name for * @return display name for the line like "MyFile.java:243" * * @since 4.3 */ protected String messageLine (Line line) { return NbBundle.getMessage(Line.class, "FMT_CESLineDisplayName", messageName (), new Integer (line.getLineNumber () + 1) ); }
/** Gets the lines with line number whitin the range inclusive. * @return <code>List</code> of lines from range inclusive */ private List<Line> getLinesFromRange(int startLineNumber, int endLineNumber) { List<Line> linesInRange = new ArrayList<Line>(10); synchronized (findWeakHashMap()) { for (Line line : findWeakHashMap().keySet()) { int lineNumber = line.getLineNumber(); if ((startLineNumber <= lineNumber) && (lineNumber <= endLineNumber)) { linesInRange.add(line); } } } return linesInRange; }
@Override public void run() { Line find = findLine(line); if (find != null) { ret[0] = listener.getOld(find.getLineNumber()); } else { ret[0] = -1; } } };
public int getOriginalLineNumber (Line line) { Line find = findLine (line); if (find != null) { return listener.getOld (find.getLineNumber ()); } else { return -1; } }
public int getOriginalLineNumber (Line line) { Line find = findLine (line); if (find != null) { return listener.getOld (find.getLineNumber ()); } else { return -1; } }
public int indexOf(Object o) { if (o instanceof DocumentLine) { Line find = set.findLine((DocumentLine) o); if (find != null) { int indx = set.listener.getOld(find.getLineNumber()); if (set.getOriginal(indx).equals(o)) { // just to verify that the index really exists return indx; } } } return -1; }
public int indexOf (Object o) { if (o instanceof DocumentLine) { Line find = set.findLine ((DocumentLine)o); if (find != null) { int indx = set.listener.getOld (find.getLineNumber ()); if (set.getOriginal (indx).equals (o)) { // just to verify that the index really exists return indx; } } } return -1; }
public int indexOf (Object o) { if (o instanceof DocumentLine) { Line find = set.findLine ((DocumentLine)o); if (find != null) { int indx = set.listener.getOld (find.getLineNumber ()); if (set.getOriginal (indx).equals (o)) { // just to verify that the index really exists return indx; } } } return -1; }
/** Computes display name for a line based on the * name of the associated DataObject and the line number. * * @param line the line object to compute display name for * @return display name for the line like "MyFile.java:243" * * @since 4.3 */ protected String messageLine (Line line) { return NbBundle.getMessage(DataObject.class, "FMT_LineDisplayName2", obj.getPrimaryFile().getNameExt(), FileUtil.getFileDisplayName(obj.getPrimaryFile()), new Integer(line.getLineNumber() + 1)); }
@Override public void run() { Line line = myPart.getLine(); int startOffset = Utilities.getRowStartFromLineOffset(myDocument, line.getLineNumber()); myOffset = startOffset+myPart.getColumn(); }
@Override public void run() { int dot = comp.getCaret().getDot(); Annotations annotations = ((BaseDocument) document).getAnnotations(); Line line = NbEditorUtilities.getLine(document, dot, false); if (line == null) { return ; } int lineNumber = line.getLineNumber(); AnnotationDesc desc = annotations.getActiveAnnotation(lineNumber); values[0] = lineNumber; values[1] = desc; } });