1 19 package org.netbeans.modules.diff.builtin.visualizer.editable; 20 21 import org.netbeans.spi.diff.DiffVisualizer; 22 import org.netbeans.api.diff.Difference; 23 import org.netbeans.api.diff.DiffView; 24 import org.netbeans.api.diff.StreamSource; 25 import org.openide.util.NbBundle; 26 27 import java.awt.Component ; 28 import java.io.Reader ; 29 import java.io.IOException ; 30 31 36 public class EditableDiffVisualizer extends DiffVisualizer { 37 38 41 public String getDisplayName() { 42 return NbBundle.getMessage(EditableDiffVisualizer.class, "CTL_EditableDiffVisualizer_Name"); } 44 45 48 public String getShortDescription() { 49 return NbBundle.getMessage(EditableDiffVisualizer.class, "CTL_EditableDiffVisualizer_Desc"); } 51 52 public Component createView(Difference[] diffs, String name1, String title1, Reader r1, String name2, String title2, Reader r2, String MIMEType) throws IOException { 53 DiffView view = createDiff(diffs, StreamSource.createSource(name1, title1, MIMEType, r1), StreamSource.createSource(name2, title2, MIMEType, r2)); 54 return view.getComponent(); 55 } 56 57 public DiffView createDiff(Difference[] diffs, StreamSource s1, StreamSource s2) throws IOException { 58 return new EditableDiffView(s1, s2); 59 } 60 } 61 | Popular Tags |