@Override public void close() { synchronized (lock) { if (fIsClosed) { return; } fIsClosed= true; fDocument.removeDocumentListener(this); if (fTextFileBuffer != null) { try { ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager(); manager.disconnect(fFile.getFullPath(), LocationKind.NORMALIZE, null); } catch (CoreException x) { // ignore } fTextFileBuffer= null; } fireBufferChanged(new BufferChangedEvent(this, 0, 0, null)); fBufferListeners.clear(); fDocument = null; } }
public void close() { if (isClosed()) return; IDocument d= fDocument; fDocument= new Document(); fIsClosed= true; d.removeDocumentListener(this); if (fTextFileBuffer != null) { ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager(); try { if (fFileStore != null) manager.disconnectFileStore(fFileStore, new NullProgressMonitor()); else manager.disconnect(fPath, fLocationKind, new NullProgressMonitor()); } catch (CoreException x) { // ignore } fTextFileBuffer= null; } fireBufferChanged(new BufferChangedEvent(this, 0, 0, null)); fBufferListeners.clear(); }
private void fireBufferChanged(BufferChangedEvent event) { IBufferChangedListener[] listeners = null; synchronized (lock) { listeners = fBufferListeners.toArray(new IBufferChangedListener[fBufferListeners.size()]); } for (IBufferChangedListener listener : listeners) { listener.bufferChanged(event); } }
private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { Iterator<IBufferChangedListener> e = new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } }
private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { Iterator<IBufferChangedListener> e= new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } }
@Override public void documentChanged(DocumentEvent event) { fireBufferChanged(new BufferChangedEvent(this, event.getOffset(), event.getLength(), event.getText())); }
public void documentChanged(DocumentEvent event) { fireBufferChanged( new BufferChangedEvent(this, event.getOffset(), event.getLength(), event.getText())); }
public void documentChanged(DocumentEvent event) { fireBufferChanged(new BufferChangedEvent(this, event.getOffset(), event.getLength(), event.getText())); }