Skip to content

Refactor IoC - A: Extract Entry Editor #12210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d124d79
Move EntryEditor to JabRefFrame
calixtus Nov 18, 2024
5bac391
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Nov 28, 2024
f247c7c
Make activeTab observable
calixtus Nov 30, 2024
760a736
Accept no tab
calixtus Nov 30, 2024
172b58f
Accept no tab in preview
calixtus Nov 30, 2024
21075bf
Migrate showBottomPane to property
calixtus Dec 2, 2024
d477fcc
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Dec 10, 2024
7a2ee1d
Show Editor
calixtus Dec 13, 2024
311c80d
Fix NPE
calixtus Dec 13, 2024
f2f8794
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Jan 11, 2025
4747d3e
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 11, 2025
655e005
Fixed not showing
calixtus Feb 11, 2025
0b8b226
Fix duplication of tabs and npe on exit
calixtus Feb 11, 2025
ac2f95e
Fix height
calixtus Feb 12, 2025
b386bf3
Fix menu item
calixtus Feb 12, 2025
6aa8bf5
Cleanup and streamline
calixtus Feb 12, 2025
02c3bab
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 12, 2025
8ad778f
Fix test
calixtus Feb 12, 2025
917d9f5
RewriteRun
calixtus Feb 12, 2025
2b13447
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 14, 2025
e188fa5
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 14, 2025
d6de2b3
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 16, 2025
310ab06
Dynamize databaseContext
calixtus Feb 16, 2025
8f76152
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Feb 24, 2025
b3b3b3c
Codestyle and todo
calixtus Feb 24, 2025
c948ad7
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Mar 19, 2025
b465bb6
Fix search sync
calixtus Mar 19, 2025
c45377d
Changed fixme comment
calixtus Mar 19, 2025
4cc3d97
Fixed runaway process and simplified DirectoryMonitor
calixtus Apr 2, 2025
5ab8da2
Fix PreviewViewer
calixtus Apr 3, 2025
1f54488
Dynamized SourceTab
calixtus Apr 3, 2025
c020bbd
Dynamized FileAnnotationTab
calixtus Apr 3, 2025
71a2176
Added todo comment for future rewrite of entry editor
calixtus Apr 3, 2025
fa23554
wip
calixtus Apr 6, 2025
4f5d316
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
calixtus Apr 15, 2025
24677ca
Fix tests
calixtus Apr 15, 2025
0ef19f2
Checkstyle
calixtus Apr 15, 2025
d6698ba
l10n and GuiTest
calixtus Apr 15, 2025
d3516f6
CleanUps
calixtus Apr 15, 2025
25fad58
more CleanUp
calixtus Apr 15, 2025
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
33 changes: 24 additions & 9 deletions src/main/java/org/jabref/gui/CoreGuiPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class CoreGuiPreferences {

private final BooleanProperty windowMaximised;

private final DoubleProperty sidePaneWidth;
private final DoubleProperty horizontalDividerPosition;
private final DoubleProperty verticalDividerPosition;

private final StringProperty lastSelectedIdBasedFetcher;

Expand All @@ -25,14 +26,16 @@ public CoreGuiPreferences(double positionX,
double sizeY,
boolean windowMaximised,
String lastSelectedIdBasedFetcher,
double sidePaneWidth) {
double horizontalDividerPosition,
double verticalDividerPosition) {
this.positionX = new SimpleDoubleProperty(positionX);
this.positionY = new SimpleDoubleProperty(positionY);
this.sizeX = new SimpleDoubleProperty(sizeX);
this.sizeY = new SimpleDoubleProperty(sizeY);
this.windowMaximised = new SimpleBooleanProperty(windowMaximised);
this.lastSelectedIdBasedFetcher = new SimpleStringProperty(lastSelectedIdBasedFetcher);
this.sidePaneWidth = new SimpleDoubleProperty(sidePaneWidth);
this.horizontalDividerPosition = new SimpleDoubleProperty(horizontalDividerPosition);
this.verticalDividerPosition = new SimpleDoubleProperty(verticalDividerPosition);
}

public double getPositionX() {
Expand Down Expand Up @@ -107,15 +110,27 @@ public void setLastSelectedIdBasedFetcher(String lastSelectedIdBasedFetcher) {
this.lastSelectedIdBasedFetcher.set(lastSelectedIdBasedFetcher);
}

public double getSidePaneWidth() {
return sidePaneWidth.get();
public double getHorizontalDividerPosition() {
return horizontalDividerPosition.get();
}

public DoubleProperty sidePaneWidthProperty() {
return sidePaneWidth;
public DoubleProperty horizontalDividerPositionProperty() {
return horizontalDividerPosition;
}

public void setSidePaneWidth(double sidePaneWidth) {
this.sidePaneWidth.set(sidePaneWidth);
public void setHorizontalDividerPosition(double horizontalDividerPosition) {
this.horizontalDividerPosition.set(horizontalDividerPosition);
}

public double getVerticalDividerPosition() {
return verticalDividerPosition.get();
}

public DoubleProperty getVerticalDividerPositionProperty() {
return verticalDividerPosition;
}

public void setVerticalDividerPosition(double dividerPosition) {
this.verticalDividerPosition.set(dividerPosition);
}
}
10 changes: 6 additions & 4 deletions src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.jabref.gui.remote.CLIMessageHandler;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.util.DefaultDirectoryMonitor;
import org.jabref.gui.util.DirectoryMonitor;
import org.jabref.gui.util.UiTaskExecutor;
import org.jabref.logic.UiCommand;
import org.jabref.logic.ai.AiService;
Expand All @@ -41,7 +41,6 @@
import org.jabref.logic.util.WebViewStore;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.DirectoryMonitor;
import org.jabref.model.util.FileUpdateMonitor;

import com.airhacks.afterburner.injection.Injector;
Expand Down Expand Up @@ -135,7 +134,7 @@ public void start(Stage stage) {
public void initialize() {
WebViewStore.init();

DirectoryMonitor directoryMonitor = new DefaultDirectoryMonitor();
DirectoryMonitor directoryMonitor = new DirectoryMonitor();
Injector.setModelOrService(DirectoryMonitor.class, directoryMonitor);

JabRefGUI.remoteListenerServerManager = new RemoteListenerServerManager();
Expand Down Expand Up @@ -265,7 +264,10 @@ private void openWindow() {
}

public void onShowing(WindowEvent event) {
Platform.runLater(() -> mainFrame.updateDividerPosition());
Platform.runLater(() -> {
mainFrame.updateHorizontalDividerPosition();
mainFrame.updateVerticalDividerPosition();
});

// Open last edited databases
if (uiCommands.stream().noneMatch(UiCommand.BlankWorkspace.class::isInstance)
Expand Down
Loading