if ((type == null) || (type.length() == 0))
type = "writer_Text";
System.out.println(type);
// Get document frame loader factory.
Object object = mFrameLoaderFactory.createInstance(type);
XSynchronousFrameLoader frameLoader;
frameLoader = (XSynchronousFrameLoader)UnoRuntime.queryInterface(
XSynchronousFrameLoader.class, object);
// Create the document descriptor.
PropertyValue[] desc = new PropertyValue[2];
desc[0] = new PropertyValue(
"FileName", 0, url, PropertyState.DIRECT_VALUE);
desc[1] = new PropertyValue(
"TypeName", 0, type, PropertyState.DIRECT_VALUE);
// Avoid Dialog 'Document changed' while reloading
try {
setModified(false);
} catch (java.lang.IllegalStateException exp) {
}
// Load the document.
if (frameLoader.load(desc, mFrame) == false) {
throw new java.io.IOException(
"Can not load a document: \"" + url + "\"");
}
mDocumentURL = url;
// Get document's XModifiable interface if any.