Package org.antlr.xjlib.appkit.frame

Examples of org.antlr.xjlib.appkit.frame.XJWindow


            if(supportsPersistence())
                document.setTitle(XJLocalizable.getXJString("AppUntitled")+" "+documentAbsoluteCount);
            else
                document.setTitle(documentAbsoluteCount > 0 ?appName+" "+documentAbsoluteCount:appName);

            XJWindow window = document.getWindow();
            if(!window.isMaximized() && useDesktopMode()) {
                documentAbsoluteCount++;

                window.offsetPosition(documentAbsPositionCount*DOCUMENT_OFFSET_PIXELS,
                        documentAbsPositionCount*DOCUMENT_OFFSET_PIXELS);

                if(window.isCompletelyOnScreen())
                    documentAbsPositionCount++;
                else
                    documentAbsPositionCount = 0;
            }
        } catch(Exception e) {
View Full Code Here


        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;
View Full Code Here

    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;
    }
View Full Code Here

    private void buildWindowMenu_() {
        Iterator iterator = XJApplication.shared().getWindows().iterator();
        int count = 0;
        while(iterator.hasNext()) {
            XJWindow window = (XJWindow)iterator.next();
            if(window.shouldAppearsInWindowMenu()) {
                XJMenuItemCheck item = buildMenuItemCheck(window.getTitle(), count<10?KeyEvent.VK_0+count:-1, MI_WINDOW+count);
                item.setSelected(window.isActive());
                menuWindow.addItem(item);
                count++;
            }
        }
View Full Code Here

        return menuHelp;
    }

    public void handleMenuEvent(XJMenu menu, XJMenuItem item) {
        //XJDocument document = XJApplication.shared().getActiveDocument();
        XJWindow activeWindow = XJApplication.shared().getActiveWindow();
        switch(item.tag) {
            case MI_NEW:
                XJApplication.shared().newDocument();
                break;

            case MI_OPEN:
                XJApplication.shared().openDocument();
                break;

            case MI_SAVE:
                if(activeWindow != null) {
                    for(XJDocument doc : activeWindow.getDocuments()) {
                        if(doc.save(false)) {
                            doc.changeReset();
                        }
                    }
                }
                break;

            case MI_SAVEAS:
                if(activeWindow != null) {
                    for(XJDocument doc : activeWindow.getDocuments()) {
                        if(doc.save(true)) {
                            doc.changeReset();
                        }
                    }
                }
                break;

            case MI_CLEAR_RECENT_FILES:
                XJApplication.shared().clearRecentFiles();
                break;

            case MI_QUIT:
                XJApplication.shared().performQuit();
                break;

            case MI_PREFS:
                XJApplication.shared().displayPrefs();
                break;

            case MI_ABOUT:
                XJApplication.shared().displayAbout();
                break;

            case MI_HELP:
                XJApplication.shared().displayHelp();
                break;

            case MI_GC:
                System.gc();
                break;
           
            default:
                if(item.tag>=MI_WINDOW) {
                    XJWindow window = XJApplication.shared().getWindowsInWindowMenu().get(item.tag-MI_WINDOW);
                    window.bringToFront();
                    item.setSelected(true);
                } else if(item.tag>=MI_RECENT_FILES && item.tag<=MI_RECENT_FILES+XJApplication.MAX_RECENT_FILES) {
                    if(!XJApplication.shared().openDocument(item.getTitle())) {
                        XJApplication.shared().removeRecentFile(item.getTitle());
                    }
View Full Code Here

TOP

Related Classes of org.antlr.xjlib.appkit.frame.XJWindow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.