diff --git a/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java b/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java index 57cd0a0184d..e4df98c5abe 100644 --- a/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java +++ b/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java @@ -16,7 +16,6 @@ import org.jabref.gui.ai.components.chatmessage.ChatMessageComponent; import org.jabref.logic.ai.chathistory.ChatMessage; import org.jabref.logic.l10n.Localization; -import org.jabref.preferences.WorkspacePreferences; import com.airhacks.afterburner.views.ViewLoader; diff --git a/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTab.java b/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTab.java index 0bf4a862886..25786655cf9 100644 --- a/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTab.java @@ -6,19 +6,13 @@ import javafx.scene.control.Tooltip; import org.jabref.gui.DialogService; -import org.jabref.gui.ai.components.aichat.AiChatComponent; import org.jabref.gui.ai.components.errorstate.ErrorStateComponent; import org.jabref.gui.ai.components.privacynotice.PrivacyNoticeComponent; import org.jabref.gui.entryeditor.EntryEditorPreferences; import org.jabref.gui.entryeditor.EntryEditorTab; -import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.TaskExecutor; import org.jabref.gui.util.UiTaskExecutor; import org.jabref.logic.ai.AiService; -import org.jabref.logic.ai.chat.AiChatLogic; -import org.jabref.logic.ai.chathistory.BibDatabaseChatHistory; -import org.jabref.logic.ai.chathistory.BibEntryChatHistory; -import org.jabref.logic.ai.chathistory.ChatMessage; import org.jabref.logic.ai.embeddings.EmbeddingsGenerationTask; import org.jabref.logic.ai.embeddings.events.FileIngestedEvent; import org.jabref.logic.citationkeypattern.CitationKeyGenerator; @@ -29,11 +23,8 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; -import org.jabref.preferences.WorkspacePreferences; import com.google.common.eventbus.Subscribe; -import dev.langchain4j.store.embedding.filter.MetadataFilterBuilder; -import org.slf4j.LoggerFactory; public class AiChatTab extends EntryEditorTab { private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTabWorking.java b/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTabWorking.java index 5892df95665..9c9d1c0f0ed 100644 --- a/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTabWorking.java +++ b/src/main/java/org/jabref/gui/entryeditor/aichattab/AiChatTabWorking.java @@ -4,8 +4,6 @@ import java.util.Optional; import javafx.scene.Node; -import javafx.scene.control.Tab; -import javafx.scene.layout.Pane; import org.jabref.gui.DialogService; import org.jabref.gui.ai.components.aichat.AiChatComponent; @@ -19,7 +17,6 @@ import org.jabref.logic.ai.embeddings.EmbeddingsGenerationTask; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; -import org.jabref.preferences.WorkspacePreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/frame/MainMenu.java b/src/main/java/org/jabref/gui/frame/MainMenu.java index e0b029086a9..87f90af6dc6 100644 --- a/src/main/java/org/jabref/gui/frame/MainMenu.java +++ b/src/main/java/org/jabref/gui/frame/MainMenu.java @@ -297,7 +297,7 @@ private void createMenu() { new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.REBUILD_FULLTEXT_SEARCH_INDEX, new RebuildFulltextSearchIndexAction(stateManager, frame::getCurrentLibraryTab, dialogService, preferencesService.getFilePreferences(), preferencesService.getAiPreferences(), taskExecutor)), + factory.createMenuItem(StandardActions.REBUILD_FULLTEXT_SEARCH_INDEX, new RebuildFulltextSearchIndexAction(stateManager, frame::getCurrentLibraryTab, dialogService, preferencesService.getFilePreferences(), taskExecutor)), factory.createMenuItem(StandardActions.REGENERATE_EMBEDDINGS_CACHE, new RegenerateEmbeddingsAction(stateManager, frame::getCurrentLibraryTab, dialogService, taskExecutor)), new SeparatorMenuItem(), diff --git a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java index 4c02de5ce7c..13fe90443a7 100644 --- a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java @@ -1,6 +1,5 @@ package org.jabref.gui.preferences.ai; -import java.util.Arrays; import java.util.List; import javafx.beans.property.BooleanProperty; diff --git a/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java b/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java index 80671fb1e93..3a686979b35 100644 --- a/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java +++ b/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java @@ -12,7 +12,6 @@ import org.jabref.logic.pdf.search.PdfIndexer; import org.jabref.logic.pdf.search.PdfIndexerManager; import org.jabref.model.database.BibDatabaseContext; -import org.jabref.preferences.AiPreferences; import org.jabref.preferences.FilePreferences; import org.slf4j.Logger; @@ -28,7 +27,6 @@ public class RebuildFulltextSearchIndexAction extends SimpleCommand { private final GetCurrentLibraryTab currentLibraryTab; private final DialogService dialogService; private final FilePreferences filePreferences; - private final AiPreferences aiPreferences; private final TaskExecutor taskExecutor; private BibDatabaseContext databaseContext; @@ -39,13 +37,11 @@ public RebuildFulltextSearchIndexAction(StateManager stateManager, GetCurrentLibraryTab currentLibraryTab, DialogService dialogService, FilePreferences filePreferences, - AiPreferences aiPreferences, TaskExecutor taskExecutor) { this.stateManager = stateManager; this.currentLibraryTab = currentLibraryTab; this.dialogService = dialogService; this.filePreferences = filePreferences; - this.aiPreferences = aiPreferences; this.taskExecutor = taskExecutor; this.executable.bind(needsDatabase(stateManager)); diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java index 05dd83bbd52..f00afb0640f 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java @@ -32,6 +32,10 @@ import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; import jakarta.inject.Inject; +/** + * This offers the user to connect to a remove SQL database. + * Moreover, it directly opens the shared database after successful connection. + */ public class SharedDatabaseLoginDialogView extends BaseDialog { @FXML private ComboBox databaseType; @FXML private TextField host; diff --git a/src/main/java/org/jabref/logic/ai/chat/AiChatLanguageModel.java b/src/main/java/org/jabref/logic/ai/chat/AiChatLanguageModel.java index f0726db5366..22f6e82288c 100644 --- a/src/main/java/org/jabref/logic/ai/chat/AiChatLanguageModel.java +++ b/src/main/java/org/jabref/logic/ai/chat/AiChatLanguageModel.java @@ -8,8 +8,8 @@ import org.jabref.logic.ai.chathistory.BibDatabaseChatHistory; import org.jabref.preferences.AiPreferences; -import dev.langchain4j.model.chat.ChatLanguageModel; import dev.langchain4j.memory.ChatMemory; +import dev.langchain4j.model.chat.ChatLanguageModel; import dev.langchain4j.model.openai.OpenAiChatModel; import org.h2.mvstore.MVStore; @@ -48,7 +48,7 @@ public Optional getChatLanguageModel() { } /** - * Update the underlying {@link ChatLanguageModel] by current {@link AiPreferences} parameters. + * Update the underlying {@link ChatLanguageModel} by current {@link AiPreferences} parameters. * When the model is updated, the chat messages are not lost. * See {@link AiChatLogic}, where messages are stored in {@link ChatMemory}, * and {@link BibDatabaseChatHistory}, where messages are stored in {@link MVStore}. diff --git a/src/main/java/org/jabref/logic/ai/embeddings/MVStoreEmbeddingStore.java b/src/main/java/org/jabref/logic/ai/embeddings/MVStoreEmbeddingStore.java index 3c982c92d7c..f37c5757faa 100644 --- a/src/main/java/org/jabref/logic/ai/embeddings/MVStoreEmbeddingStore.java +++ b/src/main/java/org/jabref/logic/ai/embeddings/MVStoreEmbeddingStore.java @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 62dcaa97e9f..ddeced08c35 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -130,7 +130,6 @@ import com.google.common.base.Splitter; import com.tobiasdiez.easybind.EasyBind; import jakarta.inject.Singleton; -import org.jspecify.annotations.Nullable; import org.jvnet.hk2.annotations.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory;