Package org.eclipse.ui.forms.widgets
Class ScrolledFormText
- All Implemented Interfaces:
Drawable
ScrolledFormText is a control that is capable of scrolling an instance of the
FormText class. It should be created in a parent that will allow it to use
all the available area (for example, a shell, a view or an editor). The form
text can be created by the class itself, or set from outside. In the later
case, the form text instance must be a direct child of the ScrolledFormText
instance.
The class assumes that text to be rendered contains formatting tags. In case of a string, it will enclose the text in 'form' root element if missing from the text as a convinience. For example:
ftext.setText("<p>Some text here</>");
will not cause an error. The same behavior does not exist for content from the input stream, however - it must be well formed in that case.
- Since:
- 3.0
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom -
Constructor Summary
ConstructorsConstructorDescriptionScrolledFormText(Composite parent, boolean createFormText) Creates the new scrolled text instance in the provided parentScrolledFormText(Composite parent, int style, boolean createFormText) Creates the new scrolled text instance in the provided parent -
Method Summary
Modifier and TypeMethodDescriptionReturns the instance of the form text.voidsetBackground(Color bg) Sets the background color of the scrolled form text.final voidThe class sets the content widget.voidSets the contents to rendered in the scrolled form text.voidsetForeground(Color fg) Sets the foreground color of the scrolled form text.voidsetFormText(FormText formText) Sets the form text to be managed by this scrolled form text.voidSets the text to be rendered in the scrolled form text.Methods inherited from class org.eclipse.ui.forms.widgets.SharedScrolledComposite
isDelayedReflow, layout, reflow, setDelayedReflow, setExpandHorizontal, setExpandVertical, setFocus, setFontMethods inherited from class org.eclipse.swt.custom.ScrolledComposite
getAlwaysShowScrollBars, getContent, getExpandHorizontal, getExpandVertical, getMinHeight, getMinWidth, getOrigin, getShowFocusedControl, setAlwaysShowScrollBars, setLayout, setMinHeight, setMinSize, setMinSize, setMinWidth, setOrigin, setOrigin, setShowFocusedControl, showControlMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Constructor Details
-
ScrolledFormText
Creates the new scrolled text instance in the provided parent- Parameters:
parent- the parent compositecreateFormText- iftrue, enclosing form text instance will be created in this constructor.
-
ScrolledFormText
Creates the new scrolled text instance in the provided parent- Parameters:
parent- the parent compositestyle- the style to pass to the scrolled compositecreateFormText- iftrue, enclosing form text instance will be created in this constructor.
-
-
Method Details
-
setFormText
Sets the form text to be managed by this scrolled form text. The instance must be a direct child of this class. If this method is used,falsemust be passed in either of the constructors to avoid creating form text instance.- Parameters:
formText- the form text instance to use.
-
setForeground
Sets the foreground color of the scrolled form text.- Overrides:
setForegroundin classSharedScrolledComposite- Parameters:
fg- the foreground color
-
setBackground
Sets the background color of the scrolled form text.- Overrides:
setBackgroundin classSharedScrolledComposite- Parameters:
bg- the background color
-
setContent
The class sets the content widget. This method should not be called by classes that instantiate this widget.- Overrides:
setContentin classSharedScrolledComposite- Parameters:
c- content control
-
setText
Sets the text to be rendered in the scrolled form text. The text must contain formatting tags.- Parameters:
text- the text to be rendered
-
setContents
Sets the contents to rendered in the scrolled form text. The stream must contain formatting tags. The caller is responsible for closing the input stream. The call may be long running. For best results, call this method from another thread and call 'reflow' when done (but make both calls using 'Display.asyncExec' because these calls must be made in the event dispatching thread).- Parameters:
is- content input stream
-
getFormText
Returns the instance of the form text.- Returns:
- the form text instance
-