/** * Opens a file in the MRU list. */ protected void requestOpenMRU(ActionEvent e) { String file = e.getActionCommand(); StringTokenizer st = new StringTokenizer(file); String num = st.nextToken().trim(); file = st.nextToken("\n"); try { int index = Integer.parseInt(num) - 1; InputStream in = _mruFileManager.getInputStream(index); LogFileParser lfp = new LogFileParser(in); lfp.parse(this); _mruFileManager.moveToTop(index); updateMRUList(); } catch (Exception me) { LogFactor5ErrorDialog error = new LogFactor5ErrorDialog( getBaseFrame(), "Unable to load file " + file); } }
/** * Loads and parses a log file. */ protected boolean loadLogFile(File file) { boolean ok = false; try { LogFileParser lfp = new LogFileParser(file); lfp.parse(this); ok = true; } catch (IOException e) { LogFactor5ErrorDialog error = new LogFactor5ErrorDialog( getBaseFrame(), "Error reading " + file.getName()); } return ok; }
/** * Loads a parses a log file running on a server. */ protected boolean loadLogFile(URL url) { boolean ok = false; try { LogFileParser lfp = new LogFileParser(url.openStream()); lfp.parse(this); ok = true; } catch (IOException e) { LogFactor5ErrorDialog error = new LogFactor5ErrorDialog( getBaseFrame(), "Error reading URL:" + url.getFile()); } return ok; }