com.ibm.commons.swt.data.layouts
Class PropLayout

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 com.ibm.commons.swt.data.layouts.PropLayout
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
PropLayout1, PropLayout2

public class PropLayout
extends org.eclipse.swt.widgets.Composite

Super class for all property panel layouts. Contains constants for correct margins and helper methods to easily create the correct sized GridData objects. The PropLayout Composite is a basic composite with one column by default.


Field Summary
protected static java.lang.String TEXT_SUFFIX
           
protected static java.lang.String UNITS_SUFFIX
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
PropLayout(org.eclipse.swt.widgets.Composite parent, int style)
          Constructs a new instance of the class given the parent Composite, and style flags which are used to set the look/behavior of the control.
 
Method Summary
protected  void addStateDependantChild(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Control child, boolean association)
          Make the given child control dependant on the given button.
protected  void afterPanelCreation()
          A helper method that allows the Subclass to perform any post creation processing.
protected  void cacheToolTip(org.eclipse.swt.widgets.Control control, java.lang.String tooltip)
          Should be overridden by subclasses who need to keep track of tooltips for some reason, e.g.
protected  void checkEnableText(DCCompositeText text, IAttribute textAttr, IAttribute unitsAttr)
          Enable or disable the given text field based on its attribute
protected  void checkSelection(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Button notifier)
           
protected  org.eclipse.swt.layout.GridLayout createChildLayout(int numColumns)
          Create the layout for the child composite which will contain all the controls.
protected  DCColorButton createColorButton(java.lang.String attrName, java.lang.Object layoutData, java.lang.String colorTooltip, java.lang.String resetTooltip)
          Creates and returns a DCColorButton which is tied to the attribute provided.
protected  DCComboBox createCombo(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine)
          Creates and returns a read-only DCComboBox which is tied to the attribute provided.
protected  DCComboBox createCombo(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, int swtStyle)
          Creates and returns a DCComboBox which is tied to the attribute provided.
protected  DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, boolean isEditable)
          Creates and returns a DCCompositeCombo which is tied to the attribute provided.
protected  DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, boolean isEditable, java.lang.String id)
          Creates and returns a DCCompositeCombo which is tied to the attribute provided.
protected  DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, boolean isEditable, java.lang.String id, java.lang.String firstLineTitle)
          Creates and returns a DCCompositeCombo which is tied to the attribute provided.
protected  DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, java.lang.String defaultValue, boolean isEditable, java.lang.String id)
          Creates and returns a DCCompositeCombo which is tied to the attribute provided.
protected  void createContents()
          Create contents of this panel.
protected  org.eclipse.swt.layout.GridData createControlGDBigWidth(int hSpan)
          Creates a grid data that has default control indent and large width hint.
protected  org.eclipse.swt.layout.GridData createControlGDDefWidth(int hSpan)
          Creates a grid data that has default control indent and width hint.
protected  org.eclipse.swt.layout.GridData createControlGDFill(int hSpan)
          Creates a grid data that has default control ident, and fills all available horizontal space.
protected  org.eclipse.swt.layout.GridData createControlGDMultiLine(int hSpan, int numLines, boolean grabVSpace)
          Create a grid data that has default control indent and given hSpan, number of lines, and whether or not it should fill the vertical space.
protected  org.eclipse.swt.layout.GridData createControlGDNoWidth(int hSpan)
          Creates a grid data that has default control indent, no width hint.
protected  org.eclipse.swt.layout.GridData createControlGDSmallWidth(int hSpan)
          Creates a grid data that has default control indent and small width hint.
protected  org.eclipse.swt.layout.GridData createControlNonComputedGD(int hSpan, int computedWidthHint)
          Create a grid data for a control used with computed controls that is not computed.
protected  DCCheckbox createDCCheckBox(java.lang.String attrName, java.lang.String checkedValue, java.lang.String unCheckedValue, java.lang.String text, java.lang.Object layoutData)
          Creates and returns a DCCheckbox which is tied to the attribute provided.
protected  DCCheckbox createDCCheckBox(java.lang.String attrName, java.lang.String checkedValue, java.lang.String unCheckedValue, java.lang.String text, java.lang.Object layoutData, java.lang.String id)
          Creates and returns a DCCheckbox which is tied to the attribute provided.
protected  DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String unCheckedValue, boolean defaultValue, java.lang.String labelText, java.lang.Object layoutData)
          Creates and returns a DCCompositeCheckbox which is tied to the attribute provided.
protected  DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String unCheckedValue, boolean defaultValue, java.lang.String labelText, java.lang.Object layoutData, java.lang.String id)
          Creates and returns a DCCompositeCheckbox which is tied to the attribute provided.
protected  DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData)
          Creates and returns a DCCompositeCheckbox which is tied to the attribute provided.
protected  DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData, java.lang.String id)
          Creates and returns a DCCompositeCheckbox which is tied to the attribute provided.
protected  DCLabel createDCLabel(java.lang.String attrName, java.lang.Object layoutData)
          Creates and returns a DCLabel bound to the given attribute with the given layout data.
protected  DCRadioButton createDCRadioButton(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData)
          Creates and returns a DCRadioButton which is tied to the attribute provided.
protected  DCText createDCText(java.lang.String attrName, java.lang.Object layoutData)
          Creates and returns a DCText which is tied to the attribute provided.
protected  DCText createDCText(java.lang.String attrName, java.lang.Object layoutData, int style)
          Creates and returns a DCText which is tied to the attribute provided.
protected  DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData)
          Creates and returns a DCCompositeText which is tied to the attribute provided.
protected  DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, int style)
          Creates and returns a DCCompositeText which is tied to the attribute provided.
