Search in sources :

Example 1 with BestPracticeResultsListener

use of com.att.aro.ui.model.listener.BestPracticeResultsListener in project VideoOptimzer by attdevsupport.

the class AROToolMenu method getMenu.

/**
 * @return the toolMenu
 */
public JMenu getMenu() {
    toolMenu = new JMenu(ResourceBundleHelper.getMessageString(MenuItem.menu_tools));
    toolMenu.setMnemonic(KeyEvent.VK_UNDEFINED);
    boolean isTracePathEmpty = true;
    isTracePathEmpty = isTracePathEmpty();
    if (Desktop.isDesktopSupported()) {
        toolMenu.add(getMenuItem(MenuItem.menu_tools_wireshark, isTracePathEmpty));
    }
    toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_timeRangeAnalysis));
    toolMenu.addSeparator();
    // xlsx/xls file name extension filter
    FileNameExtensionFilter xlsxFilter = new FileNameExtensionFilter(ResourceBundleHelper.getMessageString("fileChooser.desc.excel"), ResourceBundleHelper.getMessageString("fileChooser.contentType.xls"), ResourceBundleHelper.getMessageString("fileChooser.contentType.xlsx"));
    JMenu exportMenu = menuAdder.getMenuInstance(ResourceBundleHelper.getMessageString("menu.tools.resultExport"));
    exportMenu.add(getMenuItem(MenuItem.menu_tools_htmlExport, isTracePathEmpty));
    exportMenu.add(getMenuItem(MenuItem.menu_tools_jsonExport, isTracePathEmpty));
    // Excel export menu item
    JMenuItem excelExportMenuItem = getMenuItem(MenuItem.menu_tools_excelExport, isTracePathEmpty);
    excelExportMenuItem.addActionListener(new BestPracticeResultsListener(((MainFrame) parent).getController().getTheModel(), Lists.newArrayList(xlsxFilter), 0));
    exportMenu.add(excelExportMenuItem);
    toolMenu.add(exportMenu);
    JMenuItem exportExportMenuItem = getMenuItem(MenuItem.menu_tools_sessionsExport, isTracePathEmpty);
    exportExportMenuItem.addActionListener(new ExportSessionData((MainFrame) parent, Lists.newArrayList(xlsxFilter), 0));
    toolMenu.add(exportExportMenuItem);
    toolMenu.addSeparator();
    toolMenu.add(getMenuItem(MenuItem.menu_tools_editMetadata, isTracePathEmpty));
    toolMenu.addSeparator();
    toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_privateData));
    if (ResourceBundleHelper.getMessageString("preferences.test.env").equals(SettingsImpl.getInstance().getAttribute("env"))) {
        toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_getErrorMsg));
        toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_clearErrorMsg));
    }
    toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_videoParserWizard));
    if ("dev".equals(SettingsImpl.getInstance().getAttribute("env"))) {
        if (SettingsImpl.getInstance().getAttribute("traceHandlerURL") != null && SettingsImpl.getInstance().checkAttributeValue("env", "dev")) {
            toolMenu.addSeparator();
            toolMenu.add(getMenuItem(MenuItem.menu_tools_ms_uploadTraceDialog, isTracePathEmpty));
        }
    }
    return toolMenu;
}
Also used : FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) JMenuItem(javax.swing.JMenuItem) BestPracticeResultsListener(com.att.aro.ui.model.listener.BestPracticeResultsListener) JMenu(javax.swing.JMenu) MainFrame(com.att.aro.ui.view.MainFrame)

Aggregations

BestPracticeResultsListener (com.att.aro.ui.model.listener.BestPracticeResultsListener)1 MainFrame (com.att.aro.ui.view.MainFrame)1 JMenu (javax.swing.JMenu)1 JMenuItem (javax.swing.JMenuItem)1 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)1