public void adjustListMenuBar() { JMenuItem menuItem; Action act; String itemLabel; boolean enableState; boolean inEditState; boolean allowAdds; ICFInternetTopDomainObj selectedObj = getSwingFocusAsTopDomain(); CFJPanel.PanelMode mode = getPanelMode(); if (mode == CFJPanel.PanelMode.Edit) { inEditState = true; if (getSwingContainer() != null) { allowAdds = true; } else { allowAdds = false; } } else { inEditState = false; allowAdds = false; } if (selectedObj == null) { enableState = false; } else { enableState = true; } if (actionViewSelected != null) { actionViewSelected.setEnabled(enableState); } if (actionEditSelected != null) { actionEditSelected.setEnabled(inEditState && enableState); } if (actionDeleteSelected != null) { actionDeleteSelected.setEnabled(inEditState && enableState); } if (actionAddTopDomain != null) { actionAddTopDomain.setEnabled(allowAdds); } if (menuAdd != null) { menuAdd.setEnabled(allowAdds); } if (menuSelected != null) { menuSelected.setEnabled(enableState); int itemCount = menuSelected.getItemCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { menuItem = menuSelected.getItem(itemIdx); act = menuItem.getAction(); if (act != null) { if (act == actionViewSelected) { menuItem.setEnabled(enableState); } else if (act == actionEditSelected) { menuItem.setEnabled(inEditState && enableState); } else if (act == actionDeleteSelected) { menuItem.setEnabled(inEditState && enableState); } } } } }
public JMenuBar getPanelMenuBar() { if (panelMenuBar == null) { JMenuItem menuItem; ICFLibAnyObj container = getSwingContainer(); panelMenuBar = new JMenuBar(); menuAdd = new JMenu("Add"); actionAddTopDomain = new ActionAddTopDomain(); if (container instanceof ICFInternetTldObj) { menuItem = new JMenuItem(actionAddTopDomain); menuAdd.add(menuItem); } if (getSwingContainer() != null) { panelMenuBar.add(menuAdd); } menuSelected = new JMenu("Selected"); menuSelected.setEnabled(false); actionViewSelected = new ViewSelectedActionTopDomain(); menuItem = new JMenuItem(actionViewSelected); menuSelected.add(menuItem); actionEditSelected = new EditSelectedActionTopDomain(); menuItem = new JMenuItem(actionEditSelected); menuSelected.add(menuItem); actionDeleteSelected = new DeleteSelectedActionTopDomain(); menuItem = new JMenuItem(actionDeleteSelected); menuSelected.add(menuItem); panelMenuBar.add(menuSelected); } return (panelMenuBar); }
public void adjustFinderMenuBar() { JMenuItem menuItem; Action act; String itemLabel; ICFSecurityISOTimezoneObj 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); } } } } }
public JMenuBar getFrameMenuBar() { if (frameMenuBar == null) { JMenuItem menuItem; frameMenuBar = new JMenuBar(); menuFile = new JMenu("File"); actionEdit = new ActionEdit(); menuItem = new JMenuItem(actionEdit); menuFile.add(menuItem); actionSave = new ActionSave(); menuItem = new JMenuItem(actionSave); menuFile.add(menuItem); actionClose = new ActionClose(); menuItem = new JMenuItem(actionClose); menuFile.add(menuItem); actionDelete = new ActionDelete(); menuItem = new JMenuItem(actionDelete); menuFile.add(menuItem); frameMenuBar.add(menuFile); } return (frameMenuBar); }
public JMenuBar getPanelMenuBar() { if (panelMenuBar == null) { JMenuItem menuItem; ICFLibAnyObj container = getSwingContainer(); panelMenuBar = new JMenuBar(); menuAdd = new JMenu("Add"); actionAddTextCol = new ActionAddTextCol(); if (container instanceof ICFDbTestTableObj) { menuItem = new JMenuItem(actionAddTextCol); menuAdd.add(menuItem); } actionAddTextType = new ActionAddTextType(); if (container instanceof ICFDbTestSchemaDefObj) { menuItem = new JMenuItem(actionAddTextType); menuAdd.add(menuItem); } if (getSwingContainer() != null) { panelMenuBar.add(menuAdd); } menuSelected = new JMenu("Selected"); menuSelected.setEnabled(false); actionViewSelected = new ViewSelectedActionTextDef(); menuItem = new JMenuItem(actionViewSelected); menuSelected.add(menuItem); actionEditSelected = new EditSelectedActionTextDef(); menuItem = new JMenuItem(actionEditSelected); menuSelected.add(menuItem); actionDeleteSelected = new DeleteSelectedActionTextDef(); menuItem = new JMenuItem(actionDeleteSelected); menuSelected.add(menuItem); panelMenuBar.add(menuSelected); } return (panelMenuBar); }
public JMenuBar getFinderMenuBar() { if (finderMenuBar == null) { JMenuItem menuItem; finderMenuBar = new JMenuBar(); menuFile = new JMenu("File"); actionAddISOTimezone = new ActionAddISOTimezone(); menuItem = new JMenuItem(actionAddISOTimezone); menuFile.add(menuItem); actionViewSelected = new ActionViewSelectedISOTimezone(); menuItem = new JMenuItem(actionViewSelected); menuFile.add(menuItem); actionEditSelected = new ActionEditSelectedISOTimezone(); menuItem = new JMenuItem(actionEditSelected); menuFile.add(menuItem); actionDeleteSelected = new ActionDeleteSelectedISOTimezone(); menuItem = new JMenuItem(actionDeleteSelected); menuFile.add(menuItem); actionClose = new ActionClose(); menuItem = new JMenuItem(actionClose); menuFile.add(menuItem); finderMenuBar.add(menuFile); } return (finderMenuBar); }