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

How to use
getActionCommand
method
in
javax.swing.JCheckBoxMenuItem

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

origin: chewiebug/GCViewer

  /**
   * Returns MenuItem, which is associated with "WATCH" action command.
   * 
   * @return "WATCH" menu item
   */
  public JCheckBoxMenuItem getWatchMenuItem() {
    for (Component component : fileMenu.getMenuComponents()) {
      if (component instanceof JCheckBoxMenuItem
        && ((JCheckBoxMenuItem) component).getActionCommand().equals(ActionCommands.WATCH.toString())) {
        
        return (JCheckBoxMenuItem) component;
      }
    }
    
    throw new IllegalStateException("StayOpenCheckBoxMenuItem with actionCommand '" + ActionCommands.WATCH + "' not found");
  }
}
origin: chewiebug/GCViewer

/**
 * Copies values that are stored in menu items into <code>GCPreferences</code> instance.
 * 
 * @param gui source to copy values from
 * @return <code>GCPreferences</code> with current values
 */
private GCPreferences copyPreferencesFromGui(GCViewerGui gui) {
  GCPreferences preferences = gui.getPreferences();
  for (Entry<String, JCheckBoxMenuItem> menuEntry : ((GCViewerGuiMenuBar)gui.getJMenuBar()).getViewMenuItems().entrySet()) {
    JCheckBoxMenuItem item = menuEntry.getValue();
    preferences.setGcLineProperty(item.getActionCommand(), item.getState());
  }
  preferences.setWindowWidth(gui.getWidth());
  preferences.setWindowHeight(gui.getHeight());
  preferences.setWindowX(gui.getX());
  preferences.setWindowY(gui.getY());
  OpenFile openFileAction = (OpenFile)gui.getActionMap().get(ActionCommands.OPEN_FILE.toString());
  if (openFileAction.getLastSelectedFiles().length != 0) {
    preferences.setLastFile(openFileAction.getLastSelectedFiles()[0].getAbsolutePath());
  }
  
  // recent files
  List<String> recentFileList = new LinkedList<String>();
  for (GCResourceGroup urlSet : ((GCViewerGuiMenuBar) gui.getJMenuBar()).getRecentGCResourcesModel().getResourceNameGroups()) {    
    recentFileList.add(urlSet.getUrlGroupString());
  }
  preferences.setRecentFiles(recentFileList);
  
  return preferences;
}
origin: org.fudaa.framework.ctulu/ctulu-bu

public static void setCheckedForAction
 (JCheckBoxMenuItem _item, String _action, boolean _state)
{
 if(_item==null) return;
 if(_item.getActionCommand().equals(_action))
  _item.setSelected(_state);
}
origin: com.mgmtp.gcviewer/gcviewer

JCheckBoxMenuItem item = menuEntry.getValue();
item.setState(preferences.getGcLineProperty(menuEntry.getKey()));
viewMenuActionListener.actionPerformed(new ActionEvent(item, 0, item.getActionCommand()));
origin: com.mgmtp.gcviewer/gcviewer

private void storePreferences(GCPreferences preferences) {
  for (Entry<String, JCheckBoxMenuItem> menuEntry : gcLineMenuItems.entrySet()) {
    JCheckBoxMenuItem item = menuEntry.getValue();
    preferences.setGcLineProperty(item.getActionCommand(), item.getState());
  }
  preferences.setWindowWidth(getWidth());
  preferences.setWindowHeight(getHeight());
  preferences.setWindowX(getX());
  preferences.setWindowY(getY());
  if (openFileAction.getLastSelectedFiles().length != 0) {
    preferences.setLastFile(openFileAction.getLastSelectedFiles()[0].getAbsolutePath());
  }
  
  // recent files
  List<String> recentFileList = new LinkedList<String>();
  for (Component recentMenuItem : recentURLsMenu.getMenuComponents()) {
    final OpenRecent openRecent = (OpenRecent)((JMenuItem)recentMenuItem).getAction();
    final URL[] urls = openRecent.getURLs();
    final StringBuffer sb = new StringBuffer();
    for (int j=0; j<urls.length; j++) {
      sb.append(urls[j]);
      sb.append(';');
    }
    recentFileList.add(sb.toString());
  }
  preferences.setRecentFiles(recentFileList);
  
  preferences.store();
}
origin: com.googlecode.vfsjfilechooser2/vfsjfilechooser2

private void updateViewMenu()
{
  if (viewMenu != null)
  {
    Component[] components = viewMenu.getMenuComponents();
    for (Component component : components)
    {
      if (component instanceof JRadioButtonMenuItem)
      {
        JRadioButtonMenuItem mi = (JRadioButtonMenuItem) component;
        if (((ViewTypeAction) mi.getAction()).viewType == viewType)
        {
          mi.setSelected(true);
        }
      }
      else if (component instanceof JCheckBoxMenuItem) 
      {
        JCheckBoxMenuItem mi = (JCheckBoxMenuItem) component;
        if (mi.getActionCommand().equals(ACTION_VIEW_HIDDEN))
         mi.setSelected(getFileChooser().isFileHidingEnabled());
      }
    }
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

  if (c instanceof JCheckBoxMenuItem) {
    JCheckBoxMenuItem item = (JCheckBoxMenuItem) c;
    String cmd = item.getActionCommand();
    if (cmd.equals("resize")) {
      item.setSelected(activeViewer.isRelayoutOnResize());
if (c instanceof JCheckBoxMenuItem) {
  JCheckBoxMenuItem item = (JCheckBoxMenuItem) c;
  String cmd = item.getActionCommand();
  if (cmd.equals("satellite")) {
    item.setSelected(ViewMenuAction.isSatelliteShown());
javax.swingJCheckBoxMenuItemgetActionCommand

Popular methods of JCheckBoxMenuItem

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Path (java.nio.file)
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JCheckBox (javax.swing)
  • JTextField (javax.swing)
  • Top PhpStorm plugins
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