MCPcopy Create free account
hub / github.com/RipMeApp/ripme / appendLog

Method appendLog

src/main/java/com/rarchives/ripme/ui/MainWindow.java:1244–1257  ·  view source on GitHub ↗

Write a line to the Log section of the GUI @param text the string to log @param color the color of the line

(final String text, final Color color)

Source from the content-addressed store, hash-verified

1242 * @param color the color of the line
1243 */
1244 private void appendLog(final String text, final Color color) {
1245 SimpleAttributeSet sas = new SimpleAttributeSet();
1246 StyleConstants.setForeground(sas, color);
1247 StyledDocument sd = logText.getStyledDocument();
1248 try {
1249 synchronized (this) {
1250 sd.insertString(sd.getLength(), text + "\n", sas);
1251 }
1252 } catch (BadLocationException e) {
1253 LOGGER.warn(e.getMessage());
1254 }
1255
1256 logText.setCaretPosition(sd.getLength());
1257 }
1258
1259 /**
1260 * Write a line to the GUI log and the CLI log

Callers 3

setupHandlersMethod · 0.95
displayAndLogErrorMethod · 0.95
handleEventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected