@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; }
@Override public void run() { Line find = findLine(line); if (find != null) { ret[0] = listener.getOld(find.getLineNumber()); } else { ret[0] = -1; } } };
/** Register line. */ Object readResolve() throws ObjectStreamException { // return Set.registerLine (this); //Set.registerPendingLine(this); return this.pos.getCloneableEditorSupport().getLineSet().registerLine(this); }
private int offset(int line) { StyledDocument doc = listener.support.getDocument(); int offset = doc == null ? 0 : NbDocument.findLineOffset(doc, line); return offset; }
/** 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); }
/** Get the line number */ public int getLine() throws IOException { // pre-33165 return NbDocument.findLineNumber(getCloneableEditorSupport().openDocument(), offset); mgr.getCloneableEditorSupport().openDocument(); // make sure document is fully read return new DocumentRenderer(mgr, DocumentRenderer.OFFSET_KIND_GET_LINE, this, offset).renderToIntIOE(); }
public void run() { String name = ces.messageHtmlName(); setHtmlDisplayName(name); name = ces.messageName(); setDisplayName(name); setName(name); // XXX compatibility setToolTipText(ces.messageToolTip()); } }
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
private StyledDocument openDocumentCheckIOE() throws IOException { StyledDocument locDoc = openDocumentImpl(); IOException ioe = getListener().checkLoadException(); if (ioe != null) { throw ioe; } return locDoc; }
/** Test whether the document is modified. * @return <code>true</code> if the document is in memory and is modified; * otherwise <code>false</code> */ public boolean isModified() { CloneableEditorSupport redirect = CloneableEditorSupportRedirector.findRedirect(this); if (redirect != null) { return redirect.isModified(); } return cesEnv().isModified(); }
@Override public java.lang.String getUndoOrRedoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(8, support.getDocument(), 0, true).stringResult; } else { return ""; } }
/** Asks the associated {@link CloneableEditorSupport} to initialize * this editor via its {@link CloneableEditorSupport#initializeCloneableEditor(org.openide.text.CloneableEditor)} * method. By default called from the support on various occasions including * shortly after creation and * after the {@link CloneableEditor} has been deserialized. * * @since 6.37 */ protected final void initializeBySupport() { cloneableEditorSupport().initializeCloneableEditor(this); }
@Override public void run() { UndoRedo.Manager urm = getUndoRedo(); if (urm instanceof UndoRedoManager) { ((UndoRedoManager) undoRedo).startOnSaveTasks(); onSaveTasksStarted[0] = true; } } };
/** * Set the MIME type for the document. * @param s the new MIME type */ public void setMIMEType(String s) { CloneableEditorSupport redirect = CloneableEditorSupportRedirector.findRedirect(this, true); if (redirect != null) { redirect.setMIMEType(s); return; } mimeType = s; }
/** 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; }
/** 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)); }
/** Get the column number */ public int getColumn() throws IOException { // pre-33165 return NbDocument.findLineColumn (getCloneableEditorSupport().openDocument(), offset); mgr.getCloneableEditorSupport().openDocument(); // make sure document fully read return new DocumentRenderer(mgr, DocumentRenderer.OFFSET_KIND_GET_COLUMN, this, offset).renderToIntIOE(); }
@Override public java.lang.String getRedoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(9, support.getDocument(), 0, true).stringResult; } else { return ""; } }
/** 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)); }