/** Constructs a new menu item with the specified label * and no keyboard shortcut and connects it to the given SystemAction. * @param aAction the action to which this menu item should be connected * @param useMnemonic if true, the menu try to find mnemonic in action label */ public MenuItem(SystemAction aAction, boolean useMnemonic) { Actions.connect(this, aAction, !useMnemonic); }
/** Constructs a new ActToolbarToggleButton for specified action */ public ToolbarToggleButton(BooleanStateAction aAction) { super(null, false); Actions.connect(this, aAction); }
/** Constructs a new menu item with the specified label * and no keyboard shortcut and connects it to the given SystemAction. * @param aAction the action to which this menu item should be connected * @param useMnemonic if true, the menu try to find mnemonic in action label */ public MenuItem(Action aAction, boolean useMnemonic) { Actions.connect(this, aAction, !useMnemonic); }
/** Constructs a new ActCheckboxMenuItem with the specified label * and connects it to the given BooleanStateAction. * @param aAction the action to which this menu item should be connected * @param useMnemonic if true, the menu try to find mnemonic in action label */ public CheckboxMenuItem(BooleanStateAction aAction, boolean useMnemonic) { Actions.connect(this, aAction, !useMnemonic); } }
public ToolbarButton(Action aAction) { super(null); Actions.connect(this, aAction); }
public ToolbarButton(SystemAction aAction) { super(null); Actions.connect(this, aAction); }
/** Attaches menu item to an action. * @param item menu item * @param action action * @param popup create popup or menu item * @deprecated Use {@link #connect(JMenuItem, Action, boolean)} instead. */ @Deprecated public static void connect(JMenuItem item, SystemAction action, boolean popup) { connect(item, (Action) action, popup); }
/** Connects buttons to action. * @param button the button * @param action the action * @deprecated Use {@link #connect(AbstractButton, Action)} instead. */ @Deprecated public static void connect(AbstractButton button, SystemAction action) { connect(button, (Action) action); }
public JMenuItem getPopupPresenter() { if (popupItem == null) { popupItem = new JCheckBoxMenuItem(); popupItem.setSelected(isPreferencesSelected()); Actions.connect(popupItem, this, true); } return popupItem; }
public JMenuItem getMenuPresenter() { if (menuItem == null) { menuItem = new JCheckBoxMenuItem(); menuItem.setSelected(isPreferencesSelected()); Actions.connect(menuItem, this, false); } return menuItem; }
public AbstractButton getToolbarPresenter() { if(toolbarItems == null) { toolbarItems = new WeakSet<AbstractButton>(4); } AbstractButton b = new DefaultIconToggleButton(); toolbarItems.add(b); b.setSelected(isPreferencesSelected()); Actions.connect(b, this); return b; }
/** Attaches menu item to an action. * @param item menu item * @param action action * @param popup create popup or menu item * @deprecated Use {@link #connect(JMenuItem, Action, boolean)} instead. */ public static void connect (JMenuItem item, SystemAction action, boolean popup) { connect (item, (Action)action, popup); }
/** Constructs a new menu item with the specified label * and no keyboard shortcut and connects it to the given SystemAction. * @param aAction the action to which this menu item should be connected * @param useMnemonic if true, the menu try to find mnemonic in action label */ public MenuItem (Action aAction, boolean useMnemonic) { Actions.connect (this, aAction, !useMnemonic); } }
/** Attaches menu item to an action. * @param item menu item * @param action action * @param popup create popup or menu item * @deprecated Use {@link #connect(JMenuItem, Action, boolean)} instead. */ public static void connect (JMenuItem item, SystemAction action, boolean popup) { connect (item, (Action)action, popup); }
/** Constructs a new menu item with the specified label * and no keyboard shortcut and connects it to the given SystemAction. * @param aAction the action to which this menu item should be connected * @param useMnemonic if true, the menu try to find mnemonic in action label */ public MenuItem (SystemAction aAction, boolean useMnemonic) { Actions.connect (this, aAction, !useMnemonic); }
/** Connects buttons to action. * @param button the button * @param action the action * @deprecated Use {@link #connect(AbstractButton, Action)} instead. */ public static void connect (AbstractButton button, SystemAction action) { connect (button, (Action)action); }
/** Constructs a new ActToolbarToggleButton for specified action */ public ToolbarToggleButton (BooleanStateAction aAction) { super(null, false); Actions.connect (this, aAction); }
private JPopupMenu createPopupMenu() { if (popupActions.isEmpty()) { return null; } JPopupMenu pm = new JPopupMenu(); for (Action action : popupActions) { JMenuItem menuItem = new JMenuItem(); Actions.connect(menuItem, action, true); // Actions.connect() takes care of mnemonics pm.add(menuItem); } return pm; }
public JMenuItem getPopupPresenter() { JMenu mi = new JMenu(); Actions.connect(mi, (Action)this, false); mi.addMenuListener(new FormatItemListener()); return mi; }