holdPriorityMenuItem.setToolTipText("<html>Hold priority after casting a spell or activating an ability, instead of automatically passing priority."); popupMenu.add(holdPriorityMenuItem); holdPriorityMenuItem.addActionListener(e -> { manaPoolMenuItem1.setToolTipText("<html>If not active, produced mana goes only to the mana pool<br>" + "and you have to click the type of mana you want to use <br>" + "in the player mana pool panel for payment."); manaPoolMenuItem2.setToolTipText("<html>Mana that is already in the mana pool as you start casting a spell or activating an ability<br>" + " needs to be payed manually. So you use the mana in the pool only by clicking on the related<br>" + " mana symbols of mana pool area."); useFirstManaAbilityItem.setToolTipText("<html>Use the first mana ability when<br>" + " tapping lands for mana<br>" + "You can hold Alt+1 whilst tapping lands to use this feature"); allowViewHandCardsMenuItem = new JCheckBoxMenuItem("Allow requests to show from other users", allowRequestToShowHandCards); allowViewHandCardsMenuItem.setMnemonic(KeyEvent.VK_A); allowViewHandCardsMenuItem.setToolTipText("If activated watchers or other players can request to see your hand cards. If you grant this to a user, it's valid for the complete match."); handCardsMenu.add(allowViewHandCardsMenuItem);
/** * Returns a check box menu item configured from an action. * * @param action The action associated with the menu item. * @return The menu item. */ protected JCheckBoxMenuItem createCheckBoxMenuItem(Action action) { JCheckBoxMenuItem item = new JCheckBoxMenuItem(action); item.setToolTipText(null); return item; }
/** * Overrides {@link XAction#addToMenu(JPopupMenu)} to add a {@link JCheckBoxMenuItem} instead of a {@link JMenuItem}. */ @Override public JMenuItem addToMenu( final JPopupMenu menu ) { final JCheckBoxMenuItem mi = new JCheckBoxMenuItem(); menu.add( mi ); mi.setAction( this ); mi.setToolTipText( null ); // We don't want tool tip on menu items... return mi; }
/** * Overrides {@link XAction#addToMenu(JMenu)} to add a {@link JCheckBoxMenuItem} instead of a {@link JMenuItem}. */ @Override public JMenuItem addToMenu( final JMenu menu ) { final JCheckBoxMenuItem mi = new JCheckBoxMenuItem(); menu.add( mi ); mi.setAction( this ); mi.setToolTipText( null ); // We don't want tool tip on menu items... return mi; }
static public JCheckBoxMenuItem createMenuItem(MenuAction menuItemAction, boolean isSelected) { JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(); menuItem.setSelected(isSelected); menuItem.setAction(menuItemAction); String text = menuItemAction.getToolTipText(); if (text != null) { menuItem.setToolTipText(text); } return menuItem; } }
void buildTypeMenu() { _type_menu = createMenu( TYPE_MENU_HEADER, getConfiguration() ); _type_menu.add( _rectangular_type_cbmi = new JCheckBoxMenuItem( MainFrame.RECTANGULAR_TYPE_CBMI_LABEL ) ); _type_menu.add( _euro_type_cbmi = new JCheckBoxMenuItem( MainFrame.EURO_TYPE_CBMI_LABEL ) ); _type_menu.add( _rounded_type_cbmi = new JCheckBoxMenuItem( MainFrame.ROUNDED_TYPE_CBMI_LABEL ) ); _type_menu.add( _curved_type_cbmi = new JCheckBoxMenuItem( MainFrame.CURVED_TYPE_CBMI_LABEL ) ); _type_menu.add( _triangular_type_cbmi = new JCheckBoxMenuItem( MainFrame.TRIANGULAR_TYPE_CBMI_LABEL ) ); _type_menu.add( _convex_type_cbmi = new JCheckBoxMenuItem( MainFrame.CONVEX_TYPE_CBMI_LABEL ) ); _type_menu.add( _unrooted_type_cbmi = new JCheckBoxMenuItem( MainFrame.UNROOTED_TYPE_CBMI_LABEL ) ); _type_menu.add( _circular_type_cbmi = new JCheckBoxMenuItem( MainFrame.CIRCULAR_TYPE_CBMI_LABEL ) ); customizeCheckBoxMenuItem( _rectangular_type_cbmi, false ); customizeCheckBoxMenuItem( _triangular_type_cbmi, false ); customizeCheckBoxMenuItem( _euro_type_cbmi, false ); customizeCheckBoxMenuItem( _rounded_type_cbmi, false ); customizeCheckBoxMenuItem( _curved_type_cbmi, false ); customizeCheckBoxMenuItem( _convex_type_cbmi, false ); customizeCheckBoxMenuItem( _unrooted_type_cbmi, false ); customizeCheckBoxMenuItem( _circular_type_cbmi, false ); _unrooted_type_cbmi.setToolTipText( MainFrame.USE_MOUSEWHEEL_SHIFT_TO_ROTATE ); _circular_type_cbmi.setToolTipText( MainFrame.USE_MOUSEWHEEL_SHIFT_TO_ROTATE ); initializeTypeMenu( getOptions() ); _jmenubar.add( _type_menu ); }
void buildTypeMenu() { _type_menu = MainFrame.createMenu( MainFrame.TYPE_MENU_HEADER, getConfiguration() ); _type_menu.add( _rectangular_type_cbmi = new JCheckBoxMenuItem( MainFrame.RECTANGULAR_TYPE_CBMI_LABEL ) ); _type_menu.add( _euro_type_cbmi = new JCheckBoxMenuItem( MainFrame.EURO_TYPE_CBMI_LABEL ) ); _type_menu.add( _rounded_type_cbmi = new JCheckBoxMenuItem( MainFrame.ROUNDED_TYPE_CBMI_LABEL ) ); _type_menu.add( _curved_type_cbmi = new JCheckBoxMenuItem( MainFrame.CURVED_TYPE_CBMI_LABEL ) ); _type_menu.add( _triangular_type_cbmi = new JCheckBoxMenuItem( MainFrame.TRIANGULAR_TYPE_CBMI_LABEL ) ); _type_menu.add( _convex_type_cbmi = new JCheckBoxMenuItem( MainFrame.CONVEX_TYPE_CBMI_LABEL ) ); _type_menu.add( _unrooted_type_cbmi = new JCheckBoxMenuItem( MainFrame.UNROOTED_TYPE_CBMI_LABEL ) ); _type_menu.add( _circular_type_cbmi = new JCheckBoxMenuItem( MainFrame.CIRCULAR_TYPE_CBMI_LABEL ) ); customizeCheckBoxMenuItem( _rectangular_type_cbmi, false ); customizeCheckBoxMenuItem( _triangular_type_cbmi, false ); customizeCheckBoxMenuItem( _euro_type_cbmi, false ); customizeCheckBoxMenuItem( _rounded_type_cbmi, false ); customizeCheckBoxMenuItem( _curved_type_cbmi, false ); customizeCheckBoxMenuItem( _convex_type_cbmi, false ); customizeCheckBoxMenuItem( _unrooted_type_cbmi, false ); customizeCheckBoxMenuItem( _circular_type_cbmi, false ); _unrooted_type_cbmi.setToolTipText( MainFrame.USE_MOUSEWHEEL_SHIFT_TO_ROTATE ); _circular_type_cbmi.setToolTipText( MainFrame.USE_MOUSEWHEEL_SHIFT_TO_ROTATE ); initializeTypeMenu( getOptions() ); _jmenubar.add( _type_menu ); }
private void updateForcedUserModeToggleButtonEnabledState() { if (getView() != null) { forcedUserModeButton.setSelected(forcedUserModeEnabled); forcedUserModeMenuItem.setSelected(forcedUserModeEnabled); forcedUserModeMenuItem.setToolTipText(forcedUserModeEnabled ? BUTTON_LABEL_ON : BUTTON_LABEL_OFF ); } }
private JCheckBoxMenuItem getForcedUserModeMenuItem() { if (forcedUserModeMenuItem == null) { forcedUserModeMenuItem = new JCheckBoxMenuItem(MENU_ITEM_LABEL); forcedUserModeMenuItem.setToolTipText(BUTTON_LABEL_DISABLED); forcedUserModeMenuItem.setEnabled(false); forcedUserModeMenuItem.addActionListener(e -> setForcedUserModeEnabled(forcedUserModeMenuItem.isSelected())); } return forcedUserModeMenuItem; }
scaleEnabled.setToolTipText("Select scale for inclusion in view"); scaleEnabled.addActionListener(new ActionListener() { legendEnabled.setToolTipText("Select legend for inclusion in view"); legendEnabled.addActionListener(new ActionListener() {
@Override public void menuSelected(MenuEvent me) { Track seqTrack = (Track)GenomeController.getInstance().getGenome().getSequenceTrack(); if (seqTrack == mainTrack) { setAsGenomeButton.setSelected(true); setAsGenomeButton.setEnabled(false); setAsGenomeButton.setToolTipText("This track is already the reference sequence"); } else { setAsGenomeButton.setSelected(false); setAsGenomeButton.setEnabled(true); setAsGenomeButton.setToolTipText("Use this track as the reference sequence"); } } });
item.setToolTipText(comment);
mStatusVisible.setSelected (getThumbelina ().getStatusBarVisible ()); mStatusVisible.setText ("Status Bar"); mStatusVisible.setToolTipText ("Show/Hide the status bar."); mView.add (mStatusVisible); mHistoryVisible.setMnemonic ('H'); mHistoryVisible.setSelected (getThumbelina ().getHistoryListVisible ()); mHistoryVisible.setText ("History List"); mHistoryVisible.setToolTipText ("Show/Hide the history list."); mView.add (mHistoryVisible); mMenu.add (mView);
private void populateMenu() { menu.removeAll(); List<TileServer> tileServers = availableOverlaysModel.getItems(); for(TileServer tileServer : tileServers) { JCheckBoxMenuItem item = new JCheckBoxMenuItem(); item.setAction(new ToggleOverlayAction(appliedOverlaysModel, tileServer)); item.setState(appliedOverlaysModel.contains(tileServer)); item.setText(tileServer.getId()); item.setToolTipText(tileServer.getDescription()); menu.add(item); } menu.setEnabled(tileServers.size() > 0); } }
private JCheckBoxMenuItem getCodonTableMenuItem(AminoAcidManager.CodonTable codonTable) { JCheckBoxMenuItem item = new JCheckBoxMenuItem(); String fullName = codonTable.getDisplayName(); String shortName = fullName; if (fullName.length() > 40) { shortName = fullName.substring(0, 37) + "..."; item.setToolTipText(fullName); } item.setText(shortName); final AminoAcidManager.CodonTableKey curKey = codonTable.getKey(); item.setSelected(curKey.equals(AminoAcidManager.getInstance().getCodonTable().getKey())); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { AminoAcidManager.getInstance().setCodonTable(curKey); repaint(); } }); return item; }
mLinks.setMnemonic('L'); mLinks.setText("Links"); mLinks.setToolTipText("show/hide links in text"); mLinks.setName("Links"); mLinks.addActionListener (this); mCollapse.setToolTipText("collapse/retain whitespace sequences"); mCollapse.setName("Collapse"); mCollapse.addActionListener (this); mNobreak.setToolTipText("replace/retain non-breaking spaces"); mNobreak.setName("Nobreak"); mNobreak.addActionListener (this);
private void addMessageFormatterOrColorizerToMenu(final JPopupMenu menu, final PluginableElement pluginable, final PluginableElementsContainer selectedPluginableContainer) { { final JCheckBoxMenuItem boxMenuItem = new JCheckBoxMenuItem(pluginable.getName(), selectedPluginableContainer.contains(pluginable)); boxMenuItem.setToolTipText(pluginable.getDescription()); menu.add(boxMenuItem); boxMenuItem.addChangeListener(e -> { if (boxMenuItem.isSelected() && !selectedPluginableContainer.contains(pluginable)) { selectedPluginableContainer.addElement(pluginable); } else if (!boxMenuItem.isSelected() && selectedPluginableContainer.contains(pluginable)) { selectedPluginableContainer.removeElement(pluginable); } }); } }
treeCheckBox.setToolTipText(Lang.get("menu_treeSelect_tt")); treeCheckBox.addActionListener(actionEvent -> { getContentPane().remove(componentOnPane);
public void addToggleAction(String category, String name, String description, String tooltip, Icon icon, final Predicate predicate, boolean initialValue) { final JCheckBoxMenuItem checkBox = MenuBar.makeMenuItem(name, JCheckBoxMenuItem.class); checkBox.setIcon(icon); checkBox.setText(description); checkBox.setToolTipText(tooltip); checkBox.setSelected(initialValue); checkBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { predicate.set(checkBox.isSelected()); } }); addItem(category, checkBox); }
private void setForcedUserModeToggleButtonState(boolean enabled) { if (enabled) { updateForcedUserModeToggleButtonEnabledState(); this.getForcedUserModeToggleButton().setEnabled(true); this.getForcedUserModeMenuItem().setEnabled(true); } else { this.forcedUserModeEnabled = false; this.getForcedUserModeToggleButton().setSelected(false); this.getForcedUserModeToggleButton().setEnabled(false); this.getForcedUserModeMenuItem().setSelected(false); this.getForcedUserModeMenuItem().setEnabled(false); this.getForcedUserModeMenuItem().setToolTipText(BUTTON_LABEL_DISABLED); } }