protected  DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, int style, java.lang.String id)
          Creates and returns a DCCompositeText which is tied to the attribute provided.
protected  DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, java.lang.String id)
          Creates and returns a DCCompositeText which is tied to the attribute provided.
protected  DCCompositeText createDCTextComputedPositiveIntegerOnly(java.lang.String attrName, java.lang.Object layoutData)
          Creates and returns a DCCompositeText which is tied to the attribute provided.
protected  DCText createDCTextNoWidth(java.lang.String attrName, java.lang.Object layoutData)
          Creates and returns a DCText which is tied to the attribute provided.
protected  org.eclipse.swt.layout.GridData createExtraIndentGD(int hSpan)
          Creates a grid data that is indented below something, and the given horizontal span.
protected  org.eclipse.swt.layout.GridData createFillGD(int hSpan)
          Create a grid data that consumes all space, and spans the given amount of columns.
protected  org.eclipse.swt.layout.GridData createFillSpanGD(int hSpan)
          Creates a grid data that fills horizontal space and takes the given amount of span.
protected  com.ibm.commons.css.FormatBean createFormatBean(DataNode node)
          Can be overriden by subclass to provider thier own format bean implementation.
protected  org.eclipse.swt.layout.GridData createGroupBoxGridData()
          Creates a grid data for a group box - fills horizontal, but not vertical.
protected  org.eclipse.swt.layout.GridLayout createGroupBoxLayout(int numColumns)
          Create a grid layout to use inside of a group box.
protected  org.eclipse.swt.widgets.Label createHeading(java.lang.String label, int numColumns)
          Creates and returns a label used for headings.
protected  void createHeightWidthSection(java.lang.Object textLayoutData, java.util.List<com.ibm.commons.css.api.CSSLengthUnits> heightAcceptedUnits, java.util.List<com.ibm.commons.css.api.CSSLengthUnits> widthAcceptedUnits, boolean hasHeight, boolean hasWidth)
          Create labels, and widgets for modifying style values of height/width.
protected  org.eclipse.swt.layout.GridData createIndentGD(int indentAmt, int hSpan)
          Creates a grid data with the given amount of indentation, and the given horizontal span.
protected  org.eclipse.swt.widgets.Label createLabel(java.lang.String text, java.lang.Object layoutData)
          Creates and returns a Label with the given text and layout data.
protected  org.eclipse.swt.widgets.Label createLabel(java.lang.String text, java.lang.Object layoutData, java.lang.String toolTipText)
          Creates and returns a Label with the given text, layout data, and tool tip text.
protected  org.eclipse.swt.layout.GridData createLabelSpanGD(int hSpan, int vSpan)
          Creates a grid data that helps align a label that must span a control that takes up multiple rows.
protected  DCText createMultiLineText(java.lang.String attrName, java.lang.Object layoutData, int lines)
          Creates and returns a multi-line DCText bound to the given attribute with the given layout data.
protected  DCCompositeText createMultiLineTextComputed(java.lang.String attrName, java.lang.Object layoutData, int lines)
          Creates and returns a multi-line DCText bound to the given attribute with the given layout data.
protected  org.eclipse.swt.layout.GridLayout createNoMarginGridLayout(int numColumns)
          Create a grid layout that has no margins, and no default spacing.
 void createPanel()
          Creates and initializes the panel.
protected  org.eclipse.swt.widgets.Button createResetButton(java.util.List<java.lang.String> attributes, java.lang.Object layoutData, java.lang.String tooltip)
          Create and return a button that resets the given attributes.
protected  org.eclipse.swt.widgets.Button createResetButton(java.util.List<java.lang.String> attributes, java.lang.String text, java.lang.Object layoutData, java.lang.String tooltip)
          Create and return a button that resets the given attributes.
protected  org.eclipse.swt.layout.GridData createSizeTextGD(int hSpan)
          Creates a grid data specifically for dealing with DC Text used for sized controls.
protected  org.eclipse.swt.layout.GridData createSpanGD(int hSpan)
          Creates a grid data with the given amount of horizontal span.
protected  org.eclipse.swt.layout.GridData createTableSpanGD(int hSpan, int vSpan)
          Creates a grid data with the given amount of horizontal span, that is appropriate for uses in large tables.
protected  DCToggleButton createToggleButton(java.lang.String attrName, org.eclipse.jface.resource.ImageDescriptor img, java.lang.Object layoutData, java.lang.String checkedValue, java.lang.String uncheckedValue, java.lang.String tooltip)
          Creates and returns a DCToggleButton bound to the given attribute with the given layout data.
protected  org.eclipse.swt.layout.GridData createUnitsGD()
           
protected  void createUnitsTextAndCombo(java.lang.String attrName, java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits, java.lang.Object textLayoutData, boolean isVertical, boolean isComputable, boolean convertAuto, java.lang.String textToolTip, java.lang.String unitsToolTip, java.lang.String unitsLabel)
          Create a text and units combo pairing (for things like height, width, although there is a helper method available for that as well).
protected  void createUnitsTextAndCombo(java.lang.String attrName, java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits, java.lang.Object textLayoutData, boolean isVertical, boolean isComputable, boolean convertAuto, java.lang.String textToolTip, java.lang.String unitsToolTip, java.lang.String unitsLabel, java.lang.String id1, java.lang.String id2)
          Create a text and units combo pairing (for things like height, width, although there is a helper method available for that as well).
 void dispose()
           
protected  void finishCreation()
          Do any post-creation cleanup or state initialization.
protected  int getComputedExtraWidthHint()
          Returns the extra amount of width a computed field takes up under normal circumstances.
protected  java.lang.String getContextHelpId()
          Returns a fully qualified context ID that is to be used as the help id for the panel/composite.
protected  int getControlBigWidthHint()
          Returns the large width hint for normal controls.
