Tabnine Logo
JCheckBoxMenuItem.setActionCommand
Code IndexAdd Tabnine to your IDE (free)

How to use
setActionCommand
method
in
javax.swing.JCheckBoxMenuItem

Best Java code snippets using javax.swing.JCheckBoxMenuItem.setActionCommand (Showing top 20 results out of 315)

origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Create a JCheckBoxMenuItem labelled with text for the given property key.
 * 
 * @param key
 *            property key
 * @param actionCommand
 *            internal command
 * @return JCheckBoxMenuItem
 */
private JCheckBoxMenuItem makeCheckBoxMenuItem(String key, String actionCommand) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(Config.language.getProperty(key));
  item.setActionCommand(actionCommand);
  item.addActionListener(this);
  return item;
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Create a JCheckBoxMenuItem labelled with text for the given property key.
 * 
 * @param key
 *            property key
 * @param actionCommand
 *            internal command
 * @return JCheckBoxMenuItem
 */
private JCheckBoxMenuItem makeCheckBoxMenuItem(String key, String actionCommand) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(Config.language.getProperty(key));
  item.setActionCommand(actionCommand);
  item.addActionListener(desktop);
  return item;
}
origin: chatty/chatty

/**
 * Adds a CheckboxMenuItem to a menu.
 * 
 * @param menu The Menu to which the item is added
 * @param key The key this item is associated with (the setting)
 * @param label The text of the item
 * @return The created MenuItem
 */
public final JMenuItem addCheckboxItem(JMenu menu, String key, String label) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(label);
  menuItems.put(key, item);
  item.setActionCommand(key);
  menu.add(item);
  item.addItemListener(itemListener);
  return item;
}

origin: MegaMek/mekhq

  private JCheckBoxMenuItem newCheckboxMenu(String text, String command, boolean selected, boolean enabled) {
    JCheckBoxMenuItem result = new JCheckBoxMenuItem(text);
    result.setSelected(selected);
    result.setActionCommand(command);
    result.addActionListener(this);
    result.setEnabled(true);
    return result;
  }
}
origin: org.apache.jmeter/ApacheJMeter_core

  private static JCheckBoxMenuItem makeCheckBoxMenuItemRes(String resource,
      String actionCommand, KeyStroke keyStroke){
    JCheckBoxMenuItem cbkMenuItem = new JCheckBoxMenuItem(JMeterUtils.getResString(resource));
    cbkMenuItem.setName(resource);
    cbkMenuItem.setActionCommand(actionCommand);
    cbkMenuItem.setAccelerator(keyStroke);
    cbkMenuItem.addActionListener(ActionRouter.getInstance());
    return cbkMenuItem;
  }
}
origin: chatty/chatty

@Override
public void showMenu(AddressbookEntry entry, Component invoker, int x, int y) {
  currentEntry = entry;
  removeAll();
  List<String> presetCategories = addressbook.getCategories();
  Set<String> categories = entry.getCategories();
  for (String cat : presetCategories) {
    boolean selected = categories.contains(cat);
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(cat, selected);
    item.addActionListener(actionListener);
    item.setActionCommand(cat);
    add(item);
  }
  this.show(invoker, x, y);
}

origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

@Override
protected void initColumnSelectorItems() {
  cornerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnCount; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    cornerPopup.add(menuItem);
  }
  cornerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  cornerPopup.add(filterMenuItem);
  cornerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: MegaMek/mekhq

private void refreshThemeChoices() {
  menuThemes.removeAll();
  JCheckBoxMenuItem miPlaf;
  for (LookAndFeelInfo plaf : UIManager.getInstalledLookAndFeels()) {
    miPlaf = new JCheckBoxMenuItem(plaf.getName());
    if (plaf.getName().equalsIgnoreCase(
        UIManager.getLookAndFeel().getName())) {
      miPlaf.setSelected(true);
    }
    menuThemes.add(miPlaf);
    miPlaf.setActionCommand(plaf.getClassName());
    miPlaf.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        changeTheme(evt);
      }
    });
  }
}
//TODO: trigger from event
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  cornerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < realTreeTableModel.getColumnCount(); i++) {
    menuItem = new JCheckBoxMenuItem(realTreeTableModel.getColumnName(i));
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (treeTable != null) {
      menuItem.setState(treeTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    cornerPopup.add(menuItem);
  }
  cornerPopup.pack();
}

origin: org.bitbucket.goalhub.simpleide/jedit

  "vfs.browser.commands.encoding.auto-detect"));
autoDetect.setSelected(browser.autoDetectEncoding);
autoDetect.setActionCommand("auto-detect");
autoDetect.addActionListener(actionHandler);
menu.add(autoDetect);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.fudaa.framework.ebli/ebli-3d

public final JMenuItem addMenuItem(final String _s, final String _cmd, final boolean _enabled, final boolean _value) {
 // BuIcon icon=BuLib.loadCommandIcon(_cmd);
 final JCheckBoxMenuItem r = new JCheckBoxMenuItem();
 r.setName("cb" + _cmd);
 r.setActionCommand(_cmd);
 r.setText(_s);
 // r.setIcon(icon);
 r.setHorizontalTextPosition(SwingConstants.RIGHT);
 r.addActionListener(this);
 r.setEnabled(_enabled);
 r.setSelected(_value);
 this.add(r);
 return r;
}
origin: MegaMek/mekhq

  cbMenuItem.setSelected(true);
} else {
  cbMenuItem.setActionCommand("CHANGE_MODE:" + wt.id);
  cbMenuItem.addActionListener(this);
origin: net.sf.mmax2/mmax2

fancy.setFont(MMAX2.getStandardFont());
fancy.addActionListener(this);
fancy.setActionCommand("fancy");
settingsMenu.add(fancy);
activeOnly.setFont(MMAX2.getStandardFont());
activeOnly.addActionListener(this);
activeOnly.setActionCommand("activeOnly");
settingsMenu.add(activeOnly);
group.setFont(MMAX2.getStandardFont());
group.addActionListener(this);
group.setActionCommand("group");
settingsMenu.add(group);
javax.swingJCheckBoxMenuItemsetActionCommand

Popular methods of JCheckBoxMenuItem

  • <init>
  • setSelected
  • addActionListener
  • isSelected
  • setEnabled
  • setState
  • setText
  • getState
  • addItemListener
  • setMnemonic
  • setToolTipText
  • setAccelerator
  • setToolTipText,
  • setAccelerator,
  • setAction,
  • getText,
  • setIcon,
  • setName,
  • getModel,
  • addChangeListener,
  • getActionCommand

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JComboBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now