Search in sources :

Example 6 with FreeplaneMenuBar

use of org.freeplane.core.ui.components.FreeplaneMenuBar in project freeplane by freeplane.

the class MainView method processKeyBinding.

/*
	 * (non-Javadoc)
	 * @see javax.swing.JComponent#processKeyBinding(javax.swing.KeyStroke,
	 * java.awt.event.KeyEvent, int, boolean)
	 */
@Override
protected boolean processKeyBinding(final KeyStroke ks, final KeyEvent e, final int condition, final boolean pressed) {
    if (super.processKeyBinding(ks, e, condition, pressed)) {
        return true;
    }
    final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, this);
    final FreeplaneMenuBar freeplaneMenuBar = mapView.getModeController().getController().getViewController().getFreeplaneMenuBar();
    return !freeplaneMenuBar.isVisible() && freeplaneMenuBar.processKeyBinding(ks, e, JComponent.WHEN_IN_FOCUSED_WINDOW, pressed);
}
Also used : FreeplaneMenuBar(org.freeplane.core.ui.components.FreeplaneMenuBar)

Aggregations

FreeplaneMenuBar (org.freeplane.core.ui.components.FreeplaneMenuBar)6 EntryAccessor (org.freeplane.core.ui.menubuilders.generic.EntryAccessor)3 IUserInputListenerFactory (org.freeplane.core.ui.IUserInputListenerFactory)2 Entry (org.freeplane.core.ui.menubuilders.generic.Entry)2 Test (org.junit.Test)2 URL (java.net.URL)1 JMenu (javax.swing.JMenu)1 JPopupMenu (javax.swing.JPopupMenu)1 MenuBuilder (org.freeplane.core.ui.MenuBuilder)1 EntriesForAction (org.freeplane.core.ui.menubuilders.action.EntriesForAction)1 IAcceleratorMap (org.freeplane.core.ui.menubuilders.action.IAcceleratorMap)1 ResourceAccessor (org.freeplane.core.ui.menubuilders.generic.ResourceAccessor)1 RibbonBuilder (org.freeplane.core.ui.ribbon.RibbonBuilder)1 FreeplaneActions (org.freeplane.features.mode.FreeplaneActions)1 IMapViewManager (org.freeplane.features.ui.IMapViewManager)1 Before (org.junit.Before)1