new Actions.SubMenu( new SingleDisplayActionAction(displayAction, designBean), new DisplayActionSetMenuModel(items, designBean),
boolean shouldUpdate = false; try { menu.removeAll (); menu.removeActionListener(menu.oneItemListener); menu.setEnabled (false); if (menu.oneItemListener != null) { menu.removeActionListener (menu.oneItemListener); menu.oneItemListener = null; menu.setEnabled (true); menu.addActionListener(menu.oneItemListener = new ISubActionListener(0, model)); HelpCtx help = model.getHelpCtx (0); associateHelp (menu, help == null ? findHelp (action) : help); addSeparator = menu.getItemCount() > 0; } else { if(addSeparator) { menu.addSeparator(); addSeparator = false; HelpCtx help = model.getHelpCtx (i); associateHelp (item, help == null ? findHelp (action) : help); menu.add(item); menu.updateUI ();
/** Overrides superclass method. Adds a hack for KB menu invokation * when this <code>JMenu</code> needs to act like <code>JMenuItem</code>. */ public void processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager m) { if(getMenuComponentCount() <= 1 && java.util.Arrays.equals( path, MenuSelectionManager.defaultManager().getSelectedPath()) && (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_SPACE) ) { ActionListener ac = oneItemListener; if(ac != null) { m.setSelectedPath(new MenuElement[0]); ac.actionPerformed(new ActionEvent(e.getSource(), 0, null)); return; } } super.processKeyEvent(e, path, m); }
boolean shouldUpdate = false; try { menu.removeAll (); menu.removeActionListener(menu.oneItemListener); menu.setEnabled (false); if (menu.oneItemListener != null) { menu.removeActionListener (menu.oneItemListener); menu.oneItemListener = null; menu.setEnabled (true); menu.addActionListener(menu.oneItemListener = new ISubActionListener(0, model)); HelpCtx help = model.getHelpCtx (0); associateHelp (menu, help == null ? findHelp (action) : help); addSeparator = menu.getItemCount() > 0; } else { if(addSeparator) { menu.addSeparator(); addSeparator = false; HelpCtx help = model.getHelpCtx (i); associateHelp (item, help == null ? findHelp (action) : help); menu.add(item); menu.updateUI ();
/** Overrides superclass method. * If it has accelerator delegates processing of it to the first item. */ protected boolean processKeyBinding( KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // If it is as accelerator process the doClick binding to the // first sub-item. if(ks.equals(accelerator)) { // Use first item if there is one. Component[] cs = getMenuComponents(); if(cs.length > 0 && cs[0] instanceof JComponent) { JComponent comp = (JComponent)cs[0]; ActionMap am = comp.getActionMap(); if(am != null && comp.isEnabled()) { Action action = am.get("doClick"); // NOI18N if (action != null) { return SwingUtilities.notifyAction( action, ks, e, comp, e.getModifiers()); } } return false; } } return super.processKeyBinding(ks, e, condition, pressed); }
/** Overrides superclass method. * If it has accelerator delegates processing of it to the first item. */ protected boolean processKeyBinding( KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // If it is as accelerator process the doClick binding to the // first sub-item. if(ks.equals(accelerator)) { // Use first item if there is one. Component[] cs = getMenuComponents(); if(cs.length > 0 && cs[0] instanceof JComponent) { JComponent comp = (JComponent)cs[0]; ActionMap am = comp.getActionMap(); if(am != null && comp.isEnabled()) { Action action = am.get("doClick"); // NOI18N if (action != null) { return SwingUtilities.notifyAction( action, ks, e, comp, e.getModifiers()); } } return false; } } return super.processKeyBinding(ks, e, condition, pressed); }
/** Overrides superclass method. Adds a hack for KB menu invokation * when this <code>JMenu</code> needs to act like <code>JMenuItem</code>. */ public void processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager m) { if(getMenuComponentCount() <= 1 && java.util.Arrays.equals( path, MenuSelectionManager.defaultManager().getSelectedPath()) && (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_SPACE) ) { ActionListener ac = oneItemListener; if(ac != null) { m.setSelectedPath(new MenuElement[0]); ac.actionPerformed(new ActionEvent(e.getSource(), 0, null)); return; } } super.processKeyEvent(e, path, m); }
public javax.swing.JMenuItem getMenuPresenter() { return new org.openide.awt.Actions.SubMenu (this, model, false); }
public javax.swing.JMenuItem getPopupPresenter() { return new Actions.SubMenu(this, model (), true); }
public JMenuItem getPopupPresenter() { return new Actions.SubMenu(this, model, true); }
public javax.swing.JMenuItem getPopupPresenter() { return new Actions.SubMenu(this, model, true); }
public javax.swing.JMenuItem getPopupPresenter() { return new org.openide.awt.Actions.SubMenu (this, model, true); }
public javax.swing.JMenuItem getMenuPresenter() { return new Actions.SubMenu(this, model, false); }
public javax.swing.JMenuItem getMenuPresenter() { return new Actions.SubMenu(this, model, false); }
public javax.swing.JMenuItem getPopupPresenter() { return new Actions.SubMenu(this, model, true); }
public javax.swing.JMenuItem getMenuPresenter() { return new org.openide.awt.Actions.SubMenu (this, model, false); }
protected JMenuItem getMenuPresenter(Action contextAwareAction, Lookup.Result result) { return new Actions.SubMenu(contextAwareAction, new EventHandlersMenuModel(getDesignBeans(result)), false); }
public JMenuItem getMenuPresenter() { return new Actions.SubMenu(this, model, false); }
public javax.swing.JMenuItem getMenuPresenter() { return new Actions.SubMenu(this, model, false); }
public javax.swing.JMenuItem getMenuPresenter() { return new Actions.SubMenu(this, model (), false); }