Package com._1c.g5.v8.dt.html.ui.editor
Class WysiwygHtmlPage
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- com._1c.g5.v8.dt.html.ui.editor.WysiwygHtmlPage
-
- All Implemented Interfaces:
IWysiwygHtmlPage
,org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
MdExtendedWysiwygHtmlPage
public class WysiwygHtmlPage extends org.eclipse.swt.widgets.Composite implements IWysiwygHtmlPage
Wysiwyg page of html multipage editor
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.swt.browser.Browser
browser
static String
WYSIWYG_PAGE
default wysiwyg html page name
-
Constructor Summary
Constructors Constructor Description WysiwygHtmlPage(org.eclipse.swt.widgets.Composite parent, String location, int style)
Create instance ofPreviewHtmlPage
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWysiwygHtmlChangeListener(IWysiwygChangeListener changeObserver)
Adds the specifiedIWysiwygChangeListener
to this wysiwygprotected Optional<String>
createWysiwygCommonCommand(String commandName, String valuePrefix, String value)
Create string of specified wysiwyg command with one string parametervoid
executeCommand(String commandId, String... args)
Delegate command executing for Wysiwyg pageprotected Optional<String>
executeCommandConstructor(String commandName, String... args)
Construct command for execute in wysiwyg page browserIWysiwygChangeListener.WysiwygHtmlSelection
getWysiwygHtmlSelection()
Info about wysiwyg selectionvoid
restoreSelection()
Restore last selection on wysiwyg pagevoid
updateHtml(String htmlText, boolean escape)
Update html on wysiwyg pagevoid
updateSelection(int offset, int length, int headerLength)
Update selection on wysiwyg page-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
WYSIWYG_PAGE
public static final String WYSIWYG_PAGE
default wysiwyg html page name- See Also:
- Constant Field Values
-
browser
protected org.eclipse.swt.browser.Browser browser
-
-
Constructor Detail
-
WysiwygHtmlPage
public WysiwygHtmlPage(org.eclipse.swt.widgets.Composite parent, String location, int style)
Create instance ofPreviewHtmlPage
- Parameters:
parent
- a widget which will be the parent of the new instance, cannot benull
location
- the wysiwyg initiate location, cannot benull
style
- the style of widget to construct- See Also:
Composite
-
-
Method Detail
-
addWysiwygHtmlChangeListener
public void addWysiwygHtmlChangeListener(IWysiwygChangeListener changeObserver)
Description copied from interface:IWysiwygHtmlPage
Adds the specifiedIWysiwygChangeListener
to this wysiwyg- Specified by:
addWysiwygHtmlChangeListener
in interfaceIWysiwygHtmlPage
- Parameters:
changeObserver
- instance ofIWysiwygChangeListener
, cannot benull
-
executeCommand
public void executeCommand(String commandId, String... args)
Description copied from interface:IWysiwygHtmlPage
Delegate command executing for Wysiwyg page- Specified by:
executeCommand
in interfaceIWysiwygHtmlPage
- Parameters:
commandId
- the command name to execute, cannot benull
args
- the command arguments sequence, cannot benull
-
updateHtml
public void updateHtml(String htmlText, boolean escape)
Description copied from interface:IWysiwygHtmlPage
Update html on wysiwyg page
- Specified by:
updateHtml
in interfaceIWysiwygHtmlPage
- Parameters:
htmlText
- the text to set in wysiwyg editor, cannot benull
escape
-true
if text need to be escape,false
if otherwise.
-
updateSelection
public void updateSelection(int offset, int length, int headerLength)
Description copied from interface:IWysiwygHtmlPage
Update selection on wysiwyg page
- Specified by:
updateSelection
in interfaceIWysiwygHtmlPage
- Parameters:
offset
- the selection offset relative to the body taglength
- the selection lengthheaderLength
- the length of text befoge body content
-
restoreSelection
public void restoreSelection()
Description copied from interface:IWysiwygHtmlPage
Restore last selection on wysiwyg page
Use this method after show any modal dialog on wysiwyg page, because the editor can lose selection when dialog will be closed
- Specified by:
restoreSelection
in interfaceIWysiwygHtmlPage
-
getWysiwygHtmlSelection
public IWysiwygChangeListener.WysiwygHtmlSelection getWysiwygHtmlSelection()
Description copied from interface:IWysiwygHtmlPage
Info about wysiwyg selection- Specified by:
getWysiwygHtmlSelection
in interfaceIWysiwygHtmlPage
- Returns:
- extended info about wysiwyg selection, can be
null
if page has no any selection
-
executeCommandConstructor
protected Optional<String> executeCommandConstructor(String commandName, String... args)
Construct command for execute in wysiwyg page browser
Subclasses may extend and must call super implementation.
- Parameters:
commandName
- the command name, cannot benull
args
- the command arguments sequence, cannot benull
- Returns:
- string command for execute in SWT Browser
-
createWysiwygCommonCommand
protected Optional<String> createWysiwygCommonCommand(String commandName, String valuePrefix, String value)
Create string of specified wysiwyg command with one string parameter- Parameters:
commandName
- the wysiwyg command name, cannot benull
valuePrefix
- the parameter prefix strign, cannot benull
value
- the parameter value, cannot benull
- Returns:
- optional string of specified wysiwyg command, never
null
-
-