Top Description Fields Constructors Methods
org.jabref.gui.preferences.preview

public Class PreviewTabViewModel

extends Object
implements PreferenceTabViewModel
Class Inheritance
All Implemented Interfaces
org.jabref.gui.preferences.PreferenceTabViewModel
Imports
java.nio.file.Path, java.util.ArrayList, .Collection, .Collections, .Comparator, .List, java.util.regex.Matcher, .Pattern, javafx.beans.property.BooleanProperty, .ListProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleListProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, javafx.collections.transformation.FilteredList, javafx.scene.control.MultipleSelectionModel, javafx.scene.input.ClipboardContent, .DragEvent, .Dragboard, .TransferMode, org.jabref.gui.DialogService, .DragAndDropDataFormats, .StateManager, org.jabref.gui.preferences.PreferenceTabViewModel, org.jabref.gui.util.BackgroundTask, .CustomLocalDragboard, .NoSelectionModel, .TaskExecutor, org.jabref.logic.bst.BstPreviewLayout, org.jabref.logic.citationstyle.CitationStyle, .CitationStylePreviewLayout, org.jabref.logic.l10n.Localization, org.jabref.logic.layout.TextBasedPreviewLayout, org.jabref.logic.preview.PreviewLayout, org.jabref.model.entry.BibEntryTypesManager, org.jabref.preferences.PreviewPreferences, com.airhacks.afterburner.injection.Injector, de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator, de.saxsys.mvvmfx.utils.validation.ValidationMessage, de.saxsys.mvvmfx.utils.validation.ValidationStatus, de.saxsys.mvvmfx.utils.validation.Validator, org.fxmisc.richtext.model.StyleSpans, org.fxmisc.richtext.model.StyleSpansBuilder, org.slf4j.Logger, .LoggerFactory

This class is Preferences -> Entry Preview tab model

PreviewTab is the controller of Entry Preview tab

See Also
PreviewTab

Field Summary

Modifier and TypeField and Description
private final ListProperty<PreviewLayout>
private final ObjectProperty<MultipleSelectionModel<PreviewLayout>>
private final ListProperty<Path>
private final ListProperty<PreviewLayout>
private final de.saxsys.mvvmfx.utils.validation.Validator
private final ObjectProperty<MultipleSelectionModel<PreviewLayout>>
private final DialogService
private ListProperty<PreviewLayout>
private ObjectProperty<MultipleSelectionModel<PreviewLayout>>
private final FilteredList<PreviewLayout>
private final CustomLocalDragboard
private static final Logger
private final PreviewPreferences
private final BooleanProperty
private final ObjectProperty<PreviewLayout>
private final BooleanProperty
private final BooleanProperty
private final StringProperty
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
PreviewTabViewModel(DialogService dialogService, PreviewPreferences previewPreferences, TaskExecutor taskExecutor, StateManager stateManager)

Method Summary

Modifier and TypeMethod and Description
public void
addBstStyle(Path bstFile)

public void
public ListProperty<PreviewLayout>
public ObjectProperty<MultipleSelectionModel<PreviewLayout>>
public ListProperty<PreviewLayout>
public de.saxsys.mvvmfx.utils.validation.ValidationStatus
public ObjectProperty<MultipleSelectionModel<PreviewLayout>>
public org.fxmisc.richtext.model.StyleSpans<Collection<String>>

Returns:

highlighted span for codeArea
computeHighlighting
(String
to parse and highlight
text
)

XML-Syntax-Highlighting for RichTextFX-Codearea created by (c) Carlos Martins (github: @cemartins)

License: BSD-2-Clause

See also https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md#xml-editor

public void
dragDetected(ListProperty<PreviewLayout> sourceList, ObjectProperty<MultipleSelectionModel<PreviewLayout>> sourceSelectionModel, List<PreviewLayout> selectedLayouts, Dragboard dragboard)

public boolean
dragDropped(ListProperty<PreviewLayout>
either availableListView or chosenListView
targetList
,
Dragboard dragboard)

This is called, when the user drops some PreviewLayouts either in the availableListView or in the empty space of chosenListView

public boolean
dragDroppedInChosenCell(PreviewLayout
the Layout, the user drops a layout on
targetLayout
,
Dragboard dragboard)

This is called, when the user drops some PreviewLayouts on another cell in chosenListView to sort them

public void
private PreviewLayout
public FilteredList<PreviewLayout>
public void
public void
public void
public void
public void
public BooleanProperty
public ObjectProperty<PreviewLayout>
public void
private void
setContentForPreview(String text, boolean editable)

public void
public void
setValues()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.setValues.

This method is called when the dialog is opened, or if it is made visible after being hidden.

public BooleanProperty
public BooleanProperty
public StringProperty
public void
storeSettings()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.storeSettings.

Store the changes of preference-preview settings.

public boolean
validateSettings()

Overrides default org.jabref.gui.preferences.PreferenceTabViewModel.validateSettings.

This method is called before the storeSettings() method, to check if there are illegal settings in the tab, or if is ready to be closed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

