Package com._1c.g5.v8.dt.md.ui.control
Class FormattedTextViewer
- 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.md.ui.control.AbstractFormattedTextViewer
-
- com._1c.g5.v8.dt.md.ui.control.FormattedTextViewer
-
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
public class FormattedTextViewer extends AbstractFormattedTextViewer
Control to display formatted text.- Since:
- 2.1
-
-
Field Summary
Fields Modifier and Type Field Description static String
BROWSER_ON_CLICK_CALLBACK_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protected
FormattedTextViewer(org.eclipse.swt.widgets.Composite parent)
Creates new instance of the control without any views attached.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 singleFormattedTextView
view attached.
-
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 theFormattedStringSettings
.-
Methods inherited from class com._1c.g5.v8.dt.md.ui.control.AbstractFormattedTextViewer
hideScrollBars
-
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
-
-
-
-
Field Detail
-
BROWSER_ON_CLICK_CALLBACK_NAME
public static final String BROWSER_ON_CLICK_CALLBACK_NAME
- See Also:
- Constant Field Values
-
-
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 singleFormattedTextView
view attached.- Parameters:
parent
- parent control, cannot benull
content
- formatted text contentv8Project
- V8 project, cannot benull
objectByTypeProvider
- object by type provider, cannot benull
colorProvider
- the color provider, cannot benull
fontProvider
- the font provider, cannot benull
scale
- the form scale in percentpreferredWidth
- the preferred width of the formatted text, useSWT.DEFAULT
to ignore limitpreferredHeight
- the preferred height of the formatted text, useSWT.DEFAULT
to ignore limitformattedStringSettings
- the formatted text default settings, can benull
mouseUpConsumer
- consumer called on mouse up to focus selection control, cannot benull
-
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 benull
-
-
Method Detail
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int width, int height, boolean changed)
- Overrides:
computeSize
in classorg.eclipse.swt.widgets.Control
-
updateFormattedStringSettings
public void updateFormattedStringSettings(FormattedStringSettings settings, Runnable onContentLoaded)
Description copied from class:AbstractFormattedTextViewer
Updates theFormattedStringSettings
. If default font style is changed you should use this method to set correct settings.- Specified by:
updateFormattedStringSettings
in classAbstractFormattedTextViewer
- Parameters:
settings
- new formatted text settings, can benull
onContentLoaded
- callback to be called when content has been loaded, cannot benull
-
dispose
public void dispose()
- Overrides:
dispose
in classorg.eclipse.swt.widgets.Widget
-
resizeView
public void resizeView(org.eclipse.swt.graphics.Rectangle rect, Runnable onContentLoaded)
Resizes view containment.- Specified by:
resizeView
in classAbstractFormattedTextViewer
- Parameters:
rect
- new size, cannot benull
onContentLoaded
- callback to be called when content has been loaded, can benull
-
setView
protected void setView(FormattedTextView view)
Sets view of formatted text.- Parameters:
view
- the view, cannot benull
-
-