-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert OO/LO SidePanel to javafx (#4341)
* Convert OO/LO SidePanel to javafx First attempt at converting the OpenOffice side panel * rework first part of select style dialog * add icon to delete style add edit function implement rest of logic * store settings, show path load last selected style subscribe preview panel to changes * update from scence builder * fix ok button wrap preview panel in vbox * add title for canceable progess dialog rework manual connect rework settings popup initialize oo prefs to avoid NPE remove old style dialog * formatting * Create custom dialog which returns a dialog object fix preference storage fix manual path select * pass keybinding repo as dependency * add new dialog for advanced cite todo: find out how to change the values * reload preferences in connect fix passing of prefs fix advanced cite dialog * fix checkstyle add some dialog basics for manage citatiosn * further implement viewModel * implement viewModel fix l10n parts TODO: editing of extra info does not yet work * remove submodule * Display Manage citations as TextFlow in the table Allow editing of page info directly in the table Replace html bold with Text-Bold style * fix checkstyle * rework page info remove old dialog fix l10n set titles add tooltips * use flowpane instead of textflow to prevent table row height increasing * cleanup and fix codacy issues * rework dialogs rework future handling in detect OO installation * rework constructor and rename to CitationEntryViewModel move gui getText to view * fix checkstyle and l10n issues * fix order * fix style file select layout and inline variable' * Add Book as preview as well * change mac default settings to LO path * checkstyle * fix merge error * first part of refactoring * refactor and remove/fix obsolete tests put visible/managed bindings in fxml * Fixes #4576 Store show/hide info of panel in preferences * use progessbar from fxdialogs TODO: Fix execution in fx thread * Fix autodetecting open office paths in background thread Fix saving of settings after auto connect Add notification when connections are cleared remove custom dialog hack * fix checkstyle
- Loading branch information
1 parent
48c5a20
commit 18aba35
Showing
34 changed files
with
1,443 additions
and
1,571 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
30 changes: 30 additions & 0 deletions
30
src/main/java/org/jabref/gui/openoffice/AdvancedCiteDialog.fxml
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,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.ButtonType?> | ||
<?import javafx.scene.control.DialogPane?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.RadioButton?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.control.ToggleGroup?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<DialogPane prefHeight="182.0" prefWidth="390.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.openoffice.AdvancedCiteDialogView"> | ||
<content> | ||
<VBox> | ||
<fx:define> | ||
<ToggleGroup fx:id="citeToggleGroup" /> | ||
</fx:define> | ||
<children> | ||
<RadioButton fx:id="inPar" minWidth="-Infinity" mnemonicParsing="false" text="%Cite selected entries between parenthesis" toggleGroup="$citeToggleGroup" /> | ||
<RadioButton fx:id="inText" minWidth="-Infinity" mnemonicParsing="false" text="%Cite selected entries with in-text citation" toggleGroup="$citeToggleGroup" /> | ||
<Label minWidth="-Infinity" text="%Extra information (e.g. page number)" /> | ||
<TextField fx:id="pageInfo" /> | ||
</children> | ||
</VBox> | ||
</content> | ||
<buttonTypes> | ||
<ButtonType fx:constant="CANCEL" /> | ||
<ButtonType fx:constant="OK" /> | ||
</buttonTypes> | ||
</DialogPane> |
113 changes: 0 additions & 113 deletions
113
src/main/java/org/jabref/gui/openoffice/AdvancedCiteDialog.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/main/java/org/jabref/gui/openoffice/AdvancedCiteDialogView.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,46 @@ | ||
package org.jabref.gui.openoffice; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.ButtonType; | ||
import javafx.scene.control.RadioButton; | ||
import javafx.scene.control.TextField; | ||
import javafx.scene.control.ToggleGroup; | ||
|
||
import org.jabref.gui.util.BaseDialog; | ||
import org.jabref.logic.l10n.Localization; | ||
|
||
import com.airhacks.afterburner.views.ViewLoader; | ||
|
||
public class AdvancedCiteDialogView extends BaseDialog<AdvancedCiteDialogViewModel> { | ||
|
||
@FXML private TextField pageInfo; | ||
@FXML private RadioButton inPar; | ||
@FXML private RadioButton inText; | ||
@FXML private ToggleGroup citeToggleGroup; | ||
private AdvancedCiteDialogViewModel viewModel; | ||
|
||
public AdvancedCiteDialogView() { | ||
|
||
ViewLoader.view(this) | ||
.load() | ||
.setAsDialogPane(this); | ||
setResultConverter(btn -> { | ||
if (btn == ButtonType.OK) { | ||
return viewModel; | ||
} | ||
return null; | ||
}); | ||
|
||
setTitle(Localization.lang("Cite special")); | ||
} | ||
|
||
@FXML | ||
private void initialize() { | ||
viewModel = new AdvancedCiteDialogViewModel(); | ||
|
||
inPar.selectedProperty().bindBidirectional(viewModel.citeInParProperty()); | ||
inText.selectedProperty().bindBidirectional(viewModel.citeInTextProperty()); | ||
pageInfo.textProperty().bindBidirectional(viewModel.pageInfoProperty()); | ||
|
||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/org/jabref/gui/openoffice/AdvancedCiteDialogViewModel.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.openoffice; | ||
|
||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.beans.property.SimpleStringProperty; | ||
import javafx.beans.property.StringProperty; | ||
|
||
public class AdvancedCiteDialogViewModel { | ||
|
||
private final StringProperty pageInfo = new SimpleStringProperty(""); | ||
private final BooleanProperty citeInPar = new SimpleBooleanProperty(); | ||
private final BooleanProperty citeInText = new SimpleBooleanProperty(); | ||
|
||
public StringProperty pageInfoProperty() { | ||
return pageInfo; | ||
} | ||
|
||
public BooleanProperty citeInParProperty() { | ||
return citeInPar; | ||
} | ||
|
||
public BooleanProperty citeInTextProperty() { | ||
return citeInText; | ||
} | ||
} |
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
40 changes: 40 additions & 0 deletions
40
src/main/java/org/jabref/gui/openoffice/CitationEntryViewModel.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,40 @@ | ||
package org.jabref.gui.openoffice; | ||
|
||
import javafx.beans.property.SimpleStringProperty; | ||
import javafx.beans.property.StringProperty; | ||
|
||
import org.jabref.logic.openoffice.CitationEntry; | ||
|
||
public class CitationEntryViewModel { | ||
|
||
private final StringProperty citation = new SimpleStringProperty(""); | ||
private final StringProperty extraInformation = new SimpleStringProperty(""); | ||
private final String refMarkName; | ||
|
||
public CitationEntryViewModel(String refMarkName, String citation, String extraInfo) { | ||
this.refMarkName = refMarkName; | ||
this.citation.setValue(citation); | ||
this.extraInformation.setValue(extraInfo); | ||
} | ||
|
||
public CitationEntryViewModel(CitationEntry citationEntry) { | ||
this(citationEntry.getRefMarkName(), citationEntry.getContext(), citationEntry.getPageInfo().orElse("")); | ||
} | ||
|
||
public CitationEntry toCitationEntry() { | ||
return new CitationEntry(refMarkName, citation.getValue(), extraInformation.getValue()); | ||
} | ||
|
||
public StringProperty citationProperty() { | ||
return citation; | ||
} | ||
|
||
public StringProperty extraInformationProperty() { | ||
return extraInformation; | ||
} | ||
|
||
public void setExtraInfo(String extraInfo) { | ||
extraInformation.setValue(extraInfo); | ||
} | ||
|
||
} |
Oops, something went wrong.