Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.forms.widgets
Class Section

java.lang.Object
  extended by 

org.eclipse.swt.widgets.Widget
      extended by 

org.eclipse.swt.widgets.Control
          extended by 

org.eclipse.swt.widgets.Scrollable
              extended by 

org.eclipse.swt.widgets.Composite
                  extended by 

org.eclipse.swt.widgets.Canvas
                      extended by 

org.eclipse.ui.forms.widgets.ExpandableComposite
                          extended by 
org.eclipse.ui.forms.widgets.Section
All Implemented Interfaces:
Drawable

public class Section
extends ExpandableComposite

A variation of the expandable composite that adds optional description below the title. Section is often used as a basic building block in forms because it provides for logical grouping of information.

In case of the TITLE_BAR style, Section renders the title bar in a way compatible with the rest of the workbench. Since it is a widget, all the colors must be supplied directly. When created by the form toolkit, these colors are supplied by the toolkit. The toolkit initializes these colors based on the system colors. For this reason, it is recommended to create the section by the toolkit instead of through its own constructor.

Since 3.1, it is possible to set a control to be used for section description. If used, DESCRIPTION style should not be set. A typical way to take advantage of the new method is to set an instance of FormText to provide for hyperlinks and images in the description area.

Since:
3.0

Field Summary
static int DESCRIPTION
          Description style.
 
Fields inherited from class org.eclipse.ui.forms.widgets. ExpandableComposite
CLIENT_INDENT, clientVerticalSpacing, COMPACT, descriptionVerticalSpacing, EXPANDED, FOCUS_TITLE, GAP, LEFT_TEXT_CLIENT_ALIGNMENT, marginHeight, marginWidth, NO_TITLE, SHORT_TITLE_BAR, textLabel, TITLE_BAR, titleBarTextMarginWidth, toggle, TREE_NODE, TWISTIE, VGAP
 
Fields inherited from class org.eclipse.swt.widgets. Control
handle
 
Constructor Summary
Section ( Composite parent, int style)
          Creates a new section instance in the provided parent.
 
Method Summary
  String getDescription ()
          Returns the current description text.
  Control getDescriptionControl ()
          Returns the control used to render the description.
  Control getSeparatorControl ()
          Returns the control that is used as a separator betweeen the title and the client, or null if not set.
  Color getTitleBarBackground ()
          Returns the title bar background when TITLE_BAR style is used.
  Color getTitleBarBorderColor ()
          Returns the title bar border color when TITLE_BAR style is used.
  Color getTitleBarGradientBackground ()
          Returns the title bar gradient background color when TITLE_BAR style is used.
protected  void internalSetExpanded (boolean expanded)
          Performs the expansion state change for the expandable control.
protected  void onPaint ( PaintEvent e)
          If TITLE_BAR or SHORT_TITLE_BAR style is used, title bar decoration will be painted behind the text in this method.
protected  void reflow ()
          Reflows this section and all the parents up the hierarchy until a SharedScrolledComposite is reached.
 void setBackground ( Color bg)
          Sets the background of the section.
 void setBackgroundImage ( Image image)
          Background image is used for the title gradient - does nothing.
 void setDescription ( String description)
          Sets the description text.
 void setDescriptionControl ( Control descriptionControl)
          Sets the description control of this section.
 void setForeground ( Color fg)
          Sets the foreground of the section.
 void setSeparatorControl ( Control separator)
          Sets the separator control of this section.
 void setTitleBarBackground ( Color color)
          Sets the color of the title bar background when TITLE_BAR style is used.
 void setTitleBarBorderColor ( Color color)
          Sets the color of the title bar border when TITLE_BAR style is used.
 void setTitleBarGradientBackground ( Color color)
          Sets the color of the title bar gradient background when TITLE_BAR style is used.
 
Methods inherited from class org.eclipse.ui.forms.widgets. ExpandableComposite
addExpansionListener, computeSize, forceFocus, getClient, getExpansionStyle, getText, getTextClient, getTextClientHeightDifference, getTitleBarForeground, hasTitleBar, isExpanded, isFixedStyle, removeExpansionListener, setActiveToggleColor, setClient, setEnabled, setExpanded, setFont, setLayout, setMenu, setText, setTextClient, setTitleBarForeground, setToggleColor
 
Methods inherited from class org.eclipse.swt.widgets. Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setIME
 
