Search in sources :

Example 6 with XJWindow

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;
        }
    }
}
Also used : XJDocument(org.antlr.xjlib.appkit.document.XJDocument) XJWindow(org.antlr.xjlib.appkit.frame.XJWindow)

Example 7 with XJWindow

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;
}
Also used : XJWindow(org.antlr.xjlib.appkit.frame.XJWindow)

Aggregations

XJWindow (org.antlr.xjlib.appkit.frame.XJWindow)7 XJDocument (org.antlr.xjlib.appkit.document.XJDocument)4 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)1