Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.penapereira.example.constructs.app.properties.Messages;
import com.penapereira.example.constructs.app.ui.MainWindow;

import lombok.RequiredArgsConstructor;

@Component
@RequiredArgsConstructor
public class AppCommandLineRunner implements CommandLineRunner {
private static Logger log = LoggerFactory.getLogger(AppCommandLineRunner.class);

@Autowired
MainWindow main;

@Autowired
Messages msg;
private final MainWindow main;
private final Messages msg;

@Override
public void run(String... args) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,24 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import com.penapereira.example.constructs.app.properties.ApplicationProperties;
import com.penapereira.example.constructs.app.properties.Messages;

import lombok.RequiredArgsConstructor;

@Component
@RequiredArgsConstructor
public class ExamplesCommandLineRunner implements CommandLineRunner {

private static final Logger log = LoggerFactory.getLogger(ExamplesCommandLineRunner.class);

@Autowired
private ApplicationContext ctx;

@Autowired
Messages msg;

@Autowired
ApplicationProperties props;
private final ApplicationContext ctx;
private final Messages msg;
private final ApplicationProperties props;

@Override
public void run(String... args) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
import lombok.RequiredArgsConstructor;

@Component
@RequiredArgsConstructor
public class GuiAppender extends AppenderBase<ILoggingEvent> implements InitializingBean {

@Autowired
private MainWindow mainWindow;
private final OutputSink output;

@Override
public void afterPropertiesSet() throws Exception {
Expand All @@ -25,6 +25,6 @@ public void afterPropertiesSet() throws Exception {

@Override
protected void append(ILoggingEvent eventObject) {
EventQueue.invokeLater(() -> mainWindow.appendOutput(eventObject.getFormattedMessage() + System.lineSeparator()));
EventQueue.invokeLater(() -> output.appendOutput(eventObject.getFormattedMessage() + System.lineSeparator()));
}
}
Loading