Skip to content

Commit a0a61ba

Browse files
authored
Merge pull request #1 from MrSnou/refactor/viewClasses
Refactor and CI added, reorganize view classes/files
2 parents d5f4f9a + 64c564e commit a0a61ba

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

.github/workflows/maven.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Java CI
2+
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: Set up JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '25'
18+
distribution: 'temurin'
19+
20+
- name: Build with Maven
21+
run: mvn clean test

src/main/java/com/project/authapi/system_log_analyzer/SystemLogAnalyzerApp.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package com.project.authapi.system_log_analyzer;
22

3+
import com.project.authapi.system_log_analyzer.controller.WelcomeViewFXController;
34
import javafx.application.Application;
45
import javafx.fxml.FXMLLoader;
56
import javafx.scene.Parent;
67
import javafx.scene.Scene;
78
import javafx.stage.Stage;
8-
import org.springframework.boot.autoconfigure.SpringBootApplication;
99
import org.springframework.boot.builder.SpringApplicationBuilder;
1010
import org.springframework.context.ConfigurableApplicationContext;
1111

12-
@SpringBootApplication
1312
public class SystemLogAnalyzerApp extends Application {
1413

1514
private ConfigurableApplicationContext springContext;
@@ -21,9 +20,9 @@ public void init() {
2120

2221
@Override
2322
public void start(Stage primaryStage) throws Exception {
24-
FXMLLoader loader = new FXMLLoader(getClass().getResource("/WelcomeView.fxml"));
23+
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/WelcomeView.fxml"));
2524
loader.setControllerFactory(springContext::getBean);
26-
loader.setController(springContext.getBean(com.project.authapi.system_log_analyzer.controller.LogAnalyzerFXController.class));
25+
loader.setController(springContext.getBean(WelcomeViewFXController.class));
2726
Parent root = loader.load();
2827

2928
Scene scene = new Scene(root);

src/main/java/com/project/authapi/system_log_analyzer/controller/LoadingBarFXController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected List<LogEvent> call() throws Exception {
7070

7171
var springContext = com.project.authapi.system_log_analyzer.config.ApplicationContextProvider.getApplicationContext();
7272

73-
FXMLLoader loader = new FXMLLoader(getClass().getResource("/MainWindow.fxml"));
73+
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/MainWindow.fxml"));
7474
loader.setControllerFactory(springContext::getBean);
7575
Parent root = loader.load();
7676

src/main/java/com/project/authapi/system_log_analyzer/controller/LogAnalyzerFXController.java renamed to src/main/java/com/project/authapi/system_log_analyzer/controller/WelcomeViewFXController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.io.IOException;
2323

2424
@Component
25-
public class LogAnalyzerFXController {
25+
public class WelcomeViewFXController {
2626
@FXML private Button scanButton;
2727
@FXML private TextField logFilesDirField;
2828
@FXML private TextField reportDirField;
@@ -55,7 +55,7 @@ private void scan(ActionEvent event) throws IOException {
5555

5656
ApplicationContext springContext = ApplicationContextProvider.getApplicationContext();
5757

58-
FXMLLoader loader = new FXMLLoader(getClass().getResource("/LoadingScreen.fxml"));
58+
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/LoadingScreen.fxml"));
5959
loader.setControllerFactory(springContext::getBean); // <-- magiczna linia
6060
Parent root = loader.load();
6161

File renamed without changes.

0 commit comments

Comments
 (0)