Skip to content

Commit

Permalink
Rework preview logic. Fixes #4923
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed May 4, 2019
1 parent f1b4b5b commit 2bab5d5
Show file tree
Hide file tree
Showing 22 changed files with 583 additions and 569 deletions.
11 changes: 4 additions & 7 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.jabref.gui.maintable.MainTableDataModel;
import org.jabref.gui.mergeentries.MergeEntriesAction;
import org.jabref.gui.mergeentries.MergeWithFetchedEntryAction;
import org.jabref.gui.preview.PreviewPanel;
import org.jabref.gui.specialfields.SpecialFieldDatabaseChangeListener;
import org.jabref.gui.specialfields.SpecialFieldValueViewModel;
import org.jabref.gui.specialfields.SpecialFieldViewModel;
Expand All @@ -67,7 +68,7 @@
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableRemoveEntry;
import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.gui.worker.CitationStyleToClipboardWorker;
import org.jabref.gui.preview.CitationStyleToClipboardWorker;
import org.jabref.gui.worker.SendAsEMailAction;
import org.jabref.logic.citationstyle.CitationStyleCache;
import org.jabref.logic.citationstyle.CitationStyleOutputFormat;
Expand Down Expand Up @@ -188,7 +189,7 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas

this.entryEditor = new EntryEditor(this, preferences.getEntryEditorPreferences(), Globals.getFileUpdateMonitor(), dialogService, externalFileTypes, Globals.TASK_EXECUTOR);

this.preview = new PreviewPanel(this, getBibDatabaseContext(), preferences.getKeyBindings(), preferences.getPreviewPreferences(), dialogService, externalFileTypes);
this.preview = new PreviewPanel(getBibDatabaseContext(), this, dialogService, externalFileTypes, Globals.getKeyPrefs(), preferences.getPreviewPreferences());
frame().getGlobalSearchBar().getSearchQueryHighlightObservable().addSearchListener(preview);
}

Expand Down Expand Up @@ -954,7 +955,7 @@ public void entryEditorClosing(EntryEditor editor) {
*/
public void ensureNotShowingBottomPanel(BibEntry entry) {
if (((mode == BasePanelMode.SHOWING_EDITOR) && (entryEditor.getEntry() == entry))
|| ((mode == BasePanelMode.SHOWING_PREVIEW) && (preview.getEntry() == entry))) {
|| ((mode == BasePanelMode.SHOWING_PREVIEW))) {
closeBottomPane();
}
}
Expand Down Expand Up @@ -1140,10 +1141,6 @@ public CitationStyleCache getCitationStyleCache() {
return citationStyleCache;
}

public PreviewPanel getPreviewPanel() {
return preview;
}

public FileAnnotationCache getAnnotationCache() {
return annotationCache;
}
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/org/jabref/gui/EntryContainer.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public void init() {
}
globalSearchBar.setSearchTerm(content);

currentBasePanel.getPreviewPanel().updateLayout(Globals.prefs.getPreviewPreferences());

// groupSidePane.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(GroupSidePane.class));
//previewToggle.setSelected(Globals.prefs.getPreviewPreferences().isPreviewPanelEnabled());
//generalFetcher.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(WebSearchPane.class));
Expand Down
Loading

0 comments on commit 2bab5d5

Please sign in to comment.