Open cxbrooks opened 19 years ago
Ben Denckla submitted the following bug.
The problem is that trying to open $PTII/bin/vergil.lnk does not follow the link. This is because vergil.lnk is a Cygwin symbolic link, so programs like wordpad will not follow the link.
We could figure out how to parse the binary data and open up the file.
The createEffigy() in ptolemy.actor.gui.TextEffigy.java is where the change should go
if (File.pathSeparatorChar == ';') {
String extension = getExtension(in);
if (extension.equals("lnk")) {
String inAsString = in.toExternalForm();
// process the Cygwin link here
in = new URL(inAsString.substring(0,
inAsString.length() - 4));
System.out.println("Saw .lnk file, instead open '"
+ in + "'");
}
}
However at this point, I don't have the time to parse the Cygwin .lnk format.
A related issue is that FileChooser in Java 1.4.2_06 does not handle native Windows shortcuts properly, but Java 1.5.0_01 does. Note that these short cuts are created by Windows not Cygwin, even though they have the same .lnk extension.
To: "Ben Denckla" <bdenckla@ alum.mit.edu> Cc: ptresearch@ maury.eecs.berkeley.edu From: "Christopher Brooks" <cxh@ eecs.berkeley.edu> Date: Fri, 21 Jan 2005 16:55:26 -0800 Subject: [Ptolemy] Re: Vergil bug report/feature request: Vergil's "open file" \ dialog doesn't "understand" Windows shortcuts
Thanks, I'll take a look.
This might be a general Java problem with JFileChooser, see
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=572689
That's because it IS a file...
The FileChooser API makes no allowance for handling this type of situation... you will need to sub the FileChooser and catch this event... then resolve the link reflected and provide this back to the FileChooser.....
See also http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4356160
Vergil opens the .lnk (shortcut) file itself as a text file instead of
"following" the link.
Ptolemy version = 4.0.1
OS = Microsoft Windows XP [Version 5.1.2600]
java.version = 1.4.2_04 (from Vergil "JVM Properties" window)
Ben Denckla
h 415 282 7498
m 415 710 9673
w 650 731 6824
h 1262 Guerrero St / San Francisco, CA 94110
w 2001 Junipero Serro Blvd / Daly City, CA 94014-3886
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#9 From: @cxbrooks Reported version: 4.1