protected  org.eclipse.swt.widgets.Control getControlForText(java.lang.String attribute)
          Return the control used to modify the text value for this attribute.
protected  org.eclipse.swt.widgets.Control getControlForUnits(java.lang.String attribute)
          Return the control used to modify the units value for this attribute.
protected  int getControlIndentAmt()
          Returns the amount of indent for a normal control.
protected  int getControlSmallWidthHint()
          Returns the small width hint for normal controls.
protected  int getControlWidthHint()
          Returns the width hint for normal controls.
protected  StringLookup getCSSLookup(java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits)
          Return a lookup for CSS units values.
protected  org.eclipse.swt.widgets.Composite getCurrentParent()
          Returns the current parent to add controls to.
protected  DataNode getDataNode()
          Returns the data node for the current parent.
protected  org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
          Returns the background color that is used by all property panels
protected  int getDefaultTextCols()
          Returns the default number of cols for a text field.
protected  int getExtraIndentAmt()
          Returns the amount of indent for a control/label that is indented below something (like a radio button) Can be overriden.
protected  com.ibm.commons.swt.util.IFigureContext getFigureContext()
          Gets the figure context for the figure represented in this panel.
protected  int getHeightHint(int lines)
          Return a height hint based on the current font metrics and number of lines specified.
protected  java.lang.String getLabelToolTipText(java.lang.String propertyName)
          Should be overridden by subclasses to return an appropriate tool tip for the given property name.
protected  int getNumParentColumns()
          Return the number of parent columns.
protected  org.eclipse.swt.graphics.Image getResetImage()
          Returns the imaged used for reset.
protected  void handleTooltip(org.eclipse.swt.widgets.Control control, java.lang.String tooltip)
          Sets the tooltip on the control and calls the method to cache the tooltip.
protected  void initialize()
          Initialize the current panel.
protected  void initLayout()
          Creates the outer composite and grid layout.
protected  void installScrolledCompositeListeners()
          Subclasses may override to handle scrolled composites differently.
 void panelCreated()
          Called after the panel has been set in its parent, after createPanel().
protected  void removeStateDependantChild(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Control child)
          Removes the association between the provided button and control.
protected  void resetControlListeners()
          Resets the scrolled composite listener.
 void runAfterCreation(java.lang.Runnable runnable)
          Adds a Runnable to a list of Runnable opertations that get executed after the panel has been created.
protected  void setCurrentParent(org.eclipse.swt.widgets.Composite newParent)
          Sets the current parent to add controls to.
 void setFigureContext(com.ibm.commons.swt.util.IFigureContext context)
          Sets the figure context for the figure this panel represents.
