Class WysiwygHtmlPage

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.swt.browser.Browser browser  
      static String WYSIWYG_PAGE
      default wysiwyg html page name
      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      WysiwygHtmlPage​(org.eclipse.swt.widgets.Composite parent, String location, int style)
      Create instance of PreviewHtmlPage
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addWysiwygHtmlChangeListener​(IWysiwygChangeListener changeObserver)
      Adds the specified IWysiwygChangeListener to this wysiwyg
      protected Optional<String> createWysiwygCommonCommand​(String commandName, String valuePrefix, String value)
      Create string of specified wysiwyg command with one string parameter
      void executeCommand​(String commandId, String... args)
      Delegate command executing for Wysiwyg page
      protected Optional<String> executeCommandConstructor​(String commandName, String... args)
      Construct command for execute in wysiwyg page browser
      IWysiwygChangeListener.WysiwygHtmlSelection getWysiwygHtmlSelection()
      Info about wysiwyg selection
      void restoreSelection()
      Restore last selection on wysiwyg page
      void updateHtml​(String htmlText, boolean escape)
      Update html on wysiwyg page
      void 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
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Field Detail

      • 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 of PreviewHtmlPage
        Parameters:
        parent - a widget which will be the parent of the new instance, cannot be null
        location - the wysiwyg initiate location, cannot be null
        style - the style of widget to construct
        See Also:
        Composite
    • Method Detail

      • executeCommand

        public void executeCommand​(String commandId,
                                   String... args)
        Description copied from interface: IWysiwygHtmlPage
        Delegate command executing for Wysiwyg page
        Specified by:
        executeCommand in interface IWysiwygHtmlPage
        Parameters:
        commandId - the command name to execute, cannot be null
        args - the command arguments sequence, cannot be null
      • updateHtml

        public void updateHtml​(String htmlText,
                               boolean escape)
        Description copied from interface: IWysiwygHtmlPage

        Update html on wysiwyg page

        Specified by:
        updateHtml in interface IWysiwygHtmlPage
        Parameters:
        htmlText - the text to set in wysiwyg editor, cannot be null
        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 interface IWysiwygHtmlPage
        Parameters:
        offset - the selection offset relative to the body tag
        length - the selection length
        headerLength - 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 interface IWysiwygHtmlPage
      • 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 be null
        args - the command arguments sequence, cannot be null
        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 be null
        valuePrefix - the parameter prefix strign, cannot be null
        value - the parameter value, cannot be null
        Returns:
        optional string of specified wysiwyg command, never null