Example usage for javax.swing JMenuItem getAction

List of usage examples for javax.swing JMenuItem getAction

Introduction

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

Prototype

public Action getAction() 

Source Link

Document

Returns the currently set Action for this ActionEvent source, or null if no Action is set.

Usage

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

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;//from   w  w w .j av a 2  s  .c o m
    String itemLabel;
    ICFAccURLProtocolObj 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.cfasterisk.v2_0.CFAstSwing.CFAstSwingAuditActionFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from w  w  w. j av  a  2  s . c om*/
    String itemLabel;
    ICFAstAuditActionObj selectedObj = getSwingFocusAsAuditAction();
    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 (actionAddAuditAction != null) {
        actionAddAuditAction.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 == actionAddAuditAction) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

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

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;//from w ww.  j  a  va2 s .c om
    String itemLabel;
    ICFAstISOCurrencyObj selectedObj = getSwingFocusAsISOCurrency();
    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 (actionAddISOCurrency != null) {
        actionAddISOCurrency.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 == actionAddISOCurrency) {
                    menuItem.setEnabled(true);
                }
            }
        }
    }
}

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

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*from   w  w  w.ja v  a 2  s. c om*/
    String itemLabel;
    ICFAstISOLanguageObj 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.cfasterisk.v2_0.CFAstSwing.CFAstSwingISOTimezoneFinderJInternalFrame.java

public void adjustFinderMenuBar() {
    JMenuItem menuItem;
    Action act;/*  ww  w. j a v a  2 s. com*/
    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;//from   w w  w  .ja  v a2  s .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;/*  ww w.j a v a 2s  .  c o 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;//from  w  ww.  j av a2 s.c  o 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;//from ww w.j  a  v  a2 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);
                }
            }
        }
    }
}