protected  boolean showTooltips()
          Should be overridden by subclasses who need to show tooltips conditionally (e.g.
protected  boolean useDCPanel()
          Subclasses should override this method if they want the child composites to be DCPanels.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, 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, getBorderWidth, getClientArea, getHorizontalBar, 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, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, 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, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT_SUFFIX

protected static final java.lang.String TEXT_SUFFIX
See Also:
Constant Field Values

UNITS_SUFFIX

protected static final java.lang.String UNITS_SUFFIX
See Also:
Constant Field Values
Constructor Detail

PropLayout

public PropLayout(org.eclipse.swt.widgets.Composite parent,
                  int style)
Constructs a new instance of the class given the parent Composite, and style flags which are used to set the look/behavior of the control.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. Style bits are also inherited from superclasses.

Parameters:
parent - a Composite control which will be the parent of the new instance (CANNOT be null).
style - the style of control to construct
Method Detail

createPanel

public final void createPanel()
Creates and initializes the panel.


panelCreated

public final void panelCreated()
Called after the panel has been set in its parent, after createPanel(). Subclasses will usually not need to call this method.


afterPanelCreation

protected void afterPanelCreation()
A helper method that allows the Subclass to perform any post creation processing. This method is called after the panel is fully created.


initialize

protected void initialize()
Initialize the current panel. Called before createContents().


createContents

protected void createContents()
Create contents of this panel. Subclasses should only override if no other create methods are available.


finishCreation

protected void finishCreation()
Do any post-creation cleanup or state initialization. Subclasses should not override unless they have a very good reason to. (As this will break dependant children).


installScrolledCompositeListeners

protected void installScrolledCompositeListeners()
Subclasses may override to handle scrolled composites differently. By default, uses com.ibm.commons.swt.SWTACCUtils#reinstallScrolledCompositeActivateListeners(Composite)

See Also:
SWTACCUtils

runAfterCreation

public void runAfterCreation(java.lang.Runnable runnable)
Adds a Runnable to a list of Runnable opertations that get executed after the panel has been created.

Parameters:
runnable -

resetControlListeners

protected void resetControlListeners()
Resets the scrolled composite listener.

See Also:
installScrolledCompositeListeners()

useDCPanel

protected boolean useDCPanel()
Subclasses should override this method if they want the child composites to be DCPanels. Note: this method should only be overriden if the user wants to specify thier own model, and wishes to do this at the child composite level. (In other words, they would like to use thier own Loader, but would like to keep the XFacesDomLoader in place at the higher level).

See Also:
DCPanel

initLayout

protected void initLayout()
Creates the outer composite and grid layout. This would contain either 1 or 2 columns. Users who override this method should call Composite.setLayout(org.eclipse.swt.widgets.Layout) in order to set an appropriate layout on this Composite.


getNumParentColumns

protected int getNumParentColumns()
Return the number of parent columns. Subclass can override.

Returns:
returns 1 by default

getControlWidthHint

protected int getControlWidthHint()
Returns the width hint for normal controls. Can be overriden.

Returns:
returns SWTLayoutUtils#CONTROL_WHINT

getControlBigWidthHint

protected int getControlBigWidthHint()
Returns the large width hint for normal controls. Can be overriden.

Returns:
returns SWTLayoutUtils.CONTROL_BIG_WHINT

getControlSmallWidthHint

protected int getControlSmallWidthHint()
Returns the small width hint for normal controls. Can be overriden.

Returns:
returns SWTLayoutUtils.CONTROL_BIG_WHINT

getComputedExtraWidthHint

protected int getComputedExtraWidthHint()
Returns the extra amount of width a computed field takes up under normal circumstances. Can be overriden.

Returns:
returns SWTLayoutUtils.COMPUTED_EXTRA_WIDTH

getControlIndentAmt

protected int getControlIndentAmt()
Returns the amount of indent for a normal control. Can be overriden.

Returns:
returns SWTLayoutUtils.CONTROL_INDENT_AMT

getExtraIndentAmt

protected int getExtraIndentAmt()
Returns the amount of indent for a control/label that is indented below something (like a radio button) Can be overriden.

Returns:
SWTLayoutUtils.EXTRA_INDENT_AMT

getDefaultTextCols

protected int getDefaultTextCols()
Returns the default number of cols for a text field. Can be overriden.

Returns:
SWTLayoutUtils.TEXT_COLS

getCurrentParent

protected org.eclipse.swt.widgets.Composite getCurrentParent()
Returns the current parent to add controls to.

DO NOT OVERRIDE


setCurrentParent

protected void setCurrentParent(org.eclipse.swt.widgets.Composite newParent)
Sets the current parent to add controls to.

DO NOT OVERRIDE


getDataNode

protected DataNode getDataNode()
Returns the data node for the current parent.

DO NOT OVERRIDE


setFigureContext

public void setFigureContext(com.ibm.commons.swt.util.IFigureContext context)
Sets the figure context for the figure this panel represents.

DO NOT OVERRIDE


getFigureContext

protected com.ibm.commons.swt.util.IFigureContext getFigureContext()
Gets the figure context for the figure represented in this panel.

DO NOT OVERRIDE


getResetImage

protected org.eclipse.swt.graphics.Image getResetImage()
Returns the imaged used for reset.

DO NOT OVERRIDE


createHeading

protected org.eclipse.swt.widgets.Label createHeading(java.lang.String label,
                                                      int numColumns)
Creates and returns a label used for headings.

Returns:

createDCText

protected DCText createDCText(java.lang.String attrName,
                              java.lang.Object layoutData)
Creates and returns a DCText which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The width of the control is determined by calling getDefaultTextCols(). The style SWT.BORDER is applied to the control.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
Returns:
returns a control with the given attributes

createDCText

protected DCText createDCText(java.lang.String attrName,
                              java.lang.Object layoutData,
                              int style)
Creates and returns a DCText which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The width of the control is determined by calling getDefaultTextCols(). The style flag is used to set the look/behavior of the control.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
style - the SWT style bit that is to be applied to the control
Returns:
returns a control with the given attributes

createDCTextComputed

protected DCCompositeText createDCTextComputed(java.lang.String attrName,
                                               java.lang.Object layoutData)
Creates and returns a DCCompositeText which is tied to the attribute provided. The value of the control is computable. The parent of the control is found internally by calling Control.getParent(). The style SWT.BORDER is applied to the control.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
Returns:
returns a control with the given attributes

createDCTextComputed

protected DCCompositeText createDCTextComputed(java.lang.String attrName,
                                               java.lang.Object layoutData,
                                               java.lang.String id)
Creates and returns a DCCompositeText which is tied to the attribute provided. The value of the control is computable. The parent of the control is found internally by calling Control.getParent(). The style SWT.BORDER is applied to the control.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
id - a programmatic id which can later be used to identify the control
Returns:
returns a control with the given attributes

createDCTextComputedPositiveIntegerOnly

protected DCCompositeText createDCTextComputedPositiveIntegerOnly(java.lang.String attrName,
                                                                  java.lang.Object layoutData)
Creates and returns a DCCompositeText which is tied to the attribute provided. The value of the control is computable. The parent of the control is found internally by calling Control.getParent(). The style SWT.BORDER is applied to the control. The resulting control only accepts positive integers as input.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
Returns:
returns a control with the given attributes
See Also:
IntegerValidator

createDCTextComputed

protected DCCompositeText createDCTextComputed(java.lang.String attrName,
                                               java.lang.Object layoutData,
                                               int style)
Creates and returns a DCCompositeText which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The style flag is used to set the look/behavior of the control.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
style - the SWT style bit that is to be applied to the control
Returns:
returns a control with the given attributes

createDCTextComputed

protected DCCompositeText createDCTextComputed(java.lang.String attrName,
                                               java.lang.Object layoutData,
                                               int style,
                                               java.lang.String id)
Creates and returns a DCCompositeText which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The style flag is used to set the look/behavior of the control.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
style - the SWT style bit that is to be applied to the control
id - a programmatic id that can later be used to identify the control
Returns:
returns a control with the given attributes

createComboComputed

protected DCCompositeCombo createComboComputed(java.lang.String attrName,
                                               ILookup lookup,
                                               org.eclipse.swt.layout.GridData layoutData,
                                               boolean hasFirstBlankLine,
                                               boolean isEditable)
Creates and returns a DCCompositeCombo which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The resulting combo control is populated with values provided in the lookup. The first line of the control may be blank depending on the parameters provided, and may also be editable.

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup used to populate the contents of the combo
layoutData - the layout to apply to the control that is created
hasFirstBlankLine - determines whether or not the first item (row) in the combo box should be blank (empty)
isEditable - determines whether or not the combo box should be editable
Returns:
returns a control with the given attributes

createComboComputed

protected DCCompositeCombo createComboComputed(java.lang.String attrName,
                                               ILookup lookup,
                                               org.eclipse.swt.layout.GridData layoutData,
                                               boolean hasFirstBlankLine,
                                               boolean isEditable,
                                               java.lang.String id)
Creates and returns a DCCompositeCombo which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The resulting combo control is populated with values provided in the lookup. The first line of the control may be blank depending on the parameters provided, and may also be editable.

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup used to populate the contents of the combo
layoutData - the layout to apply to the control that is created
hasFirstBlankLine - determines whether or not the first item (row) in the combo box should be blank (empty)
isEditable - determines whether or not the combo box should be editable
Returns:
returns a control with the given attributes

createComboComputed

protected DCCompositeCombo createComboComputed(java.lang.String attrName,
                                               ILookup lookup,
                                               org.eclipse.swt.layout.GridData layoutData,
                                               boolean hasFirstBlankLine,
                                               boolean isEditable,
                                               java.lang.String id,
                                               java.lang.String firstLineTitle)
Creates and returns a DCCompositeCombo which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The resulting combo control is populated with values provided in the lookup. The first line of the control may be blank depending on the parameters provided, and may also be editable.

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup used to populate the contents of the combo
layoutData - the layout to apply to the control that is created
hasFirstBlankLine - determines whether or not the first item (row) in the combo box should be blank (empty)
isEditable - determines whether or not the combo box should be editable
id - a programmatic id that can later be used to identify the control
firtLineTitle - if the first line is set to be blank, then the title provided in this parameter is used as the title of the item
Returns:
returns a control with the given attributes

createComboComputed

protected DCCompositeCombo createComboComputed(java.lang.String attrName,
                                               ILookup lookup,
                                               org.eclipse.swt.layout.GridData layoutData,
                                               java.lang.String defaultValue,
                                               boolean isEditable,
                                               java.lang.String id)
Creates and returns a DCCompositeCombo which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed. The resulting combo control is populated with values provided in the lookup. The default value of the combo is provided as a parameter.

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup used to populate the contents of the combo
layoutData - the layout to apply to the control that is created
hasFirstBlankLine - determines whether or not the first item (row) in the combo box should be blank (empty)
defaultValue - if set determines which item in the combo should be selected by default
isEditable - determines whether or not the combo box should be editable
id - a programmatic id that can later be used to identify the control
Returns:
returns a control with the given attributes

createDCCheckboxComputed

protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName,
                                                       java.lang.String checkedValue,
                                                       java.lang.String labelText,
                                                       java.lang.Object layoutData)
