/** * A change in the text fields. * * @param e the document event. */ private void documentChanged(DocumentEvent e) { if (e.getDocument().equals(fileCountField.getDocument())) { // set file count only if its un integer try { int newFileCount = Integer.valueOf(fileCountField.getText()); fileCountField.setForeground(Color.black); LoggingUtilsActivator.getPacketLoggingService() .getConfiguration() .setLogfileCount(newFileCount); } catch (Throwable t) { fileCountField.setForeground(Color.red); } } else if (e.getDocument().equals(fileSizeField.getDocument())) { // set file size only if its un integer try { int newFileSize = Integer.valueOf(fileSizeField.getText()); fileSizeField.setForeground(Color.black); LoggingUtilsActivator.getPacketLoggingService() .getConfiguration() .setLimit(newFileSize * 1000); } catch (Throwable t) { fileSizeField.setForeground(Color.red); } } }