1 19 20 package org.netbeans.spi.diff; 21 22 import java.awt.Component ; 23 import java.beans.PropertyChangeListener ; 24 import java.io.IOException ; 25 import java.io.Reader ; 26 27 29 import org.netbeans.api.diff.DiffView; 30 import org.netbeans.api.diff.Difference; 31 import org.netbeans.api.diff.StreamSource; 32 33 42 public abstract class DiffVisualizer extends Object { 43 44 49 50 64 public abstract Component createView(Difference[] diffs, String name1, String title1, 65 Reader r1, String name2, String title2, 66 Reader r2, String MIMEType) throws IOException ; 67 68 82 public DiffView createDiff(Difference[] diffs, StreamSource s1, StreamSource s2) throws IOException { 83 final Component c = createView(diffs, s1.getName(), s1.getTitle(), s1.createReader(), 84 s2.getName(), s2.getTitle(), s2.createReader(), 85 s1.getMIMEType()); 86 final int n = diffs.length; 87 return new DiffView() { 88 89 public Component getComponent() { 90 return c; 91 } 92 93 public int getDifferenceCount() { 94 return n; 95 } 96 97 public boolean canSetCurrentDifference() { 98 return false; 99 } 100 101 public void setCurrentDifference(int diffNo) throws UnsupportedOperationException { 102 throw new UnsupportedOperationException (); 103 } 104 105 public int getCurrentDifference() throws UnsupportedOperationException { 106 throw new UnsupportedOperationException (); 107 } 108 109 public javax.swing.JToolBar getToolBar() { 110 return null; 111 } 112 113 public void addPropertyChangeListener(PropertyChangeListener l) {} 114 115 public void removePropertyChangeListener(PropertyChangeListener l) {} 116 117 }; 118 } 119 } 120 | Popular Tags |