Creates and returns a DCCompositeCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed.

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value in the model that results in the control being checked
labelText - the text to appear in the label portion of the control
layoutData - the layout to be set on the resulting control
Returns:
returns a control with the given attributes

createDCCheckboxComputed

protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName,
                                                       java.lang.String checkedValue,
                                                       java.lang.String unCheckedValue,
                                                       boolean defaultValue,
                                                       java.lang.String labelText,
                                                       java.lang.Object layoutData)
Creates and returns a DCCompositeCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed.

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value in the model that results in the control being checked
uncheckedValue - the value in the model that results in the control being unchecked
defaultValue - the default value of the control (checked/unchecked)
labelText - the text to appear in the label portion of the control
layoutData - the layout to be set on the resulting control
Returns:
returns a control with the given attributes

createDCCheckboxComputed

protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName,
                                                       java.lang.String checkedValue,
                                                       java.lang.String unCheckedValue,
                                                       boolean defaultValue,
                                                       java.lang.String labelText,
                                                       java.lang.Object layoutData,
                                                       java.lang.String id)
Creates and returns a DCCompositeCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed.

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value in the model that results in the control being checked
uncheckedValue - the value in the model that results in the control being unchecked
defaultValue - the default value of the control (checked/unchecked)
labelText - the text to appear in the label portion of the control
layoutData - the layout to be set on the resulting control
id - a programmatic id that can later be used to identify the control
Returns:
returns a control with the given attributes

createDCCheckboxComputed

protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName,
                                                       java.lang.String checkedValue,
                                                       java.lang.String labelText,
                                                       java.lang.Object layoutData,
                                                       java.lang.String id)
Creates and returns a DCCompositeCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed.

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value in the model that results in the control being checked
labelText - the text to appear in the label portion of the control
layoutData - the layout to be set on the resulting control
id - a programmatic id that can later be used to identify the control
Returns:
returns a control with the given attributes

createDCRadioButton

protected DCRadioButton createDCRadioButton(java.lang.String attrName,
                                            java.lang.String checkedValue,
                                            java.lang.String labelText,
                                            java.lang.Object layoutData)
Creates and returns a DCRadioButton which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The value of the resulting control can be computed.

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value in the model that results in the control being checked
labelText - the text to appear in the label portion of the control
layoutData - the layout to be set on the resulting control
Returns:
returns a control with the given attributes

createDCTextNoWidth

protected DCText createDCTextNoWidth(java.lang.String attrName,
                                     java.lang.Object layoutData)
Creates and returns a DCText which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). The style SWT.BORDER is applied to the control.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
Returns:
returns a control with the given attributes

getHeightHint

protected int getHeightHint(int lines)
Return a height hint based on the current font metrics and number of lines specified.

Returns:

createMultiLineText

protected DCText createMultiLineText(java.lang.String attrName,
                                     java.lang.Object layoutData,
                                     int lines)
Creates and returns a multi-line DCText bound to the given attribute with the given layout data.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
lines - - number of lines in the multiline control. If zero, then use the height hint in layoutData. If greater than zero, then size the control to the number of lines using the current font.
Returns:
returns a control with the given attributes

