Class SharedScrolledComposite

All Implemented Interfaces:
Drawable
Direct Known Subclasses:
ScrolledForm, ScrolledFormText, ScrolledPageBook

public abstract class SharedScrolledComposite extends ScrolledComposite
This class is used to provide common scrolling services to a number of controls in the toolkit. Classes that extend it are not required to implement any method.
Since:
3.0
  • Constructor Details

    • SharedScrolledComposite

      public SharedScrolledComposite(Composite parent, int style)
      Creates the new instance.
      Parameters:
      parent - the parent composite
      style - the style to use
  • Method Details

    • setForeground

      public void setForeground(Color fg)
      Sets the foreground of the control and its content.
      Overrides:
      setForeground in class Control
      Parameters:
      fg - the new foreground color
    • setBackground

      public void setBackground(Color bg)
      Sets the background of the control and its content.
      Overrides:
      setBackground in class Control
      Parameters:
      bg - the new background color
    • setFont

      public void setFont(Font font)
      Sets the font of the form. This font will be used to render the title text. It will not affect the body.
      Overrides:
      setFont in class Control
      Parameters:
      font - the new font (or null)
    • setContent

      public void setContent(Control content)
      Overrides 'super' to pass the proper colors and font
      Overrides:
      setContent in class ScrolledComposite
      Parameters:
      content - the control to be displayed in the content area
    • setFocus

      public boolean setFocus()
      If content is set, transfers focus to the content.
      Overrides:
      setFocus in class Composite
      Returns:
      true if the control got focus, and false if it was unable to.
      See Also:
    • layout

      public void layout(boolean changed)
      Description copied from class: Composite
      If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the argument is true the layout must not rely on any information it has cached about the immediate children. If it is false the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing.

      It is normally more efficient to invoke Control.requestLayout() on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to use Control.requestLayout() where possible instead of calling this method.

      If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as layout(false)).

      Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

      Overrides:
      layout in class Composite
      Parameters:
      changed - true if the layout must flush its caches, and false otherwise
    • setExpandHorizontal

      public void setExpandHorizontal(boolean expand)
      Description copied from class: ScrolledComposite
      Configure the ScrolledComposite to resize the content object to be as wide as the ScrolledComposite when the width of the ScrolledComposite is greater than the minimum width specified in setMinWidth. If the ScrolledComposite is less than the minimum width, the content will not be resized and instead the horizontal scroll bar will be used to view the entire width. If expand is false, this behaviour is turned off. By default, this behaviour is turned off.
      Overrides:
      setExpandHorizontal in class ScrolledComposite
      Parameters:
      expand - true to expand the content control to fill available horizontal space
    • setExpandVertical

      public void setExpandVertical(boolean expand)
      Description copied from class: ScrolledComposite
      Configure the ScrolledComposite to resize the content object to be as tall as the ScrolledComposite when the height of the ScrolledComposite is greater than the minimum height specified in setMinHeight. If the ScrolledComposite is less than the minimum height, the content will not be resized and instead the vertical scroll bar will be used to view the entire height. If expand is false, this behaviour is turned off. By default, this behaviour is turned off.
      Overrides:
      setExpandVertical in class ScrolledComposite
      Parameters:
      expand - true to expand the content control to fill available vertical space
    • reflow

      public void reflow(boolean flushCache)
      Recomputes the body layout and the scroll bars. The method should be used when changes somewhere in the form body invalidate the current layout and/or scroll bars.
      Parameters:
      flushCache - if true, drop the cached data
    • isDelayedReflow

      public boolean isDelayedReflow()
      Tests if the control uses delayed reflow.
      Returns:
      true if reflow requests will be delayed, false otherwise.
    • setDelayedReflow

      public void setDelayedReflow(boolean delayedReflow)
      Sets the delayed reflow feature. When used, it will schedule a reflow on resize requests and reject subsequent reflows until the scheduled one is performed.
      Parameters:
      delayedReflow - The delayedReflow to set.