use of com.att.aro.ui.view.SharedAttributesProcesses.TabPanels in project VideoOptimzer by attdevsupport.
the class AROFileMenu method menuSelected.
/**
* Need to determine whether the print option is enabled or not when menu is opened.
*/
@Override
public void menuSelected(MenuEvent event) {
TabPanels currentTabPanel = parent.getCurrentTabPanel();
printItem.setEnabled(currentTabPanel == TabPanels.tab_panel_best_practices || currentTabPanel == TabPanels.tab_panel_statistics);
}
use of com.att.aro.ui.view.SharedAttributesProcesses.TabPanels in project VideoOptimzer by attdevsupport.
the class AROFileMenu method getMenu.
/**
* @return
*/
public JMenu getMenu() {
if (fileMenu == null) {
fileMenu = new JMenu(ResourceBundleHelper.getMessageString(MenuItem.menu_file));
fileMenu.setMnemonic(KeyEvent.VK_UNDEFINED);
fileMenu.addActionListener(this);
fileMenu.addMenuListener(this);
fileMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_file_open));
fileMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_file_open_time_range));
fileMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_file_pcap));
recentMenu = menuAdder.getMenuInstance(ResourceBundleHelper.getMessageString("menu.file.recent"));
recentMenu.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
boolean getRecentMenuItems = false;
Map<String, String> recentItemsMap = Util.getRecentOpenMenuItems();
if (recentMenuItems.isEmpty() || recentMenuItems.size() != recentItemsMap.size()) {
getRecentMenuItems = true;
}
if (!getRecentMenuItems) {
Iterator<String> iterator = recentItemsMap.keySet().iterator();
for (String key : recentMenuItems.keySet()) {
String keyValue = iterator.hasNext() ? iterator.next() : null;
if (!recentMenuItems.get(key).equals(recentItemsMap.get(keyValue))) {
getRecentMenuItems = true;
break;
}
}
}
if (getRecentMenuItems) {
recentMenuItems = recentItemsMap;
recentMenu.removeAll();
for (Map.Entry<String, String> entry : recentMenuItems.entrySet()) {
JMenuItem menuItem = menuAdder.getMenuItemInstance(entry.getValue(), ResourceBundleHelper.getMessageString("menu.file.recent"));
menuItem.setToolTipText(entry.getKey());
recentMenu.add(menuItem);
}
}
}
});
fileMenu.add(recentMenu);
fileMenu.addSeparator();
fileMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_file_pref));
fileMenu.addSeparator();
printItem = menuAdder.getMenuItemInstance(MenuItem.menu_file_print);
TabPanels tabbedPanel = parent.getCurrentTabPanel();
printItem.setEnabled(tabbedPanel == TabPanels.tab_panel_best_practices || tabbedPanel == TabPanels.tab_panel_video_tab || tabbedPanel == TabPanels.tab_panel_statistics);
fileMenu.add(printItem);
fileMenu.addSeparator();
fileMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_file_exit));
}
return fileMenu;
}
Aggregations