createMultiLineTextComputed

protected DCCompositeText createMultiLineTextComputed(java.lang.String attrName,
                                                      java.lang.Object layoutData,
                                                      int lines)
Creates and returns a multi-line DCText bound to the given attribute with the given layout data.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
lines - - number of lines in the multiline control. If zero, then use the height hint in layoutData. If greater than zero, then size the control to the number of lines using the current font.
Returns:
returns a control with the given attributes

createDCLabel

protected DCLabel createDCLabel(java.lang.String attrName,
                                java.lang.Object layoutData)
Creates and returns a DCLabel bound to the given attribute with the given layout data.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout to apply to the control that is created
Returns:
returns a control with the given attributes

createToggleButton

protected DCToggleButton createToggleButton(java.lang.String attrName,
                                            org.eclipse.jface.resource.ImageDescriptor img,
                                            java.lang.Object layoutData,
                                            java.lang.String checkedValue,
                                            java.lang.String uncheckedValue,
                                            java.lang.String tooltip)
Creates and returns a DCToggleButton bound to the given attribute with the given layout data.

Parameters:
attrName - the name of the attribute that this control will represent
img - an image to use on the button
checkedValue - the value which when set in the model will cause the button to be selected
uncheckedValue - the value which when set in the model will cause the button to be unselected
tooltip - the tooltip text to be set on the button
Returns:
returns a control with the given attributes

createResetButton

protected org.eclipse.swt.widgets.Button createResetButton(java.util.List<java.lang.String> attributes,
                                                           java.lang.String text,
                                                           java.lang.Object layoutData,
                                                           java.lang.String tooltip)
Create and return a button that resets the given attributes.

Parameters:
attributes - a list of attributes whose values should be reset to null when the button is pressed
text - the text to appear on the button
layoutData - the layout of the button
tooltip - the tooltip text to appear on the button
Returns:
returns a control with the given attributes

createResetButton

protected org.eclipse.swt.widgets.Button createResetButton(java.util.List<java.lang.String> attributes,
                                                           java.lang.Object layoutData,
                                                           java.lang.String tooltip)
Create and return a button that resets the given attributes.

Parameters:
attributes - a list of attributes whose values should be reset to null when the button is pressed
layoutData - the layout of the button
tooltip - the tooltip text to appear on the button
Returns:
returns a control with the given attributes

createHeightWidthSection

protected void createHeightWidthSection(java.lang.Object textLayoutData,
                                        java.util.List<com.ibm.commons.css.api.CSSLengthUnits> heightAcceptedUnits,
                                        java.util.List<com.ibm.commons.css.api.CSSLengthUnits> widthAcceptedUnits,
                                        boolean hasHeight,
                                        boolean hasWidth)
Create labels, and widgets for modifying style values of height/width.

Parameters:
textLayoutData - - the layout data for the text boxes (specify to set span, or indent).

createCombo

protected DCComboBox createCombo(java.lang.String attrName,
                                 ILookup lookup,
                                 org.eclipse.swt.layout.GridData layoutData,
                                 boolean hasFirstBlankLine,
                                 int swtStyle)
Creates and returns a DCComboBox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent().

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup that is used to populate the combo box
layoutData - the layout to apply to the control that is created
hasFirstLineBlank - determines whether or not the first item in the combo should be blank (empty)
Returns:
returns a control with the given attributes

createCombo

protected DCComboBox createCombo(java.lang.String attrName,
                                 ILookup lookup,
                                 org.eclipse.swt.layout.GridData layoutData,
                                 boolean hasFirstBlankLine)
Creates and returns a read-only DCComboBox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent().

Parameters:
attrName - the name of the attribute that this control will represent
lookup - the lookup that is used to populate the combo box
layoutData - the layout to apply to the control that is created
hasFirstLineBlank - determines whether or not the first item in the combo should be blank (empty)
Returns:
returns a control with the given attributes

createLabel

protected org.eclipse.swt.widgets.Label createLabel(java.lang.String text,
                                                    java.lang.Object layoutData)
Creates and returns a Label with the given text and layout data.

Parameters:
text - the text to appear in the label
layoutData - the layout data to be applied to the control
Returns:
a label control

getDefaultBackgroundColor

protected org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
Returns the background color that is used by all property panels

Returns:

createLabel

protected org.eclipse.swt.widgets.Label createLabel(java.lang.String text,
                                                    java.lang.Object layoutData,
                                                    java.lang.String toolTipText)
Creates and returns a Label with the given text, layout data, and tool tip text.

Parameters:
text - the text that is to appear in the label
layoutData - the layout data that is to be applied to the label
toolTipText - the text to apply as a tooltip for the label
Returns:
a label control

getLabelToolTipText

protected java.lang.String getLabelToolTipText(java.lang.String propertyName)
Should be overridden by subclasses to return an appropriate tool tip for the given property name.

Parameters:
propertyName - the name of the property whose tooltip is sought
Returns:
a tooltip appropriate for the given property. Default is null.

handleTooltip

protected void handleTooltip(org.eclipse.swt.widgets.Control control,
                             java.lang.String tooltip)
Sets the tooltip on the control and calls the method to cache the tooltip. Note that the cache method does nothing by default.

Parameters:
control - the control that the tooltip will be set on
tooltip - the tooltip text
See Also:
cacheToolTip(Control, String)

cacheToolTip

protected void cacheToolTip(org.eclipse.swt.widgets.Control control,
                            java.lang.String tooltip)
Should be overridden by subclasses who need to keep track of tooltips for some reason, e.g. if an expensive operation is executed to retrieve a tooltip then the tooltip should be cached.

Parameters:
control - the control whose tooltip is provided
tooltip - the tooltip text

