-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9533 from JabRef/addSourceToChangesDialog
Add source to changes dialog
- Loading branch information
Showing
23 changed files
with
300 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/main/java/org/jabref/gui/collab/entryadd/EntryAddDetailsView.java
This file was deleted.
Oops, something went wrong.
55 changes: 46 additions & 9 deletions
55
src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,61 @@ | ||
package org.jabref.gui.collab.entrychange; | ||
|
||
import javafx.geometry.Orientation; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.control.SplitPane; | ||
import javafx.scene.control.TabPane; | ||
import javafx.scene.layout.VBox; | ||
|
||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.StateManager; | ||
import org.jabref.gui.collab.DatabaseChangeDetailsView; | ||
import org.jabref.gui.preview.PreviewViewer; | ||
import org.jabref.gui.theme.ThemeManager; | ||
import org.jabref.logic.l10n.Localization; | ||
import org.jabref.model.database.BibDatabaseContext; | ||
import org.jabref.model.entry.BibEntry; | ||
import org.jabref.model.entry.BibEntryTypesManager; | ||
import org.jabref.preferences.PreferencesService; | ||
|
||
import com.tobiasdiez.easybind.EasyBind; | ||
|
||
public final class EntryChangeDetailsView extends DatabaseChangeDetailsView { | ||
public EntryChangeDetailsView(EntryChange entryChange, BibDatabaseContext bibDatabaseContext, DialogService dialogService, StateManager stateManager, ThemeManager themeManager, PreferencesService preferencesService) { | ||
PreviewViewer previewViewer = new PreviewViewer(bibDatabaseContext, dialogService, stateManager, themeManager); | ||
previewViewer.setLayout(preferencesService.getPreviewPreferences().getSelectedPreviewLayout()); | ||
previewViewer.setEntry(entryChange.getNewEntry()); | ||
private final PreviewWithSourceTab oldPreviewWithSourcesTab = new PreviewWithSourceTab(); | ||
private final PreviewWithSourceTab newPreviewWithSourcesTab = new PreviewWithSourceTab(); | ||
|
||
public EntryChangeDetailsView(BibEntry oldEntry, BibEntry newEntry, BibDatabaseContext databaseContext, DialogService dialogService, StateManager stateManager, ThemeManager themeManager, PreferencesService preferencesService, BibEntryTypesManager entryTypesManager, PreviewViewer previewViewer) { | ||
Label inJabRef = new Label(Localization.lang("In JabRef")); | ||
inJabRef.getStyleClass().add("lib-change-header"); | ||
Label onDisk = new Label(Localization.lang("On disk")); | ||
onDisk.getStyleClass().add("lib-change-header"); | ||
|
||
// we need a copy here as we otherwise would set the same entry twice | ||
PreviewViewer previewClone = new PreviewViewer(databaseContext, dialogService, stateManager, themeManager); | ||
|
||
TabPane oldEntryTabPane = oldPreviewWithSourcesTab.getPreviewWithSourceTab(oldEntry, databaseContext, preferencesService, entryTypesManager, previewClone, Localization.lang("Entry Preview")); | ||
TabPane newEntryTabPane = newPreviewWithSourcesTab.getPreviewWithSourceTab(newEntry, databaseContext, preferencesService, entryTypesManager, previewViewer, Localization.lang("Entry Preview")); | ||
|
||
EasyBind.subscribe(oldEntryTabPane.getSelectionModel().selectedIndexProperty(), selectedIndex -> { | ||
newEntryTabPane.getSelectionModel().select(selectedIndex.intValue()); | ||
}); | ||
|
||
EasyBind.subscribe(newEntryTabPane.getSelectionModel().selectedIndexProperty(), selectedIndex -> { | ||
if (oldEntryTabPane.getSelectionModel().getSelectedIndex() != selectedIndex.intValue()) { | ||
oldEntryTabPane.getSelectionModel().select(selectedIndex.intValue()); | ||
} | ||
}); | ||
|
||
VBox containerOld = new VBox(inJabRef, oldEntryTabPane); | ||
VBox containerNew = new VBox(onDisk, newEntryTabPane); | ||
|
||
SplitPane split = new SplitPane(containerOld, containerNew); | ||
split.setOrientation(Orientation.HORIZONTAL); | ||
|
||
setLeftAnchor(previewViewer, 8d); | ||
setTopAnchor(previewViewer, 8d); | ||
setRightAnchor(previewViewer, 8d); | ||
setBottomAnchor(previewViewer, 8d); | ||
setLeftAnchor(split, 8d); | ||
setTopAnchor(split, 8d); | ||
setRightAnchor(split, 8d); | ||
setBottomAnchor(split, 8d); | ||
|
||
getChildren().setAll(previewViewer); | ||
this.getChildren().add(split); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/org/jabref/gui/collab/entrychange/EntryWithPreviewAndSourceDetailsView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jabref.gui.collab.entrychange; | ||
|
||
import javafx.scene.control.TabPane; | ||
|
||
import org.jabref.gui.collab.DatabaseChangeDetailsView; | ||
import org.jabref.gui.preview.PreviewViewer; | ||
import org.jabref.model.database.BibDatabaseContext; | ||
import org.jabref.model.entry.BibEntry; | ||
import org.jabref.model.entry.BibEntryTypesManager; | ||
import org.jabref.preferences.PreferencesService; | ||
|
||
public final class EntryWithPreviewAndSourceDetailsView extends DatabaseChangeDetailsView { | ||
|
||
private final PreviewWithSourceTab previewWithSourceTab = new PreviewWithSourceTab(); | ||
|
||
public EntryWithPreviewAndSourceDetailsView(BibEntry entry, BibDatabaseContext bibDatabaseContext, PreferencesService preferencesService, BibEntryTypesManager entryTypesManager, PreviewViewer previewViewer) { | ||
TabPane tabPanePreviewCode = previewWithSourceTab.getPreviewWithSourceTab(entry, bibDatabaseContext, preferencesService, entryTypesManager, previewViewer); | ||
setLeftAnchor(tabPanePreviewCode, 8d); | ||
setTopAnchor(tabPanePreviewCode, 8d); | ||
setRightAnchor(tabPanePreviewCode, 8d); | ||
setBottomAnchor(tabPanePreviewCode, 8d); | ||
|
||
getChildren().setAll(tabPanePreviewCode); | ||
} | ||
} |
Oops, something went wrong.