Package org.antlr.works.stringtemplate.menu

Examples of org.antlr.works.stringtemplate.menu.ContextualStringTemplateMenuFactory


    public JPopupMenu getContextualMenu(int textIndex) {
        boolean overReference = window.getCurrentReference() != null;
        boolean overToken = window.getCurrentToken() != null;
        boolean overSelection = window.getTextPane().getSelectionStart() != window.getTextPane().getSelectionEnd();

        ContextualStringTemplateMenuFactory factory = new ContextualStringTemplateMenuFactory(this);
        factory.addItem(MI_GOTO_RULE);
        if(overReference)
            factory.addItem(MI_GOTO_DECLARATION);

        factory.addSeparator();
        if(overToken)
            factory.addItem(MI_RENAME);

        if(overToken) {
            factory.addSeparator();
            if(overSelection)
                factory.addItem(MI_FIND_TOKEN);
            //factory.addItem(MI_FIND_USAGE);
        }

        return factory.menu;
    }
View Full Code Here


    public GoToMenu getActionGoTo() {
        return stringTemplateMenu.getActionGoTo();
    }

    public ContextualStringTemplateMenuFactory createContextualStringTemplateMenuFactory() {
        return new ContextualStringTemplateMenuFactory(stringTemplateMenu);
    }
View Full Code Here

        getToolbar().updateStates();
        stRulesPanel.refreshRules();
    }

    public JPopupMenu rulesGetContextualMenu() {
        ContextualStringTemplateMenuFactory factory = createContextualStringTemplateMenuFactory();
        XJMenuItemCheck item = (XJMenuItemCheck) factory.addItem(STWindowMenu.MI_SORT_RULES);
        item.setSelected(isRulesSorted());

        return factory.menu;
    }
View Full Code Here

TOP

Related Classes of org.antlr.works.stringtemplate.menu.ContextualStringTemplateMenuFactory

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.