showTooltips

protected boolean showTooltips()
Should be overridden by subclasses who need to show tooltips conditionally (e.g. according to preferences)

Returns:
returns whether or not tooltips should be displayed, defaults to true.

createDCCheckBox

protected DCCheckbox createDCCheckBox(java.lang.String attrName,
                                      java.lang.String checkedValue,
                                      java.lang.String unCheckedValue,
                                      java.lang.String text,
                                      java.lang.Object layoutData)
Creates and returns a DCCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent().

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value that will cause this control to be checked
uncheckedValue - the value that will cuase this control to be unchecked
text - the text to appear on the control
layoutData - the layout data that is to be applied to the control
Returns:
returns a control with the given attributes

createDCCheckBox

protected DCCheckbox createDCCheckBox(java.lang.String attrName,
                                      java.lang.String checkedValue,
                                      java.lang.String unCheckedValue,
                                      java.lang.String text,
                                      java.lang.Object layoutData,
                                      java.lang.String id)
Creates and returns a DCCheckbox which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent().

Parameters:
attrName - the name of the attribute that this control will represent
checkedValue - the value that will cause this control to be checked
uncheckedValue - the value that will cuase this control to be unchecked
text - the text to appear on the control
layoutData - the layout data that is to be applied to the control
id - a programmatic id that can later be used to identify the control
Returns:
returns a control with the given attributes

createColorButton

protected DCColorButton createColorButton(java.lang.String attrName,
                                          java.lang.Object layoutData,
                                          java.lang.String colorTooltip,
                                          java.lang.String resetTooltip)
Creates and returns a DCColorButton which is tied to the attribute provided. The parent of the control is found internally by calling Control.getParent(). A reset button is also created.

Parameters:
attrName - the name of the attribute that this control will represent
layoutData - the layout data that is to be used to lay out the control
colorTooltip - the tooltip to be used with the color button
resetTooltip - the tooltip to be used with the corresponding reset button
Returns:
returns a control with the given attributes

createUnitsTextAndCombo

protected void createUnitsTextAndCombo(java.lang.String attrName,
                                       java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits,
                                       java.lang.Object textLayoutData,
                                       boolean isVertical,
                                       boolean isComputable,
                                       boolean convertAuto,
                                       java.lang.String textToolTip,
                                       java.lang.String unitsToolTip,
                                       java.lang.String unitsLabel)
Create a text and units combo pairing (for things like height, width, although there is a helper method available for that as well).

Parameters:
attrName - the name of the attribute that this control will represent
acceptedUnits - the units that can be used by this attribute
textLayoutData - the layout data for the text part of the contro
isVertical - specifies whether the units we are dealing with are vertical units
isComputable - determines whether or not the attribute can be computed
convertAuto -
textToolTip - the tooltip to be set on the text field
unitsToolTip - the tooltip to be set on the units field
unitsLabel - the label to correspond to the units field

createUnitsTextAndCombo

protected void createUnitsTextAndCombo(java.lang.String attrName,
                                       java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits,
                                       java.lang.Object textLayoutData,
                                       boolean isVertical,
                                       boolean isComputable,
                                       boolean convertAuto,
                                       java.lang.String textToolTip,
                                       java.lang.String unitsToolTip,
                                       java.lang.String unitsLabel,
                                       java.lang.String id1,
                                       java.lang.String id2)
Create a text and units combo pairing (for things like height, width, although there is a helper method available for that as well).

Parameters:
attrName - the name of the attribute that this control will represent
acceptedUnits - the units that can be used by this attribute
textLayoutData - the layout data for the text part of the contro
isVertical - specifies whether the units we are dealing with are vertical units
isComputable - determines whether or not the attribute can be computed
convertAuto -
textToolTip - the tooltip to be set on the text field
unitsToolTip - the tooltip to be set on the units field
unitsLabel - the label to correspond to the units field
id1 - the programmatic id to be used on the first text field
id2 - the programmatic id to be used on the second text field

createFormatBean

protected com.ibm.commons.css.FormatBean createFormatBean(DataNode node)
Can be overriden by subclass to provider thier own format bean implementation. Creates a new bean that can be used when getting/setting formatting properties.

Parameters:
node - The DataNode associated with the current model
Returns:
a formatting bean
See Also:
FormatBean

getControlForUnits

protected org.eclipse.swt.widgets.Control getControlForUnits(java.lang.String attribute)
Return the control used to modify the units value for this attribute.


getControlForText

protected org.eclipse.swt.widgets.Control getControlForText(java.lang.String attribute)
Return the control used to modify the text value for this attribute.


createUnitsGD

protected org.eclipse.swt.layout.GridData createUnitsGD()

checkEnableText

protected void checkEnableText(DCCompositeText text,
                               IAttribute textAttr,
                               IAttribute unitsAttr)
Enable or disable the given text field based on its attribute

Parameters:
text -
textAttr -
unitsAttr -

getCSSLookup

protected StringLookup getCSSLookup(java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits)
Return a lookup for CSS units values.


createFillGD

protected org.eclipse.swt.layout.GridData createFillGD(int hSpan)
Create a grid data that consumes all space, and spans the given amount of columns.

Parameters:
hSpan - the number of horizontal columns that need to be spanned
Returns:
returns a GridData with the specified attributes

createLabelSpanGD

protected org.eclipse.swt.layout.GridData createLabelSpanGD(int hSpan,
                                                            int vSpan)
Creates a grid data that helps align a label that must span a control that takes up multiple rows.

Parameters:
hSpan - the number of columns to span
vSpan - the number of rows to span
Returns:
returns a GridData object

createControlGDDefWidth

protected org.eclipse.swt.layout.GridData createControlGDDefWidth(int hSpan)
Creates a grid data that has default control indent and width hint.

