Package com._1c.g5.v8.dt.html.ui.editor
Class PreviewHtmlPageContentProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.html.ui.editor.PreviewHtmlPageContentProvider
-
- All Implemented Interfaces:
IPreviewHtmlPageContentProvider
- Direct Known Subclasses:
MdPreviewHtmlPageContentProvider
public class PreviewHtmlPageContentProvider extends Object implements IPreviewHtmlPageContentProvider
Text editor based implementation ofIPreviewHtmlPageContentProvider
Provide text in dirty state from specifid text editor in home location
-
-
Field Summary
Fields Modifier and Type Field Description protected String
homeLocation
protected org.eclipse.ui.texteditor.ITextEditor
textEditor
-
Fields inherited from interface com._1c.g5.v8.dt.html.ui.editor.IPreviewHtmlPageContentProvider
FILE_NOT_FOUND_PAGE, FILE_NOT_FOUND_PAGE_CONTENT_PROVIDER
-
-
Constructor Summary
Constructors Constructor Description PreviewHtmlPageContentProvider(org.eclipse.ui.texteditor.ITextEditor textEditor, String homeLocation)
Create instance ofPreviewHtmlPageContentProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContent(String location)
Get text content of preview html page by specified locationprotected Optional<String>
getHomePageContent()
Get home page content from specified text editorprotected String
getHtmlBodyText(String fullHtml)
Substring html text by body tag contentprotected Optional<String>
getLocationPageContent(String location)
Get html page content from specified locationprotected String
getPageNotFoundContent()
Get html page not fount template text
-
-
-
Field Detail
-
textEditor
protected final org.eclipse.ui.texteditor.ITextEditor textEditor
-
homeLocation
protected final String homeLocation
-
-
Constructor Detail
-
PreviewHtmlPageContentProvider
public PreviewHtmlPageContentProvider(org.eclipse.ui.texteditor.ITextEditor textEditor, String homeLocation)
Create instance ofPreviewHtmlPageContentProvider
- Parameters:
textEditor
- the base text editor, can benull
if no reasonhomeLocation
- the default location to provide content from text editor, can benull
if no reason
-
-
Method Detail
-
getContent
public String getContent(String location) throws IOException
Description copied from interface:IPreviewHtmlPageContentProvider
Get text content of preview html page by specified location- Specified by:
getContent
in interfaceIPreviewHtmlPageContentProvider
- Parameters:
location
- of html text to preview, cannot benull
- Returns:
- string content of preview html page, nevet
null
- Throws:
IOException
- if an I/O error occurs
-
getHomePageContent
protected Optional<String> getHomePageContent() throws IOException
Get home page content from specified text editor- Returns:
- string text content, never
null
- Throws:
IOException
- if an I/O error occurs
-
getLocationPageContent
protected Optional<String> getLocationPageContent(String location) throws IOException
Get html page content from specified location- Parameters:
location
- of html text to preview, cannot benull
- Returns:
- string text content, never
null
- Throws:
IOException
- if an I/O error occurs
-
getPageNotFoundContent
protected String getPageNotFoundContent() throws IOException
Get html page not fount template text- Returns:
- string text content, never
null
- Throws:
IOException
- if an I/O error occurs
-
-