1 11 package org.eclipse.search2.internal.ui.text; 12 13 import org.eclipse.core.filebuffers.FileBuffers; 14 import org.eclipse.core.filebuffers.IFileBuffer; 15 import org.eclipse.core.filebuffers.IFileBufferListener; 16 import org.eclipse.core.runtime.IPath; 17 import org.eclipse.search.ui.text.Match; 18 19 public class Highlighter { 20 private IFileBufferListener fBufferListener; 21 22 public Highlighter() { 23 fBufferListener= new IFileBufferListener() { 24 public void bufferCreated(IFileBuffer buffer) { 25 } 26 27 public void bufferDisposed(IFileBuffer buffer) { 28 } 29 30 public void bufferContentAboutToBeReplaced(IFileBuffer buffer) { 31 } 32 33 public void bufferContentReplaced(IFileBuffer buffer) { 34 handleContentReplaced(buffer); 35 } 36 37 public void stateChanging(IFileBuffer buffer) { 38 } 39 40 public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) { 41 } 42 43 public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) { 44 } 45 46 public void underlyingFileMoved(IFileBuffer buffer, IPath path) { 47 } 48 49 public void underlyingFileDeleted(IFileBuffer buffer) { 50 } 51 52 public void stateChangeFailed(IFileBuffer buffer) { 53 } 54 }; 55 FileBuffers.getTextFileBufferManager().addFileBufferListener(fBufferListener); 56 } 57 58 public void addHighlights(Match[] matches) { 59 } 60 61 public void removeHighlights(Match[] matches) { 62 } 63 64 public void removeAll() { 65 } 66 67 public void dispose() { 68 FileBuffers.getTextFileBufferManager().removeFileBufferListener(fBufferListener); 69 } 70 71 protected void handleContentReplaced(IFileBuffer buffer) { 72 } 73 74 } 75 | Popular Tags |