Parameters:
hSpan - the number of columns to span
Returns:
returns a GridData object

createControlNonComputedGD

protected org.eclipse.swt.layout.GridData createControlNonComputedGD(int hSpan,
                                                                     int computedWidthHint)
Create a grid data for a control used with computed controls that is not computed.

Parameters:
hSpan - the number of columns to span
computedWidthHint - the width hint of the computed control

createControlGDMultiLine

protected org.eclipse.swt.layout.GridData createControlGDMultiLine(int hSpan,
                                                                   int numLines,
                                                                   boolean grabVSpace)
Create a grid data that has default control indent and given hSpan, number of lines, and whether or not it should fill the vertical space.

Parameters:
hSpan - the number of columns to span
numLines - the height in rows
grabVSpace - determines whether or not the GridData should grab excess horizontal space
Returns:
a GridData object

createControlGDBigWidth

protected org.eclipse.swt.layout.GridData createControlGDBigWidth(int hSpan)
Creates a grid data that has default control indent and large width hint.

Parameters:
hSpan - the number of columns to span

createControlGDSmallWidth

protected org.eclipse.swt.layout.GridData createControlGDSmallWidth(int hSpan)
Creates a grid data that has default control indent and small width hint.

Parameters:
hSpan - the number of columns to span

createControlGDNoWidth

protected org.eclipse.swt.layout.GridData createControlGDNoWidth(int hSpan)
Creates a grid data that has default control indent, no width hint.

Parameters:
hSpan - the number of columns to span

createControlGDFill

protected org.eclipse.swt.layout.GridData createControlGDFill(int hSpan)
Creates a grid data that has default control ident, and fills all available horizontal space.

Parameters:
hSpan - the number of columns to span

createSizeTextGD

protected org.eclipse.swt.layout.GridData createSizeTextGD(int hSpan)
Creates a grid data specifically for dealing with DC Text used for sized controls.

Parameters:
hSpan - the number of columns to span

createIndentGD

protected org.eclipse.swt.layout.GridData createIndentGD(int indentAmt,
                                                         int hSpan)
Creates a grid data with the given amount of indentation, and the given horizontal span.

Parameters:
indentAmt - the number of pixels to indent the control
hSpan - the number of columns to span

createExtraIndentGD

protected org.eclipse.swt.layout.GridData createExtraIndentGD(int hSpan)
Creates a grid data that is indented below something, and the given horizontal span.

Parameters:
hSpan - the number of columns to span

createSpanGD

protected org.eclipse.swt.layout.GridData createSpanGD(int hSpan)
Creates a grid data with the given amount of horizontal span.

Parameters:
hSpan - the number of columns to span

createTableSpanGD

protected org.eclipse.swt.layout.GridData createTableSpanGD(int hSpan,
                                                            int vSpan)
Creates a grid data with the given amount of horizontal span, that is appropriate for uses in large tables.

Parameters:
hSpan - the number of columns to span
vSpan - the number of rows to span

createFillSpanGD

protected org.eclipse.swt.layout.GridData createFillSpanGD(int hSpan)
Creates a grid data that fills horizontal space and takes the given amount of span.

Parameters:
hSpan - the number of columns to span

createGroupBoxGridData

protected org.eclipse.swt.layout.GridData createGroupBoxGridData()
Creates a grid data for a group box - fills horizontal, but not vertical.


createChildLayout

protected org.eclipse.swt.layout.GridLayout createChildLayout(int numColumns)
Create the layout for the child composite which will contain all the controls. Can be subclassed, though there should be no need to do so.

Parameters:
numColumns - the number of columns that the child Composite should contain
Returns:
returns a GridLayout object

createNoMarginGridLayout

protected org.eclipse.swt.layout.GridLayout createNoMarginGridLayout(int numColumns)
Create a grid layout that has no margins, and no default spacing.

Parameters:
numColumns - the number of columns
Returns:
returns a GridLayout object
See Also:
com.ibm.commons.swt.SWTLayoutUtils.createLayoutNoMarginNoSpacing(int)

createGroupBoxLayout

protected org.eclipse.swt.layout.GridLayout createGroupBoxLayout(int numColumns)
Create a grid layout to use inside of a group box.

Parameters:
numColumns - the number of columns
Returns:
returns a GridLayout object

addStateDependantChild

protected void addStateDependantChild(org.eclipse.swt.widgets.Button button,
                                      org.eclipse.swt.widgets.Control child,
                                      boolean association)
Make the given child control dependant on the given button. This means, if the button is not selected, it will disable all these controls. When the button is selected, the controls will be enabled. When the button is de-selected, the controls will be disabled and if a given attribute is present, it will be set to null in the data node.

Parameters:
button - a checkbox or radio button (DC or not)
child - a child control to be dependant
association - if true, this means that the given child is enabled when the button is selected. If false, it means this child is enabled only if the button is not selected.

removeStateDependantChild

protected void removeStateDependantChild(org.eclipse.swt.widgets.Button button,
                                         org.eclipse.swt.widgets.Control child)
Removes the association between the provided button and control.

Parameters:
button - SWT button that is associated with the provided child control
child - control associated with the provided button

checkSelection

protected void checkSelection(org.eclipse.swt.widgets.Button button,
                              org.eclipse.swt.widgets.Button notifier)
Parameters:
button - the button whose selection needs to be calculated
notifier - can be null, if not, indicates which parent button notified this child to check it's selection. This is used so that the parent is not notified in case it is also dependant on the child.

getContextHelpId

protected java.lang.String getContextHelpId()
Returns a fully qualified context ID that is to be used as the help id for the panel/composite.

Returns:
a context id that included the qualified plugin name where the help resides

dispose

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