Skip to content
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

[WIP] Conversion of Preferences/preview to mvvm #5062

Merged
merged 27 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7fa909e
Added previewTab
calixtus Jun 16, 2019
b182687
Merge remote-tracking branch 'upstream/master' into preferences_previ…
calixtus Jun 16, 2019
b64d49a
Refactor minor issues
calixtus Jun 17, 2019
0f989cc
Added scrolling to letter pressed
calixtus Jun 17, 2019
decd903
Refactored layout, TextBasedPreviewStyle editable
calixtus Jun 19, 2019
7814c22
Fix languages for travis
calixtus Jun 19, 2019
4201ba3
Fixed updating PreviewPane, refactoring
calixtus Jun 20, 2019
2984cad
Added advanced searching in ListView
calixtus Jun 21, 2019
343045f
Fixed default button and refactoring
calixtus Jun 21, 2019
d3486eb
Merge remote-tracking branch 'upstream/master' into preferences_previ…
calixtus Jun 21, 2019
ba375ba
Fixes and refactoring
calixtus Jun 24, 2019
5df18fa
Fix getText in Layout
calixtus Jun 24, 2019
9db93db
Added dragndrop between lists, multiple selection, fixes and refactoring
calixtus Jun 25, 2019
12b3c93
Merge remote-tracking branch 'upstream/master' into preferences_previ…
calixtus Jul 2, 2019
488ef2e
Refactor, cleanup and fixes
calixtus Jul 2, 2019
cdd4988
Refactor, drag'n'drop sorting in chosen with single selection
calixtus Jul 2, 2019
9c69bda
Fixes, added drag'n'drop sorting with multiple selection
calixtus Jul 7, 2019
aad6e47
Merge remote-tracking branch 'upstream/master' into preferences_previ…
calixtus Jul 7, 2019
e1dc129
Added Validator and some minor optimizations
calixtus Jul 8, 2019
eb05d01
Added l10n
calixtus Jul 8, 2019
70cebaf
Comments
calixtus Jul 8, 2019
72d93d5
Refactor minor things and some rewording
calixtus Jul 10, 2019
81359af
Merge remote-tracking branch 'upstream/master' into preferences_previ…
calixtus Jul 10, 2019
c3773cd
Refactor mistake
calixtus Jul 10, 2019
4b275a6
Removed icon in context-menu and fixed PreviewViewer-width
calixtus Jul 17, 2019
61e4e8c
Added default NoSelectionModel in ViewModel
calixtus Jul 17, 2019
5b3f983
Refactor fxml and view
calixtus Jul 17, 2019
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
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/gui/DragAndDropDataFormats.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import javafx.scene.input.DataFormat;

import org.jabref.logic.citationstyle.PreviewLayout;
import org.jabref.model.entry.BibEntry;

