}
}
public void returnHandler() {
int lineNumber = 0;
CompilerErrorDescriptorNode n = getSelectedErrorNode();
if (n == null) {
return;
}
File fileToOpen = new File(n.getAbsolutePath()); //pass absolute path to the file you want
fileObjectToOpen = FileUtil.toFileObject(fileToOpen);
try {
DataObject dob = DataObject.find(fileObjectToOpen);
//Bug fix: now actually make sure it's open in the editor
openEditor(dob);
EditorCookie ck = dob.getCookie(EditorCookie.class);
if (ck != null) {
ck.openDocument();
JEditorPane[] p = ck.getOpenedPanes();
if (p.length > 0) {
//Need to do this since we're disabling the window system's
//auto focus mechanism
p[0].requestFocus();
if (dob != null) {
LineCookie lc = dob.getCookie(LineCookie.class);
if (lc == null) {
return;
}
lineNumber = n.getLine() - 1;
Line l = lc.getLineSet().getOriginal(lineNumber);
l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
if (TextToSpeechOptions.isScreenReading()) {
speech.speak("Focussed to " + fileObjectToOpen.getName()
+ " dot " + fileObjectToOpen.getExt() + " "
+ n.getShortDescription() + " " + n.getDisplayName(),
SpeechPriority.MEDIUM);
}
}
}
}