added path argument to SourceViewer

git-svn-id: https://mspsim.svn.sourceforge.net/svnroot/mspsim/mspsim@47 23d1a52b-0c3c-0410-b72d-8f29ab48fe35
This commit is contained in:
joxe 2007-12-06 18:18:23 +00:00
parent 1fa14fd48e
commit d3e902a067
3 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ public class HighlightSourceViewer implements SourceViewer {
private SyntaxHighlighter highlighter;
private ArrayList<File> path = null;
private JFileChooser fileChooser;
public HighlightSourceViewer() {
//
}
@ -94,7 +94,7 @@ public class HighlightSourceViewer implements SourceViewer {
window.setVisible(isVisible);
}
public void viewFile(final String filename) {
public void viewFile(final String path, final String filename) {
setup();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
@ -182,6 +182,6 @@ public class HighlightSourceViewer implements SourceViewer {
public static void main(String[] args) {
HighlightSourceViewer sv = new HighlightSourceViewer();
sv.setVisible(true);
sv.viewFile(args[0]);
sv.viewFile(".", args[0]);
}
}

View File

@ -182,7 +182,7 @@ public class ControlUI extends JPanel implements ActionListener {
DebugInfo dbg = elfData.getDebugInfo(pc);
if (dbg != null) {
if (sourceViewer != null) {
sourceViewer.viewFile(dbg.getFile());
sourceViewer.viewFile(dbg.getPath(), dbg.getFile());
sourceViewer.viewLine(dbg.getLine());
} else {
System.out.println("File: " + dbg.getFile());

View File

@ -43,7 +43,7 @@ package se.sics.mspsim.util;
public interface SourceViewer {
public void viewFile(String file);
public void viewFile(String path, String file);
public void viewLine(int line);
}