use of org.antlr.xjlib.appkit.frame.XJWindow in project antlrworks by antlr.
the class XJApplication method openDocument.
public boolean openDocument(String file) {
if (file == null)
return false;
// application in the didRun method (see above).
if (startingUp) {
documentsToOpenAtStartup.add(file);
return true;
}
XJWindow window = getWindowContainingDocumentForPath(file);
if (window != null) {
window.selectDocument(window.getDocumentForPath(file));
window.bringToFront();
return true;
} else {
XJDocument document = newDocument(false, getDocumentTypeForPath(file));
if (document == null)
return false;
else if (loadDocument(file, document)) {
addRecentFile(file);
document.showWindow();
closeFirstCreatedWindowIfNonDirty(document.getWindow());
return true;
} else {
document.getWindow().performClose(true);
return false;
}
}
}
use of org.antlr.xjlib.appkit.frame.XJWindow in project antlrworks by antlr.
the class XJDocumentFactory method createDocument.
public XJDocument createDocument() throws IllegalAccessException, InstantiationException {
XJDocument document = (XJDocument) documentClass.newInstance();
document.setDocumentData((XJData) dataClass.newInstance());
document.setDocumentFileType(getExtensions(), getDescriptionString());
XJWindow window = (XJWindow) windowClass.newInstance();
window.addDocument(document);
document.setWindow(window);
return document;
}
Aggregations