Hi,
I'm getting a problem with layoutdemo.xml.. the Display just comes back null. I have this helper function-
void showDlg( String fileName ) {
System.out.println ("WD = " + System.getProperty("user.dir"));
System.out.println (fileName+ " exists = " + new File (fileName).exists());
CookSwt cookSwt = new CookSwt ();
Display d = (Display)cookSwt.xmlDecode (fileName);
if ( d == null )
System.err.println ("Failed to decode XML for "+ fileName);
else
SwtUtils.showDisplay ( d );
}
Which gives the following output:
WD = E:\eclipse-platform-3.2RC7-win32\Calistoworkspace\cookSWT
helloWorld.xml exists = true
WD = E:\eclipse-platform-3.2RC7-win32\Calistoworkspace\cookSWT
layoutdemo.xml exists = true
Failed to decode XML for layoutdemo.xml
What's the approach for tracking down XML parse
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1. enable assertion (-ea of JVM) and that will print out exception traces.
2. Write your own exception handler that prints out exception (just follow DebugExceptionHandler's example by removing the assert keyword) and use it as default.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm getting a problem with layoutdemo.xml.. the Display just comes back null. I have this helper function-
void showDlg( String fileName ) {
System.out.println ("WD = " + System.getProperty("user.dir"));
System.out.println (fileName+ " exists = " + new File (fileName).exists());
CookSwt cookSwt = new CookSwt ();
Display d = (Display)cookSwt.xmlDecode (fileName);
if ( d == null )
System.err.println ("Failed to decode XML for "+ fileName);
else
SwtUtils.showDisplay ( d );
}
Which gives the following output:
WD = E:\eclipse-platform-3.2RC7-win32\Calistoworkspace\cookSWT
helloWorld.xml exists = true
WD = E:\eclipse-platform-3.2RC7-win32\Calistoworkspace\cookSWT
layoutdemo.xml exists = true
Failed to decode XML for layoutdemo.xml
What's the approach for tracking down XML parse
.. errors? Are problems reported anywhere? I want to give this to non-java users, failing silently will make it tough for them to use.
Thanks
There are two ways:
1. enable assertion (-ea of JVM) and that will print out exception traces.
2. Write your own exception handler that prints out exception (just follow DebugExceptionHandler's example by removing the assert keyword) and use it as default.