public void run () { switch (actionId) { case REFRESH: refreshState (); break; case UNMARK: unmarkError (); break; case ATTACH_DETACH: attachDetachAnnotations(ev.getDocument(), ev.isClosingDocument()); ev = null; break; } }
public void unmarkCurrentLine () { current = false; registerLine (0, null); refreshState (); }
moveLinePart(part, line); } else { i++; List<? extends Annotation> annos = getAnnotations(); synchronized(annos) { if (annos.size() > 0) {
@Override public boolean equals(Object o) { if (o instanceof DocumentLine) { DocumentLine dl = (DocumentLine) o; if (dl.pos.getCloneableEditorSupport() == pos.getCloneableEditorSupport()) { return dl.getLineNumber() == getLineNumber(); } } return false; }
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
/** Move Line.Part from this Line to a new one*/ void moveLinePart(DocumentLine.Part linePart, DocumentLine newLine) { lineParts.remove(linePart); newLine.addLinePart(linePart); linePart.changeLine(newLine); }
public void setBreakpoint(boolean b) { if (breakpoint != b) { breakpoint = b; refreshState (); } }
/** Find the line given as parameter in list of all lines attached to this set * and if the line exist in the list, notify it about being moved. */ void linesMoved(int startLineNumber, int endLineNumber) { List movedLines = getLinesFromRange(startLineNumber, endLineNumber); for (Iterator it = movedLines.iterator(); it.hasNext();) { Line line = (Line) it.next(); line.firePropertyChange(Line.PROP_LINE_NUMBER, null, null); // notify all parts attached to this line // that they were moved if (line instanceof DocumentLine) { ((DocumentLine) line).notifyMove(); } } }
/** Find the line given as parameter in list of all lines attached to this set * and if the line exist in the list, notify it about being edited. */ void linesChanged(int startLineNumber, int endLineNumber, DocumentEvent p0) { List changedLines = getLinesFromRange(startLineNumber, endLineNumber); for(Iterator it = changedLines.iterator(); it.hasNext(); ) { Line line = (Line)it.next(); line.firePropertyChange(Annotatable.PROP_TEXT, null, null); // revalidate all parts attached to this line // that they are still part of the line if(line instanceof DocumentLine) { ((DocumentLine)line).notifyChange(p0, this, listener.doc); } } }
/** Registers the line to this <code>Line.Set</code>. * @param line <code>Line</code> to register * @return registered <code>Line</code>. <em>Note:</em> the retruned * <code>Line</code> could be different (identityHashCode not equal) * from the one passed in */ final Line registerLine(Line line) { // beware of null argument if (line == null) throw new NullPointerException(); WeakHashMap lines = findWeakHashMap (); synchronized(lines) { Reference r = (Reference)lines.get(line); Line in = (r != null ? (Line)r.get() : null); if(in == null) { if(line instanceof DocumentLine) { ((DocumentLine)line).init(); } lines.put(line, new WeakReference(line)); in = line; } return in; } }
moveLinePart(part, line); } else { i++; ); List annos = getAnnotations(); int annosSize = annos.size(); if (annosSize > 0) {
public boolean equals (Object o) { if (o instanceof DocumentLine) { DocumentLine dl = (DocumentLine)o; if (dl.pos.getCloneableEditorSupport () == pos.getCloneableEditorSupport ()) { return dl.getLineNumber () == getLineNumber (); } } return false; }
public void run() { try { synchronized (getAnnotations()) { if (!anno.isInDocument()) { anno.setInDocument(true); // #33165 - find position that is surely at begining of line FindAnnotationPosition fap = new FindAnnotationPosition(doc, pos.getPosition()); doc.render(fap); NbDocument.addAnnotation(doc, fap.getAnnotationPosition(), -1, anno); } } } catch (IOException ex) { Logger.getLogger(DocumentLine.class.getName()).log(Level.WARNING, null, ex); } } });
/** Move Line.Part from this Line to a new one*/ void moveLinePart(DocumentLine.Part linePart, DocumentLine newLine) { lineParts.remove(linePart); newLine.addLinePart(linePart); linePart.changeLine(newLine); }
public void setBreakpoint(boolean b) { if (breakpoint != b) { breakpoint = b; refreshState (); } }
/** Find the line given as parameter in list of all lines attached to this set * and if the line exist in the list, notify it about being moved. */ void linesMoved(int startLineNumber, int endLineNumber) { List movedLines = getLinesFromRange(startLineNumber, endLineNumber); for(Iterator it = movedLines.iterator(); it.hasNext(); ) { Line line = (Line)it.next(); line.firePropertyChange(Line.PROP_LINE_NUMBER, null, null); // notify all parts attached to this line // that they were moved if (line instanceof DocumentLine) { ((DocumentLine)line).notifyMove(); } } }
/** Find the line given as parameter in list of all lines attached to this set * and if the line exist in the list, notify it about being edited. */ void linesChanged(int startLineNumber, int endLineNumber, DocumentEvent p0) { List changedLines = getLinesFromRange(startLineNumber, endLineNumber); for(Iterator it = changedLines.iterator(); it.hasNext(); ) { Line line = (Line)it.next(); line.firePropertyChange(Annotatable.PROP_TEXT, null, null); // revalidate all parts attached to this line // that they are still part of the line if(line instanceof DocumentLine) { ((DocumentLine)line).notifyChange(p0, this, listener.doc); } } }
/** Registers the line to this <code>Line.Set</code>. * @param line <code>Line</code> to register * @return registered <code>Line</code>. <em>Note:</em> the retruned * <code>Line</code> could be different (identityHashCode not equal) * from the one passed in */ final Line registerLine(Line line) { // beware of null argument if (line == null) { throw new NullPointerException(); } Map<Line,Reference<Line>> lines = findWeakHashMap(); synchronized (lines) { Reference<Line> r = lines.get(line); Line in = r != null ? r.get() : null; if (in == null) { if (line instanceof DocumentLine) { ((DocumentLine) line).init(); } lines.put(line, new WeakReference<Line>(line)); in = line; } return in; } }
public void unmarkCurrentLine () { current = false; registerLine (0, null); refreshState (); }
public void run () { switch (actionId) { case REFRESH: refreshState (); break; case UNMARK: unmarkError (); break; case ATTACH_DETACH: attachDetachAnnotations(ev.getDocument(), ev.isClosingDocument()); ev = null; break; } }