Search in sources :

Example 1 with RibbonApplicationMenu

use of org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu in project freeplane by freeplane.

the class RibbonMenuContributorFactory method getContributor.

public ARibbonContributor getContributor(final Properties attributes) {
    return new ARibbonContributor() {

        private RibbonApplicationMenu menu;

        public String getKey() {
            return "app_menu";
        }

        public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
            menu = new RibbonApplicationMenu();
            context.processChildren(context.getCurrentPath(), this);
            parent.addChild(menu, null);
        }

        public void addChild(Object child, ChildProperties properties) {
            if (child instanceof RibbonApplicationMenuEntryFooter) {
                menu.addFooterEntry((RibbonApplicationMenuEntryFooter) child);
            } else if (child instanceof RibbonApplicationMenuEntryPrimary) {
                menu.addMenuEntry((RibbonApplicationMenuEntryPrimary) child);
            }
        }
    };
}
Also used : RibbonApplicationMenu(org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu) RibbonApplicationMenuEntryFooter(org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryFooter) RibbonApplicationMenuEntryPrimary(org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary)

Aggregations

RibbonApplicationMenu (org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu)1 RibbonApplicationMenuEntryFooter (org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryFooter)1 RibbonApplicationMenuEntryPrimary (org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary)1