chore(pom.xml): update version to 1.0.30

feat(StorageServiceAutoConfiguration): add FileSelectionDialogModule bean configuration

refactor(FileSelectionDialogModule): remove unnecessary annotations and use constructor injection
This commit is contained in:
extio-de
2026-09-26 14:58:31 +02:00
parent c852848ca4
commit 36a9feff20
3 changed files with 29 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.extio</groupId> <groupId>de.extio</groupId>
<artifactId>game-engine</artifactId> <artifactId>game-engine</artifactId>
<version>1.0.29</version> <version>1.0.30</version>
<properties> <properties>
<java.version>25</java.version> <java.version>25</java.version>

View File

@@ -3,15 +3,29 @@ package de.extio.game_engine.storage;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import de.extio.game_engine.event.EventService;
import de.extio.game_engine.i18n.LocalizationService;
import de.extio.game_engine.renderer.work.RenderingBoPool;
import de.extio.game_engine.storage.dialog.FileSelectionDialogModule;
@AutoConfiguration @AutoConfiguration
@ConditionalOnProperty(name = "game-engine.storage.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(name = "game-engine.storage.enabled", havingValue = "true", matchIfMissing = true)
public class StorageServiceAutoConfiguration { public class StorageServiceAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
StorageService storageService() { StorageService storageService() {
return new StorageServiceImpl(); return new StorageServiceImpl();
} }
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(name = "game-engine.storage.dialog.enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(name = "game-engine.renderer.enabled", havingValue = "true", matchIfMissing = true)
FileSelectionDialogModule fileSelectionDialog(final ApplicationContext applicationContext, final EventService eventService, final LocalizationService localizationService, final RenderingBoPool renderingBoPool, final StorageService storageService) {
return new FileSelectionDialogModule(applicationContext, eventService, localizationService, renderingBoPool, storageService);
}
} }

View File

@@ -10,9 +10,7 @@ import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import de.extio.game_engine.event.Event; import de.extio.game_engine.event.Event;
import de.extio.game_engine.event.EventService; import de.extio.game_engine.event.EventService;
@@ -40,7 +38,6 @@ import de.extio.game_engine.storage.StorageItemDescriptor;
import de.extio.game_engine.storage.StorageResource; import de.extio.game_engine.storage.StorageResource;
import de.extio.game_engine.storage.StorageService; import de.extio.game_engine.storage.StorageService;
@Component
public class FileSelectionDialogModule extends AbstractClientModule { public class FileSelectionDialogModule extends AbstractClientModule {
public enum FileSelectionMode { public enum FileSelectionMode {
@@ -98,20 +95,23 @@ public class FileSelectionDialogModule extends AbstractClientModule {
private static final String BUTTON_CANCEL = "FileSelectionDialog_Button_Cancel"; private static final String BUTTON_CANCEL = "FileSelectionDialog_Button_Cancel";
@Autowired private final ApplicationContext applicationContext;
private ApplicationContext applicationContext;
@Autowired private final EventService eventService;
private EventService eventService;
@Autowired private final LocalizationService localizationService;
private LocalizationService localizationService;
@Autowired private final RenderingBoPool renderingBoPool;
private RenderingBoPool renderingBoPool;
@Autowired private final StorageService storageService;
private StorageService storageService;
public FileSelectionDialogModule(final ApplicationContext applicationContext, final EventService eventService, final LocalizationService localizationService, final RenderingBoPool renderingBoPool, final StorageService storageService) {
this.applicationContext = applicationContext;
this.eventService = eventService;
this.localizationService = localizationService;
this.renderingBoPool = renderingBoPool;
this.storageService = storageService;
}
private Window dialogWindow; private Window dialogWindow;