-
-
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 #3591 from JabRef/javafxTable
Maintable leaves the Swing year and comes back in a new JavaFX dress
- Loading branch information
Showing
155 changed files
with
3,511 additions
and
3,138 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,80 @@ | ||
package org.jabref.gui; | ||
|
||
import javafx.beans.property.DoubleProperty; | ||
import javafx.beans.property.SimpleDoubleProperty; | ||
|
||
import org.jabref.Globals; | ||
import org.jabref.gui.autocompleter.AutoCompletePreferences; | ||
import org.jabref.gui.entryeditor.EntryEditorPreferences; | ||
import org.jabref.gui.keyboard.KeyBindingRepository; | ||
import org.jabref.gui.maintable.MainTablePreferences; | ||
import org.jabref.preferences.JabRefPreferences; | ||
import org.jabref.preferences.PreviewPreferences; | ||
|
||
import org.fxmisc.easybind.EasyBind; | ||
|
||
public class BasePanelPreferences { | ||
private MainTablePreferences tablePreferences; | ||
private AutoCompletePreferences autoCompletePreferences; | ||
private EntryEditorPreferences entryEditorPreferences; | ||
private KeyBindingRepository keyBindings; | ||
private PreviewPreferences previewPreferences; | ||
private DoubleProperty entryEditorDividerPosition = new SimpleDoubleProperty(); | ||
|
||
public BasePanelPreferences(MainTablePreferences tablePreferences, AutoCompletePreferences autoCompletePreferences, EntryEditorPreferences entryEditorPreferences, KeyBindingRepository keyBindings, PreviewPreferences previewPreferences, Double entryEditorDividerPosition) { | ||
this.tablePreferences = tablePreferences; | ||
this.autoCompletePreferences = autoCompletePreferences; | ||
this.entryEditorPreferences = entryEditorPreferences; | ||
this.keyBindings = keyBindings; | ||
this.previewPreferences = previewPreferences; | ||
this.entryEditorDividerPosition.setValue(entryEditorDividerPosition); | ||
} | ||
|
||
public static BasePanelPreferences from(JabRefPreferences preferences) { | ||
BasePanelPreferences basePanelPreferences = new BasePanelPreferences( | ||
MainTablePreferences.from(preferences), | ||
preferences.getAutoCompletePreferences(), | ||
EntryEditorPreferences.from(preferences), | ||
Globals.getKeyPrefs(), | ||
preferences.getPreviewPreferences(), | ||
preferences.getDouble(JabRefPreferences.ENTRY_EDITOR_HEIGHT)); | ||
EasyBind.subscribe(basePanelPreferences.entryEditorDividerPosition, value -> preferences.putDouble(JabRefPreferences.ENTRY_EDITOR_HEIGHT, value.doubleValue())); | ||
return basePanelPreferences; | ||
} | ||
|
||
public double getEntryEditorDividerPosition() { | ||
return entryEditorDividerPosition.get(); | ||
} | ||
|
||
public void setEntryEditorDividerPosition(double entryEditorDividerPosition) { | ||
this.entryEditorDividerPosition.set(entryEditorDividerPosition); | ||
} | ||
|
||
public DoubleProperty entryEditorDividerPositionProperty() { | ||
return entryEditorDividerPosition; | ||
} | ||
|
||
public MainTablePreferences getTablePreferences() { | ||
return tablePreferences; | ||
} | ||
|
||
public AutoCompletePreferences getAutoCompletePreferences() { | ||
return autoCompletePreferences; | ||
} | ||
|
||
public void setAutoCompletePreferences(AutoCompletePreferences autoCompletePreferences) { | ||
this.autoCompletePreferences = autoCompletePreferences; | ||
} | ||
|
||
public EntryEditorPreferences getEntryEditorPreferences() { | ||
return entryEditorPreferences; | ||
} | ||
|
||
public KeyBindingRepository getKeyBindings() { | ||
return keyBindings; | ||
} | ||
|
||
public PreviewPreferences getPreviewPreferences() { | ||
return previewPreferences; | ||
} | ||
} |
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
Oops, something went wrong.