availableListPropertyback to summary
private final ListProperty<PreviewLayout> availableListProperty
availableSelectionModelPropertyback to summary
private final ObjectProperty<MultipleSelectionModel<PreviewLayout>> availableSelectionModelProperty
bstStylesPathsback to summary
private final ListProperty<Path> bstStylesPaths
chosenListPropertyback to summary
private final ListProperty<PreviewLayout> chosenListProperty
chosenListValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator chosenListValidator
chosenSelectionModelPropertyback to summary
private final ObjectProperty<MultipleSelectionModel<PreviewLayout>> chosenSelectionModelProperty
dialogServiceback to summary
private final DialogService dialogService
dragSourceListback to summary
private ListProperty<PreviewLayout> dragSourceList
dragSourceSelectionModelback to summary
private ObjectProperty<MultipleSelectionModel<PreviewLayout>> dragSourceSelectionModel
filteredAvailableLayoutsback to summary
private final FilteredList<PreviewLayout> filteredAvailableLayouts
localDragboardback to summary
private final CustomLocalDragboard localDragboard
LOGGERback to summary
private static final Logger LOGGER
previewPreferencesback to summary
private final PreviewPreferences previewPreferences
selectedIsEditablePropertyback to summary
private final BooleanProperty selectedIsEditableProperty
selectedLayoutPropertyback to summary
private final ObjectProperty<PreviewLayout> selectedLayoutProperty
showAsExtraTabPropertyback to summary
private final BooleanProperty showAsExtraTabProperty
showPreviewInEntryTableTooltipback to summary
private final BooleanProperty showPreviewInEntryTableTooltip
sourceTextPropertyback to summary
private final StringProperty sourceTextProperty
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

PreviewTabViewModelback to summary
public PreviewTabViewModel(DialogService dialogService, PreviewPreferences previewPreferences, TaskExecutor taskExecutor, StateManager stateManager)

Method Detail

addBstStyleback to summary
public void addBstStyle(Path bstFile)
addToChosenback to summary
public void addToChosen()
availableListPropertyback to summary
public ListProperty<PreviewLayout> availableListProperty()
availableSelectionModelPropertyback to summary
public ObjectProperty<MultipleSelectionModel<PreviewLayout>> availableSelectionModelProperty()
chosenListPropertyback to summary
public ListProperty<PreviewLayout> chosenListProperty()
chosenListValidationStatusback to summary
public de.saxsys.mvvmfx.utils.validation.ValidationStatus chosenListValidationStatus()
chosenSelectionModelPropertyback to summary
public ObjectProperty<MultipleSelectionModel<PreviewLayout>> chosenSelectionModelProperty()
computeHighlightingback to summary
public org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeHighlighting(String text)

XML-Syntax-Highlighting for RichTextFX-Codearea created by (c) Carlos Martins (github: @cemartins)

License: BSD-2-Clause

See also https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/README.md#xml-editor

Parameters
text:String

to parse and highlight

Returns:org.fxmisc.richtext.model.StyleSpans<Collection<String>>

highlighted span for codeArea

dragDetectedback to summary
public void dragDetected(ListProperty<PreviewLayout> sourceList, ObjectProperty<MultipleSelectionModel<PreviewLayout>> sourceSelectionModel, List<PreviewLayout> selectedLayouts, Dragboard dragboard)
dragDroppedback to summary
public boolean dragDropped(ListProperty<PreviewLayout> targetList, Dragboard dragboard)

This is called, when the user drops some PreviewLayouts either in the availableListView or in the empty space of chosenListView

Parameters
targetList:ListProperty<PreviewLayout>

either availableListView or chosenListView

dragDroppedInChosenCellback to summary
public boolean dragDroppedInChosenCell(PreviewLayout targetLayout, Dragboard dragboard)

This is called, when the user drops some PreviewLayouts on another cell in chosenListView to sort them

Parameters
targetLayout:PreviewLayout

the Layout, the user drops a layout on

dragOverback to summary
public void dragOver(DragEvent event)
findLayoutByNameback to summary
private PreviewLayout findLayoutByName(String name)
getFilteredAvailableLayoutsback to summary
public FilteredList<PreviewLayout> getFilteredAvailableLayouts()
refreshPreviewback to summary
public void refreshPreview()
removeFromChosenback to summary
public void removeFromChosen()
resetDefaultLayoutback to summary
public void resetDefaultLayout()
selectedInChosenDownback to summary
public void selectedInChosenDown()
selectedInChosenUpback to summary
public void selectedInChosenUp()
selectedIsEditablePropertyback to summary
public BooleanProperty selectedIsEditableProperty()
selectedLayoutPropertyback to summary
public ObjectProperty<PreviewLayout> selectedLayoutProperty()
setAvailableFilterback to summary
public void setAvailableFilter(String searchTerm)
setContentForPreviewback to summary
private void setContentForPreview(String text, boolean editable)
setPreviewLayoutback to summary
public void setPreviewLayout(PreviewLayout selectedLayout)
setValuesback to summary
public void setValues()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.setValues.

Doc from org.jabref.gui.preferences.PreferenceTabViewModel.setValues.

This method is called when the dialog is opened, or if it is made visible after being hidden. The tab should update all its values. This is the ONLY PLACE to set values for the fields in the tab. It is ILLEGAL to set values only at construction time, because the dialog will be reused and updated.

Annotations
@Override
showAsExtraTabPropertyback to summary
public BooleanProperty showAsExtraTabProperty()
showPreviewInEntryTableTooltipback to summary
public BooleanProperty showPreviewInEntryTableTooltip()
sourceTextPropertyback to summary
public StringProperty sourceTextProperty()
storeSettingsback to summary
public void storeSettings()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.storeSettings.

Store the changes of preference-preview settings.

Annotations
@Override
validateSettingsback to summary
public boolean validateSettings()

Overrides default org.jabref.gui.preferences.PreferenceTabViewModel.validateSettings.

Doc from org.jabref.gui.preferences.PreferenceTabViewModel.validateSettings.

This method is called before the storeSettings() method, to check if there are illegal settings in the tab, or if is ready to be closed. If the tab is *not* ready, it should display a message to the user informing about the illegal setting.

Annotations
@Override