Methods inherited from class org.eclipse.swt.widgets. Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets. Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets. Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets. Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCRIPTION

public static final int DESCRIPTION
Description style. If used, description will be rendered below the title.

See Also:
Constant Field Values
Constructor Detail

Section

public Section(
Composite parent,
               int style)
Creates a new section instance in the provided parent.

Parameters:
parent - the parent composite
style - the style to use
Method Detail

internalSetExpanded

protected void internalSetExpanded(boolean expanded)
Description copied from class: ExpandableComposite
Performs the expansion state change for the expandable control.

Overrides:
internalSetExpanded in class ExpandableComposite
Parameters:
expanded - the expansion state

reflow

protected void reflow()
Reflows this section and all the parents up the hierarchy until a SharedScrolledComposite is reached.


setDescription

public void setDescription(
String description)
Sets the description text. Has no effect if DESCRIPTION style was not used to create the control.

Parameters:
description -

getDescription

public 
String getDescription()
Returns the current description text.

Returns:
description text or null if DESCRIPTION style was not used to create the control.

setSeparatorControl

public void setSeparatorControl(
Control separator)
Sets the separator control of this section. The separator must not be null and must be a direct child of this container. If defined, separator will be placed below the title text and will remain visible regardless of the expansion state.

Parameters:
separator - the separator that will be placed below the title text.

getSeparatorControl

public 
Control getSeparatorControl()
Returns the control that is used as a separator betweeen the title and the client, or null if not set.

Overrides:
getSeparatorControl in class ExpandableComposite
Returns:
separator control or null if not set.

setBackground

public void setBackground(
Color bg)
Sets the background of the section.

Overrides:
setBackground in class ExpandableComposite
Parameters:
bg - the new background

setForeground

public void setForeground(
Color fg)
Sets the foreground of the section.

Overrides:
setForeground in class ExpandableComposite
Parameters:
fg - the new foreground.

getDescriptionControl

public 
Control getDescriptionControl()
Returns the control used to render the description. In 3.1, this method was promoted to public.

Overrides:
getDescriptionControl in class ExpandableComposite
Returns:
description control or null if DESCRIPTION style was not used to create the control and description control was not set by the client.
See Also:
setDescriptionControl(org.eclipse.swt.widgets.Control)

setDescriptionControl

public void setDescriptionControl(
Control descriptionControl)
Sets the description control of this section. The control must not be null and must be a direct child of this container. If defined, contol will be placed below the title text and the separator and will be hidden int he collapsed state.

This method and DESCRIPTION style are mutually exclusive. Use the method only if you want to create the description control yourself.

Parameters:
descriptionControl - the control that will be placed below the title text.
Since:
3.1

setTitleBarBorderColor

public void setTitleBarBorderColor(
Color color)
Sets the color of the title bar border when TITLE_BAR style is used.

Parameters:
color - the title bar border color

setTitleBarBackground

public void setTitleBarBackground(
Color color)
Sets the color of the title bar background when TITLE_BAR style is used. This color is used as a starting color for the vertical gradient.

Parameters:
color - the title bar border background

setTitleBarGradientBackground

public void setTitleBarGradientBackground(
Color color)
Sets the color of the title bar gradient background when TITLE_BAR style is used. This color is used at the height where title controls end (toggle, tool bar).

Parameters:
color - the title bar gradient background

getTitleBarBorderColor

public 
Color getTitleBarBorderColor()
Returns the title bar border color when TITLE_BAR style is used.

Returns:
the title bar border color

getTitleBarGradientBackground

public 
Color getTitleBarGradientBackground()
Returns the title bar gradient background color when TITLE_BAR style is used.

Returns:
the title bar gradient background

getTitleBarBackground

public 
Color getTitleBarBackground()
Returns the title bar background when TITLE_BAR style is used.

Returns:
the title bar background

onPaint

protected void onPaint(
PaintEvent e)
Description copied from class: ExpandableComposite
If TITLE_BAR or SHORT_TITLE_BAR style is used, title bar decoration will be painted behind the text in this method. The default implementation does nothing - subclasses are responsible for rendering the title area.

Overrides:
onPaint in class ExpandableComposite
Parameters:
e - the paint event

setBackgroundImage

public final void setBackgroundImage(
Image image)
Background image is used for the title gradient - does nothing.

Overrides:
setBackgroundImage in class Control
Parameters:
image - the new image (or null)

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire