Class FormattedTextViewer

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

    public class FormattedTextViewer
    extends AbstractFormattedTextViewer
    Control to display formatted text.
    Since:
    2.1
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.swt.graphics.Point computeSize​(int width, int height, boolean changed)  
      void dispose()  
      void resizeView​(org.eclipse.swt.graphics.Rectangle rect, Runnable onContentLoaded)
      Resizes view containment.
      protected void setView​(FormattedTextView view)
      Sets view of formatted text.
      void updateFormattedStringSettings​(FormattedStringSettings settings, Runnable onContentLoaded)
      Updates the FormattedStringSettings.
      • 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, 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, 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
    • Constructor Detail

      • FormattedTextViewer

        public FormattedTextViewer​(org.eclipse.swt.widgets.Composite parent,
                                   String content,
                                   IV8Project v8Project,
                                   IMdObjectByTypeProvider objectByTypeProvider,
                                   IColorProvider colorProvider,
                                   IFontProvider fontProvider,
                                   int scale,
                                   double preferredWidth,
                                   double preferredHeight,
                                   FormattedStringSettings formattedStringSettings,
                                   Consumer<org.eclipse.swt.widgets.Event> mouseUpConsumer)
        Creates new instance of the control with single FormattedTextView view attached.
        Parameters:
        parent - parent control, cannot be null
        content - formatted text content
        v8Project - V8 project, cannot be null
        objectByTypeProvider - object by type provider, cannot be null
        colorProvider - the color provider, cannot be null
        fontProvider - the font provider, cannot be null
        scale - the form scale in percent
        preferredWidth - the preferred width of the formatted text, use SWT.DEFAULT to ignore limit
        preferredHeight - the preferred height of the formatted text, use SWT.DEFAULT to ignore limit
        formattedStringSettings - the formatted text default settings, can be null
        mouseUpConsumer - consumer called on mouse up to focus selection control, cannot be null
      • FormattedTextViewer

        protected FormattedTextViewer​(org.eclipse.swt.widgets.Composite parent)
        Creates new instance of the control without any views attached. Can be used by descendants to attach custom views of a formatted text.
        Parameters:
        parent - parent control, cannot be null
    • Method Detail

      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(int width,
                                                          int height,
                                                          boolean changed)
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control
      • dispose

        public void dispose()
        Overrides:
        dispose in class org.eclipse.swt.widgets.Widget
      • resizeView

        public void resizeView​(org.eclipse.swt.graphics.Rectangle rect,
                               Runnable onContentLoaded)
        Resizes view containment.
        Specified by:
        resizeView in class AbstractFormattedTextViewer
        Parameters:
        rect - new size, cannot be null
        onContentLoaded - callback to be called when content has been loaded, can be null
      • setView

        protected void setView​(FormattedTextView view)
        Sets view of formatted text.
        Parameters:
        view - the view, cannot be null