Class MarkdownWebView
java.lang.Object
io.github.raghultech.markdown.javafx.preview.MarkdownWebView
A reusable Markdown preview component that renders into a WebView.
You can:
- Supply your own WebView or let it create one.
- Render content from File or String.
- Attach HostServices to open external links.
-
Constructor Summary
ConstructorsConstructorDescriptionMarkdownWebView
(File file, javafx.application.HostServices hostServices) Constructor with File input and new WebView.MarkdownWebView
(String content, javafx.application.HostServices hostServices) Constructor with String input and new WebView.MarkdownWebView
(javafx.scene.web.WebView webView, File file, javafx.application.HostServices hostServices) Constructor with supplied WebView and File.MarkdownWebView
(javafx.scene.web.WebView webView, String content, javafx.application.HostServices hostServices) Constructor with supplied WebView and String. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes resources and stops the preview.boolean
javafx.scene.web.WebView
Returns the WebView to embed in your layout.boolean
Indicates whether the preview has been disposed.boolean
javafx.scene.web.WebView
launch()
Launches the preview.void
setContent
(String content) void
setCurrentFile
(File file) void
setDarkMode
(boolean isdark) void
-
Constructor Details
-
MarkdownWebView
Constructor with File input and new WebView. -
MarkdownWebView
Constructor with String input and new WebView. -
MarkdownWebView
public MarkdownWebView(javafx.scene.web.WebView webView, File file, javafx.application.HostServices hostServices) Constructor with supplied WebView and File. -
MarkdownWebView
public MarkdownWebView(javafx.scene.web.WebView webView, String content, javafx.application.HostServices hostServices) Constructor with supplied WebView and String.
-
-
Method Details
-
launch
public javafx.scene.web.WebView launch()Launches the preview. -
updatefullContent
public void updatefullContent() -
dispose
public void dispose()Disposes resources and stops the preview. -
getWebView
public javafx.scene.web.WebView getWebView()Returns the WebView to embed in your layout. -
isDisposed
public boolean isDisposed()Indicates whether the preview has been disposed. -
isPreviewShowing
public boolean isPreviewShowing() -
setCurrentFile
-
getCurrentFile
-
setContent
-
getContent
-
setDarkMode
public void setDarkMode(boolean isdark) -
getisDarkMode
public boolean getisDarkMode()
-