/**
Expand All @@ -15,5 +16,6 @@ public class DragAndDropDataFormats {
public static final DataFormat LINKED_FILE = new DataFormat("dnd/org.jabref.model.entry.LinkedFile");
public static final DataFormat ENTRIES = new DataFormat("dnd/org.jabref.model.entry.BibEntries");
@SuppressWarnings("unchecked") public static final Class<List<BibEntry>> BIBENTRY_LIST_CLASS = (Class<List<BibEntry>>) (Class<?>) List.class;

public static final DataFormat PREVIEWLAYOUTS = new DataFormat("dnd/org.jabref.logic.citationstyle.PreviewLayouts");
@SuppressWarnings("unchecked") public static final Class<List<PreviewLayout>> PREVIEWLAYOUT_LIST_CLASS = (Class<List<PreviewLayout>>) (Class<?>) List.class;
}
46 changes: 45 additions & 1 deletion src/main/java/org/jabref/gui/preferences/PreferencesDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-fx-background: -fx-control-inner-background;
}

.split-pane-divider {
.split-pane > .split-pane-divider {
-fx-padding: 0 4 0 4;
-fx-background-color: transparent;
}
Expand All @@ -26,3 +26,47 @@
*:search-highlight {
-fx-background-color: -jr-light-red;
}

.code-area {
-fx-padding: 0;
-fx-border-width: 1;
-fx-background-color: transparent;
-fx-border-color: -fx-outer-border;
}

.code-area .tagmark {
-fx-fill: gray;
}

.code-area .anytag {
-fx-fill: crimson;
}

.code-area .paren {
-fx-fill: firebrick;
-fx-font-weight: bold;
}

.code-area .attribute {
-fx-fill: darkviolet;
}

.code-area .avalue {
-fx-fill: black;
}

.code-area .comment {
-fx-fill: teal;
}

.code-area .highlight-keyword {
-fx-text-fill: -jr-purple;
}

.code-area .context-menu {
-fx-font-family: sans-serif;
}

.code-area .context-menu .menu-item {
-fx-padding: 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public PreferencesDialogViewModel(DialogService dialogService, TaskExecutor task
preferenceTabs.add(new FileTabView(prefs));
preferenceTabs.add(new TablePrefsTab(prefs));
preferenceTabs.add(new TableColumnsTab(prefs, frame));
preferenceTabs.add(new PreviewPreferencesTab(dialogService, this.taskExecutor));
preferenceTabs.add(new PreviewTabView(prefs));
preferenceTabs.add(new ExternalTabView(prefs, frame));
preferenceTabs.add(new GroupsPrefsTab(prefs));
preferenceTabs.add(new EntryEditorPrefsTab(prefs));
Expand Down
231 changes: 0 additions & 231 deletions src/main/java/org/jabref/gui/preferences/PreviewPreferencesTab.java

This file was deleted.

78 changes: 78 additions & 0 deletions src/main/java/org/jabref/gui/preferences/PreviewTab.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<?import org.fxmisc.richtext.CodeArea?>

<?import org.fxmisc.flowless.VirtualizedScrollPane?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>

<fx:root prefWidth="650.0" spacing="4.0" type="VBox" xmlns="http://javafx.com/javafx/8.0.212"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.preferences.PreviewTabView">
<children>
<Label text="%Current Preview" styleClass="titleHeader"/>
<HBox prefHeight="100.0" prefWidth="200.0" spacing="4.0">
<children>
<VBox spacing="4.0" HBox.hgrow="ALWAYS">
<children>
<Label text="%Available" styleClass="sectionHeader"/>
<ListView fx:id="availableListView" maxHeight="250.0" minHeight="250.0"/>
</children>
</VBox>
<VBox alignment="CENTER" spacing="4.0">
<children>
<Label styleClass="sectionHeader"/>
<Button fx:id="toRightButton" prefWidth="60.0" text="&gt;&gt;" onAction="#toRightButtonAction"/>
<Button fx:id="toLeftButton" prefWidth="60.0" text="&lt;&lt;" onAction="#toLeftButtonAction"/>
<VBox prefHeight="40.0"/>
<Button fx:id="sortUpButton" prefWidth="60.0" text="%Up" onAction="#sortUpButtonAction"/>
<Button fx:id="sortDownButton" prefWidth="60.0" text="%Down" onAction="#sortDownButtonAction"/>
</children>
</VBox>
<VBox spacing="4.0" HBox.hgrow="ALWAYS">
<children>
<Label text="%Selected" styleClass="sectionHeader"/>
<ListView fx:id="chosenListView" maxHeight="250.0" minHeight="250.0"/>
</children>
</VBox>
</children>
</HBox>
<AnchorPane>
<children>
<TabPane prefHeight="250.0" prefWidth="650.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab text="%Preview">
<content>
<ScrollPane fx:id="previewPane"/>
</content>
</Tab>
<Tab text="%Edit">
<content>
<VirtualizedScrollPane>
<content>
<CodeArea fx:id="editArea"/>
</content>
</VirtualizedScrollPane>
</content>
</Tab>
</tabs>
</TabPane>
<HBox alignment="CENTER_RIGHT" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="2.0" spacing="5.0">
<children>
<Label fx:id="readOnlyLabel" text="%Read only"/>
<Button
fx:id="resetDefaultButton" text="%Reset default preview style"
onAction="#resetDefaultButtonAction"/>
</children>
</HBox>
</children>
</AnchorPane>
</children>
</fx:root>
Loading