/** Fire the change event to repaint the given block of text. */ public void repaintBlock(int startOffset, int endOffset) { BaseDocumentEvent evt = createDocumentEvent(startOffset, endOffset - startOffset, DocumentEvent.EventType.CHANGE); fireChangedUpdate(evt); }
/** Fire the change event to repaint the given block of text. */ public void repaintBlock(int startOffset, int endOffset) { BaseDocumentEvent evt = createDocumentEvent(startOffset, endOffset - startOffset, DocumentEvent.EventType.CHANGE); fireChangedUpdate(evt); }
/** Toggle the bookmark for the current line */ public boolean toggleBookmark(int pos) throws BadLocationException { pos = Utilities.getRowStart(this, pos); boolean marked = bookmarkChain.toggleMark(pos); BaseDocumentEvent evt = createDocumentEvent(pos, 0, DocumentEvent.EventType.CHANGE); fireChangedUpdate(evt); return marked; }
/** Toggle the bookmark for the current line */ public boolean toggleBookmark(int pos) throws BadLocationException { pos = Utilities.getRowStart(this, pos); boolean marked = bookmarkChain.toggleMark(pos); BaseDocumentEvent evt = createDocumentEvent(pos, 0, DocumentEvent.EventType.CHANGE); fireChangedUpdate(evt); return marked; }
public boolean addLayer(DrawLayer layer, int visibility) { if (drawLayerList.add(layer, visibility)) { BaseDocumentEvent evt = createDocumentEvent(0, 0, DocumentEvent.EventType.CHANGE); evt.addEdit(new BaseDocumentEvent.DrawLayerChange(layer.getName(), visibility)); fireChangedUpdate(evt); return true; } else { return false; } }
public boolean addLayer(DrawLayer layer, int visibility) { if (drawLayerList.add(layer, visibility)) { BaseDocumentEvent evt = createDocumentEvent(0, 0, DocumentEvent.EventType.CHANGE); evt.addEdit(new BaseDocumentEvent.DrawLayerChange(layer.getName(), visibility)); fireChangedUpdate(evt); return true; } else { return false; } }
private void findSupportChange(PropertyChangeEvent evt) { // set all finders to null putProperty(STRING_FINDER_PROP, null); putProperty(STRING_BWD_FINDER_PROP, null); putProperty(BLOCKS_FINDER_PROP, null); DrawLayerFactory.HighlightSearchLayer hsl = (DrawLayerFactory.HighlightSearchLayer) findLayer(DrawLayerFactory.HIGHLIGHT_SEARCH_LAYER_NAME); Boolean b = (Boolean) FindSupport.getFindSupport().getPropertyNoInit(SettingsNames.FIND_HIGHLIGHT_SEARCH); hsl.setEnabled((b != null) ? b.booleanValue() : false); fireChangedUpdate(createDocumentEvent(0, getLength(), DocumentEvent.EventType.CHANGE)); // refresh // whole // document }
private void findSupportChange(PropertyChangeEvent evt) { // set all finders to null putProperty(STRING_FINDER_PROP, null); putProperty(STRING_BWD_FINDER_PROP, null); putProperty(BLOCKS_FINDER_PROP, null); DrawLayerFactory.HighlightSearchLayer hsl = (DrawLayerFactory.HighlightSearchLayer)findLayer( DrawLayerFactory.HIGHLIGHT_SEARCH_LAYER_NAME); Boolean b = (Boolean)FindSupport.getFindSupport().getPropertyNoInit( SettingsNames.FIND_HIGHLIGHT_SEARCH); hsl.setEnabled((b != null) ? b.booleanValue() : false); fireChangedUpdate(createDocumentEvent(0, getLength(), DocumentEvent.EventType.CHANGE)); // refresh whole document }
/** * Insert contents of reader at specified position into document. * * @param reader * reader from which data will be read * @param pos * on which position that data will be inserted */ public void read(Reader reader, int pos) throws IOException, BadLocationException { extWriteLock(); try { if (pos < 0 || pos > getLength()) { throw new BadLocationException("BaseDocument.read()", pos); // NOI18N } if (inited || modified) { // was the document already initialized? Analyzer.read(this, reader, pos); } else { // not initialized yet, we can use initialRead() Analyzer.initialRead(this, reader, true); BaseDocumentEvent evt = createDocumentEvent(0, 0, DocumentEvent.EventType.INSERT); evt.end(); fireInsertUpdate(evt); // fire the insert event with zero // length to notify about the change inited = true; // initialized but not modified } } finally { extWriteUnlock(); } }
BaseDocumentEvent evt = createDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); if (edit != null) { evt.addEdit(edit);
BaseDocumentEvent evt = createDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT);
BaseDocumentEvent evt = createDocumentEvent(offset, len, DocumentEvent.EventType.REMOVE);
BaseDocumentEvent evt = createDocumentEvent(offset, len, DocumentEvent.EventType.REMOVE);