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

public Class PreviewViewer

extends ScrollPane
implements InvalidationListener
Class Inheritance
All Implemented Interfaces
javafx.beans.InvalidationListener
Imports
java.io.IOException, .PrintWriter, .StringWriter, java.net.MalformedURLException, java.util.Objects, .Optional, java.util.regex.Pattern, javafx.beans.InvalidationListener, .Observable, javafx.beans.value.ChangeListener, javafx.concurrent.Worker, javafx.print.PrinterJob, javafx.scene.control.ScrollPane, javafx.scene.input.ClipboardContent, javafx.scene.web.WebView, org.jabref.gui.ClipBoardManager, .DialogService, .StateManager, org.jabref.gui.desktop.JabRefDesktop, org.jabref.gui.theme.ThemeManager, org.jabref.gui.util.BackgroundTask, .TaskExecutor, org.jabref.logic.l10n.Localization, org.jabref.logic.layout.format.Number, org.jabref.logic.preview.PreviewLayout, org.jabref.logic.search.SearchQuery, org.jabref.logic.util.WebViewStore, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.preferences.PreferencesService, com.airhacks.afterburner.injection.Injector, org.slf4j.Logger, .LoggerFactory, org.w3c.dom.Document, .Node, .NodeList, org.w3c.dom.events.EventTarget, org.w3c.dom.html.HTMLAnchorElement

Displays an BibEntry using the given layout format.

Field Summary

Modifier and TypeField and Description
private final ClipBoardManager
private final BibDatabaseContext
private final DialogService
private Optional<BibEntry>
entry

The entry currently shown

private static final String
private static final String
private static final String
private static final String
private PreviewLayout
private final ChangeListener<Optional<SearchQuery>>
private static final Logger
private final PreferencesService
private final WebView
private boolean
private Optional<Pattern>
private final TaskExecutor
private static final Pattern

Constructor Summary

AccessConstructor and Description
public
PreviewViewer(BibDatabaseContext
Used for resolving strings and pdf directories for links.
database
,
DialogService dialogService, PreferencesService preferencesService, StateManager stateManager, ThemeManager themeManager, TaskExecutor taskExecutor)

Method Summary

Modifier and TypeMethod and Description
public void
public void
private static String

Returns:

JavaScript regex object
createJavaScriptRegex
(Pattern
Java regex to print as a JavaScript regex
regex
)

Returns the String representation of a JavaScript regex object.

public String
public String
private void
public void
invalidated(Observable
The Observable that became invalid
observable
)

Implements javafx.beans.InvalidationListener.invalidated.

This method needs to be provided by an implementation of InvalidationListener.

public void
setEntry(BibEntry newEntry)

public void
private void
private void
Inherited from javafx.scene.control.ScrollPane:
contentPropertycreateDefaultSkinfitToHeightPropertyfitToWidthPropertygetClassCssMetaDatagetContentgetControlCssMetaDatagetHbarPolicygetHmaxgetHmingetHvaluegetInitialFocusTraversablegetMinViewportHeightgetMinViewportWidthgetPrefViewportHeightgetPrefViewportWidthgetVbarPolicygetViewportBoundsgetVmaxgetVmingetVvaluehbarPolicyPropertyhmaxPropertyhminPropertyhvaluePropertyisFitToHeightisFitToWidthisPannableminViewportHeightPropertyminViewportWidthPropertypannablePropertyprefViewportHeightPropertyprefViewportWidthPropertyqueryAccessibleAttributesetContentsetFitToHeightsetFitToWidthsetHbarPolicysetHmaxsetHminsetHvaluesetMinViewportHeightsetMinViewportWidthsetPannablesetPrefViewportHeightsetPrefViewportWidthsetVbarPolicysetViewportBoundssetVmaxsetVminsetVvaluevbarPolicyPropertyviewportBoundsPropertyvmaxPropertyvminPropertyvvalueProperty

Field Detail

clipBoardManagerback to summary
private final ClipBoardManager clipBoardManager
databaseback to summary
private final BibDatabaseContext database
dialogServiceback to summary
private final DialogService dialogService
entryback to summary
private Optional<BibEntry> entry

The entry currently shown

JS_GET_SELECTION_HTML_SCRIPTback to summary
private static final String JS_GET_SELECTION_HTML_SCRIPT
JS_HIGHLIGHT_FUNCTIONback to summary
private static final String JS_HIGHLIGHT_FUNCTION
JS_MARK_REG_EXP_CALLBACKback to summary
private static final String JS_MARK_REG_EXP_CALLBACK
JS_UNMARK_WITH_CALLBACKback to summary
private static final String JS_UNMARK_WITH_CALLBACK
layoutback to summary
private PreviewLayout layout
listenerback to summary
private final ChangeListener<Optional<SearchQuery>> listener
LOGGERback to summary
private static final Logger LOGGER
preferencesServiceback to summary
private final PreferencesService preferencesService
previewViewback to summary
private final WebView previewView
registeredback to summary
private boolean registered
searchHighlightPatternback to summary
private Optional<Pattern> searchHighlightPattern
taskExecutorback to summary
private final TaskExecutor taskExecutor
UNESCAPED_FORWARD_SLASHback to summary
private static final Pattern UNESCAPED_FORWARD_SLASH

Constructor Detail

PreviewViewerback to summary
public PreviewViewer(BibDatabaseContext database, DialogService dialogService, PreferencesService preferencesService, StateManager stateManager, ThemeManager themeManager, TaskExecutor taskExecutor)
Parameters
database:BibDatabaseContext

Used for resolving strings and pdf directories for links.

Method Detail

copyPreviewToClipBoardback to summary
public void copyPreviewToClipBoard()
copySelectionToClipBoardback to summary
public void copySelectionToClipBoard()
createJavaScriptRegexback to summary
private static String createJavaScriptRegex(Pattern regex)

Returns the String representation of a JavaScript regex object. The method does not take into account differences between the regex implementations in Java and JavaScript.

Parameters
regex:Pattern

Java regex to print as a JavaScript regex

Returns:String

JavaScript regex object

getSelectionHtmlContentback to summary
public String getSelectionHtmlContent()
getSelectionTextContentback to summary
public String getSelectionTextContent()
highlightSearchPatternback to summary
private void highlightSearchPattern()
invalidatedback to summary
public void invalidated(Observable observable)

Implements javafx.beans.InvalidationListener.invalidated.

Doc from javafx.beans.InvalidationListener.invalidated.

This method needs to be provided by an implementation of InvalidationListener. It is called if an Observable becomes invalid.

In general, it is considered bad practice to modify the observed value in this method.

Parameters
observable:Observable

The Observable that became invalid

Annotations
@Override
setEntryback to summary
public void setEntry(BibEntry newEntry)
setLayoutback to summary
public void setLayout(PreviewLayout newLayout)
setPreviewTextback to summary
private void setPreviewText(String text)
updateback to summary
private void update()