Пример #1
0
 @Override
 protected void okAction() {
   if (saveInsuree()) {
     Logger.logDebug("Saved Insuree.");
     dispose();
   } else {
     Logger.logWarn("Could not save Insuree. Please try again.");
   }
 }
Пример #2
0
 @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);
   }
 }
Пример #3
0
 @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);
   }
 }
Пример #4
0
 @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();
 }
Пример #5
0
 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());
   }
 }
Пример #6
0
 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());
 }
Пример #7
0
  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);
    }
  }
Пример #8
0
 private boolean saveInsuree() {
   Logger.logDebug("Saving Insuree Data.");
   return m_EditInsureeView.saveSettings();
 }