List of usage examples for javax.swing JMenuItem getAction
public Action getAction()
Action
for this ActionEvent
source, or null
if no Action
is set. From source file:net.sf.nmedit.nomad.core.menulayout.MLEntry.java
public boolean isInstalled(JMenuItem item) { return item.getAction() == this; }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingClusterFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/*from w w w . j av a 2 s . co m*/ String itemLabel; ICFSecurityClusterObj selectedObj = getSwingFocusAsCluster(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } } } } }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmSwing.CFCrmSwingTldFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/* w w w . j a v a 2 s . com*/ String itemLabel; ICFCrmTldObj selectedObj = getSwingFocusAsTld(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddTld != null) { actionAddTld.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddTld) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingTldFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//ww w . j a va2 s .com String itemLabel; ICFInternetTldObj selectedObj = getSwingFocusAsTld(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddTld != null) { actionAddTld.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddTld) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmSwing.CFCrmSwingSecAppFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/*from w w w . j a va2 s. c o m*/ String itemLabel; ICFCrmSecAppObj selectedObj = getSwingFocusAsSecApp(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddSecApp != null) { actionAddSecApp.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddSecApp) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingTagFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/*from www.ja v a 2 s .c o m*/ String itemLabel; ICFAccTagObj selectedObj = getSwingFocusAsTag(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddTag != null) { actionAddTag.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddTag) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingTldFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//from w w w . jav a 2 s.co m String itemLabel; ICFAccTldObj selectedObj = getSwingFocusAsTld(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddTld != null) { actionAddTld.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddTld) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingTldFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//from w w w. j a va2s .c o m String itemLabel; ICFAstTldObj selectedObj = getSwingFocusAsTld(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddTld != null) { actionAddTld.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddTld) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmSwing.CFCrmSwingClusterFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/* w w w . j a v a 2 s . c om*/ String itemLabel; ICFCrmClusterObj selectedObj = getSwingFocusAsCluster(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddCluster != null) { actionAddCluster.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddCluster) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingSecAppFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/*from w w w .j ava2s. c o m*/ String itemLabel; ICFSecuritySecAppObj selectedObj = getSwingFocusAsSecApp(); boolean enableState; if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(enableState); } if (actionAddSecApp != null) { actionAddSecApp.setEnabled(true); } if (menuFile != null) { int itemCount = menuFile.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuFile.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(enableState); } else if (act == actionAddSecApp) { menuItem.setEnabled(true); } } } } }