@Override protected void okAction() { if (saveInsuree()) { Logger.logDebug("Saved Insuree."); dispose(); } else { Logger.logWarn("Could not save Insuree. Please try again."); } }
@Override public void write(byte[] buf, int off, int len) { super.write(buf, off, len); String text = new String(buf, off, len).trim(); if (!text.equals("") && !text.equals("\n")) { Logger.log("From Console: " + text, level, null); } }
@Override public void write(byte[] b) throws IOException { super.write(b); String text = new String(b).trim(); if (!text.equals("") && !text.equals("\n")) { Logger.log("From Console: " + text, level, null); } }
@Override public void actionPerformed(ActionEvent e) { Logger.logDebug("Showing Edit Insuree Dialog."); if (m_InsureeEditor == null) { m_InsureeEditor = new InsureeEditor(TITLE, m_Frame); } m_EditInsureeView.loadSettings(); m_InsureeEditor.showDialog(); }
private void addHTML(String html) { synchronized (kit) { try { kit.insertHTML(doc, doc.getLength(), html, 0, 0, null); } catch (BadLocationException | IOException ignored) { Logger.logError(ignored.getMessage(), ignored); } displayArea.setCaretPosition(displayArea.getDocument().getLength()); } }
private synchronized void refreshLogs() { doc = new HTMLDocument(); displayArea.setDocument(doc); List<LogEntry> entries = Logger.getLogEntries(); StringBuilder logHTML = new StringBuilder(); for (LogEntry entry : entries) { logHTML.append(getMessage(entry)); } addHTML(logHTML.toString()); }
private void createUIComponents() { displayArea = new JEditorPane("text/html", ""); displayArea.setEditable(false); kit = new HTMLEditorKit(); displayArea.setEditorKit(kit); JScrollPane scrollPane = new JScrollPane(displayArea); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); logType = ELogType.valueOf(SettingsUtils.getValue(ESetting.LOGTYPE)); refreshLogs(); Logger.addListener(this); System.setOut(new OutputOverride(System.out, LogLevel.INFO)); System.setErr(new OutputOverride(System.err, LogLevel.ERROR)); try { Logger.addListener(new LogWriter(new File(launcherLogFile))); } catch (IOException e1) { Logger.logError(e1.getMessage(), e1); } }
private boolean saveInsuree() { Logger.logDebug("Saving Insuree Data."); return m_EditInsureeView.saveSettings(); }