Example usage for javax.swing JMenuItem setEnabled

List of usage examples for javax.swing JMenuItem setEnabled

Introduction

In this page you can find the example usage for javax.swing JMenuItem setEnabled.

Prototype

@BeanProperty(preferred = true, description = "The enabled state of the component.")
public void setEnabled(boolean b) 

Source Link

Document

Enables or disables the menu item.

Usage

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashSwing.CFGCashSwingSecAppFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   w ww.j a  v a 2 s.  c  om*/
    String itemLabel;
    ICFGCashSecAppObj 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.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingISOCountryFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   ww  w .  ja va  2  s. c o  m*/
    String itemLabel;
    ICFSecurityISOCountryObj 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.cfensyntax.v2_2.CFEnSyntaxSwing.CFEnSyntaxSwingEnHeadFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   w  ww . ja va2  s.c o m*/
    String itemLabel;
    ICFEnSyntaxEnHeadObj selectedObj = getSwingFocusAsEnHead();
    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 (actionAddEnHead != null) {
        actionAddEnHead.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 == actionAddEnHead) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingAccountFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   w ww .  j a  v a 2 s . c  o m*/
    String itemLabel;
    ICFAccAccountObj selectedObj = getSwingFocusAsAccount();
    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 (actionAddAccount != null) {
        actionAddAccount.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 == actionAddAccount) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashSwing.CFGCashSwingClusterFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*  ww  w .  j a  va 2 s .  c  o m*/
    String itemLabel;
    ICFGCashClusterObj 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.CFAsteriskSwingSysClusterFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;//from www. ja v  a  2 s  .  c o  m
    String itemLabel;
    ICFSecuritySysClusterObj selectedObj = getSwingFocusAsSysCluster();
    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 (actionAddSysCluster != null) {
        actionAddSysCluster.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 == actionAddSysCluster) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingISOLanguageFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   www. j av a 2  s.c o  m*/
    String itemLabel;
    ICFInternetISOLanguageObj 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.cfinternet.v2_0.CFInternetSwing.CFInternetSwingServiceTypeFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from w  w  w.ja  va  2s .c o m*/
    String itemLabel;
    ICFInternetServiceTypeObj 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.cfacc.v2_0.CFAccSwing.CFAccSwingMimeTypeFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;//from   w w  w.java  2 s  .c  o m
    String itemLabel;
    ICFAccMimeTypeObj selectedObj = getSwingFocusAsMimeType();
    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 (actionAddMimeType != null) {
        actionAddMimeType.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 == actionAddMimeType) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingMimeTypeFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*www  .j  a  v  a  2 s  .  c  o m*/
    String itemLabel;
    ICFAstMimeTypeObj selectedObj = getSwingFocusAsMimeType();
    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 (actionAddMimeType != null) {
        actionAddMimeType.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 == actionAddMimeType) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}