List of usage examples for javax.swing JMenuItem setEnabled
@BeanProperty(preferred = true, description = "The enabled state of the component.") public void setEnabled(boolean b)
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingISOTimezoneFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;// w w w .ja va 2 s . c o m String itemLabel; ICFAstISOTimezoneObj selectedObj = getSwingFocusAsISOTimezone(); 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 (actionAddISOTimezone != null) { actionAddISOTimezone.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 == actionAddISOTimezone) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingServiceTypeFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//www .j a v a 2s . c om String itemLabel; ICFAstServiceTypeObj selectedObj = getSwingFocusAsServiceType(); 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 (actionAddServiceType != null) { actionAddServiceType.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 == actionAddServiceType) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingURLProtocolFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/* w ww .j av a2 s . co m*/ String itemLabel; ICFAstURLProtocolObj selectedObj = getSwingFocusAsURLProtocol(); 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 (actionAddURLProtocol != null) { actionAddURLProtocol.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 == actionAddURLProtocol) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_0.CFFswSwing.CFFswSwingISOLanguageFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;// w w w .j a va 2s . co m String itemLabel; ICFFswISOLanguageObj selectedObj = getSwingFocusAsISOLanguage(); 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 (actionAddISOLanguage != null) { actionAddISOLanguage.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 == actionAddISOLanguage) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_0.CFFswSwing.CFFswSwingURLProtocolFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;// www . ja va 2 s . c o m String itemLabel; ICFFswURLProtocolObj selectedObj = getSwingFocusAsURLProtocol(); 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 (actionAddURLProtocol != null) { actionAddURLProtocol.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 == actionAddURLProtocol) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswSwing.CFFswSwingISOTimezoneFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/*from w ww . ja v a 2 s.c om*/ String itemLabel; ICFFswISOTimezoneObj selectedObj = getSwingFocusAsISOTimezone(); 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 (actionAddISOTimezone != null) { actionAddISOTimezone.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 == actionAddISOTimezone) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_1.CFEnSyntaxSwing.CFEnSyntaxSwingISOCountryFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//from w ww .j a va2 s. c o m String itemLabel; ICFEnSyntaxISOCountryObj selectedObj = getSwingFocusAsISOCountry(); 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 (actionAddISOCountry != null) { actionAddISOCountry.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 == actionAddISOCountry) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingContactListFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;//from w w w . j a va2s . co m String itemLabel; ICFAccContactListObj selectedObj = getSwingFocusAsContactList(); 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 (actionAddContactList != null) { actionAddContactList.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 == actionAddContactList) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxSwing.CFEnSyntaxSwingEnAuxiliaryFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;/* ww w. j ava2s. co m*/ String itemLabel; ICFEnSyntaxEnAuxiliaryObj selectedObj = getSwingFocusAsEnAuxiliary(); 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 (actionAddEnAuxiliary != null) { actionAddEnAuxiliary.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 == actionAddEnAuxiliary) { menuItem.setEnabled(true); } } } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingAccountConfigFinderJInternalFrame.java
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act;// w w w . java 2 s . c om String itemLabel; ICFAccAccountConfigObj selectedObj = getSwingFocusAsAccountConfig(); 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 (actionAddAccountConfig != null) { actionAddAccountConfig.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 == actionAddAccountConfig) { menuItem.setEnabled(true); } } } } }