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

How to use
setAction
method
in
javax.swing.JCheckBoxMenuItem

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

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

  /**
   * Unconfigures a JCheckBoxMenuItem for an Action.
   */
  public static void unconfigureJCheckBoxMenuItem(JCheckBoxMenuItem mi, Action a) {
    /*PropertyChangeListener propertyHandler = (PropertyChangeListener) mi.getClientProperty("actionPropertyHandler");
    if (propertyHandler != null) {
      a.removePropertyChangeListener(propertyHandler);
    mi.putClientProperty("actionPropertyHandler", null);
    }*/
    mi.setAction(null);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Configures a JCheckBoxMenuItem for an Action.
 */
public static void configureJCheckBoxMenuItem(final JCheckBoxMenuItem mi, final Action a) {
  /*mi.setSelected((Boolean) a.getValue(ActionUtil.SELECTED_KEY));
  PropertyChangeListener propertyHandler = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getPropertyName().equals(ActionUtil.SELECTED_KEY)) {
        mi.setSelected((Boolean) a.getValue(ActionUtil.SELECTED_KEY));
      }
    }
  };
  a.addPropertyChangeListener(propertyHandler);
  mi.putClientProperty("actionPropertyHandler", propertyHandler);
  */
  mi.setAction(a);
}

origin: org.scijava/scijava-ui-swing

private JCheckBoxMenuItem recordCallingClassMenuItem() {
  JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem();
  menuItem.setState(false);
  menuItem.setAction(new AbstractAction("record calling class") {
    @Override
    public void actionPerformed(ActionEvent e) {
      recorder.setRecordCallingClass(menuItem.getState());
      updateFilter();
    }
  });
  return menuItem;
}
origin: org.scijava/scijava-ui-swing

private JMenuItem checkboxItem(LogFormatter.Field field, String text) {
  JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(text, logFormatter.isVisible(field));
  menuItem.setAction(new AbstractAction(text) {
    @Override
    public void actionPerformed(ActionEvent e) {
      logFormatter.setVisible(field, menuItem.getState());
      updateFilter();
    }
  });
  return menuItem;
}
origin: icza/scelight

/**
 * 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;
}
 
origin: icza/scelight

/**
 * 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;
}
 
origin: net.sourceforge.jadex/jadex-tools-base-swing

filetypes.put(SELECT_ALL, all);
all.setAction(new AbstractAction("All files")
origin: igvteam/igv

  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;
  }
}
origin: org.codehaus.mevenide/nb-project

item.setAction(new AbstractAction(profile) {
origin: net.sourceforge.jadex/jadex-tools-base-swing

filetypes.put(SELECT_ALL, all);
all.setAction(new AbstractAction("All files")
origin: jsettlers/settlers-remake

/**
 * Create a checkbox menu item
 * 
 * @param action
 *            The target action
 * 
 * @return JMenuItem
 */
private JMenuItem createCheckboxMenuItemForAction(final Action action) {
  final JCheckBoxMenuItem it = new JCheckBoxMenuItem();
  it.setAction(action);
  it.addChangeListener(e -> {
    Object oldValue = action.getValue(EditorFrame.CHECKBOX_VALUE);
    if (oldValue != null && oldValue.equals(it.isSelected())) {
      return;
    }
    action.putValue(EditorFrame.CHECKBOX_VALUE, it.isSelected());
    action.actionPerformed(new ActionEvent(it, 0, "changed"));
  });
  action.addPropertyChangeListener(evt -> {
    if (EditorFrame.CHECKBOX_VALUE.equals(evt.getPropertyName())) {
      Boolean checked = (Boolean) evt.getNewValue();
      if (it.isSelected() != checked) {
        it.setSelected(checked);
      }
    }
  });
  return it;
}
origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

final void showPopup (Point p) {
  JMenuItem helpItem=new JMenuItem();
  JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem();
  JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem();
  JCheckBoxMenuItem descriptionItem = new JCheckBoxMenuItem();
  JPopupMenu popup = new JPopupMenu();
  unsortedItem.setSelected(getSortingMode() == UNSORTED);
  sortNamesItem.setSelected(getSortingMode() == SORTED_BY_NAMES);
  helpAction.checkContext();
  helpItem.setAction(helpAction);
  sortNamesItem.setAction (new MutableAction (MutableAction.SORT_NAMES, this));
  unsortedItem.setAction (new MutableAction (MutableAction.UNSORT, this));
  descriptionItem.setAction (new MutableAction (MutableAction.SHOW_DESCRIPTION, this));
  descriptionItem.setSelected (isDescriptionVisible());
  popup.add (unsortedItem);
  popup.add (sortNamesItem);
  popup.add (new JSeparator());
  popup.add (descriptionItem);
  popup.add (new JSeparator());
  popup.add (helpItem);
  popup.show(psheet, p.x, p.y);
}
origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

final void showPopup (Point p) {
  JMenuItem helpItem=new JMenuItem();
  JRadioButtonMenuItem sortNamesItem = new JRadioButtonMenuItem();
  JRadioButtonMenuItem unsortedItem = new JRadioButtonMenuItem();
  JCheckBoxMenuItem descriptionItem = new JCheckBoxMenuItem();
  JPopupMenu popup = new JPopupMenu();
  unsortedItem.setSelected(getSortingMode() == UNSORTED);
  sortNamesItem.setSelected(getSortingMode() == SORTED_BY_NAMES);
  helpAction.checkContext();
  helpItem.setAction(helpAction);
  sortNamesItem.setAction (new MutableAction (MutableAction.SORT_NAMES, this));
  unsortedItem.setAction (new MutableAction (MutableAction.UNSORT, this));
  descriptionItem.setAction (new MutableAction (MutableAction.SHOW_DESCRIPTION, this));
  descriptionItem.setSelected (isDescriptionVisible());
  popup.add (unsortedItem);
  popup.add (sortNamesItem);
  popup.add (new JSeparator());
  popup.add (descriptionItem);
  popup.add (new JSeparator());
  popup.add (helpItem);
  popup.show(psheet, p.x, p.y);
}
origin: org.netbeans.api/org-openide-explorer

sortNamesItem.setAction(new MutableAction(MutableAction.SORT_NAMES, this));
unsortedItem.setAction(new MutableAction(MutableAction.UNSORT, this));
descriptionItem.setAction(new MutableAction(MutableAction.SHOW_DESCRIPTION, this));
descriptionItem.setSelected(isDescriptionVisible());
defaultValueItem.setAction(new MutableAction(MutableAction.RESTORE_DEFAULT, this));
origin: cpesch/RouteConverter

  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);
  }
}
origin: org.netbeans.api/org-netbeans-modules-bugtracking

chbShowFinished.setAction(action);
boolean showFinishedTasks = DashboardSettings.getInstance().showFinishedTasks();
chbShowFinished.setSelected(showFinishedTasks);
chbToday.setAction(showTodayAction);
boolean showTodaySchedule = DashboardSettings.getInstance().showSchedule(TODAY_SETTING_ID);
chbToday.setSelected(showTodaySchedule);
    chbThisWeek
);
chbThisWeek.setAction(showThisWeekAction);
boolean showThisWeekSchedule = DashboardSettings.getInstance().showSchedule(THIS_WEEK_SETTING_ID);
chbThisWeek.setSelected(showThisWeekSchedule);
    chbAll
);
chbAll.setAction(showAllAction);
boolean showAllSchedule = DashboardSettings.getInstance().showSchedule(ALL_SETTING_ID);
chbAll.setSelected(showAllSchedule);
origin: igvteam/igv

JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem();
menuItem.setSelected(isShowing);
menuItem.setAction(menuAction);
menuItems.add(menuItem);
origin: mucommander/mucommander

checkBoxMenuItem.setAction(recallWindowAction);
javax.swingJCheckBoxMenuItemsetAction

Popular methods of JCheckBoxMenuItem

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • startActivity (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JButton (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
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