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

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
                      extended by com.ibm.commons.swt.data.layouts.PropLayout2
                          extended by com.ibm.commons.swt.data.layouts.PropLayoutGroupBox
                              extended by com.ibm.commons.swt.data.layouts.BasicsPanel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
XSPBasicsPanel

public class BasicsPanel
extends PropLayoutGroupBox

A basic properties panel which can be used in conjunction with most controls. The contents of the panel is generated automatically based on the attributes available on the control. It is intended that subclasses will override certain methods in order to achieve the desired panel content.


Field Summary
protected static java.lang.String NAME_REGEX
           
 
Fields inherited from class com.ibm.commons.swt.data.layouts.PropLayout
TEXT_SUFFIX, UNITS_SUFFIX
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
BasicsPanel(org.eclipse.swt.widgets.Composite parent, int style)
          Create a new basics panel that will live inside the given parent.
 
Method Summary
protected  void createAccelerator()
          Creates the Accelerator field.
protected  void createAutomatedSection()
          Creates the contents of the panel based on the attributes of the selected control.
protected  void createBidi()
          Create the Bidi field.
protected  void createEnabled()
          Creates the Enabled field.
protected  void createHeightAndWidth()
          Creates the Height and Width fields.
protected  void createLeftContents(org.eclipse.swt.widgets.Composite leftChild)
          Create the controls that go in the left column.
protected  org.eclipse.swt.widgets.Control createName()
          Creates the Name field.
protected  void createPostSection()
          Create any controls that should go after the auto-generated ones.
protected  void createPreSection()
          Create any controls that should go before the auto-generated ones.
protected  void createReadOnly()
          Creates the Read-Only field.
protected  void createRightContents(org.eclipse.swt.widgets.Composite rightChild)
          Create the group box and initalize its layout.
protected  void createShowReadOnlyAsDisabled()
          Creates the Show Read-Only As Disabled field.
protected  void createTabOrder()
          Creates the Tab Order field.
protected  void createValue()
          Creates the Value field.
protected  void createVisible()
          Creates the Visible field.
protected  java.lang.String getAcceleratorAttr()
          Returns the attribute name of the Accelerator attribute.
protected  IValidator getAcceleratorValidator()
          Returns a validator to be used with the Accelerator field.
protected  java.lang.String getBidiAttr()
          Returns the attribute name of the Bidi attribute.
protected  StringLookup getBidiTypesLookup()
          Returns a StringLookup that is to be used to populate the Bidi field.
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  java.lang.String getEnabledAttr()
          Returns the attribute name of the Enabled attribute.
protected  boolean getEnabledDefaultValue()
          Returns the default value for the Enabled field.
protected  java.util.List<com.ibm.commons.css.api.CSSLengthUnits> getHeightUnits()
           
protected  java.lang.String getNameAttr()
          Returns the attribute name for the Name field (normally 'id').
protected  IValidator getNameValidator()
          Returns a validator to be used with the Name field.
protected  int getNumLeftColumns()
          Return the number of columns in the left child composite.
protected  java.lang.String getReadOnlyAttr()
          Returns the attribute name of the Read-Only attribute.
protected  boolean getReadOnlyDefaultValue()
          Returns the default value for the Read-Only field.
protected  java.lang.String getShowReadOnlyAsDisabledAttr()
          Returns the attribute name of the Show Read Only As Disabled attribute.
protected  java.lang.String getTabOrderAttr()
          Returns the attribute name of the Tab Order attribute.
protected  IValidator getTabOrderValidator()
          Returns a validator to be used with the Tab Order field.
protected  java.lang.String getValueAttr()
          Returns the attribute name of the Value attribute.
protected  java.lang.String getVisibleAttr()
          Returns the attribute name of the Visible attribute.
protected  boolean getVisibleDefaultValue()
          Returns the default value for the Visible field.
protected  java.util.List<com.ibm.commons.css.api.CSSLengthUnits> getWidthUnits()
           
protected  boolean hasAccelerator()
          Returns true if the panel should have an Accelerator field.
protected  boolean hasBidi()
          Returns true if the panel should have a Bidi field.
protected  boolean hasEnabled()
          Returns true if the panel should have an Enabled field.
protected  boolean hasGroupBox()
          Return true if this basics panel has any options.
protected  boolean hasHeight()
          Returns true if the panel should have a Height field.
protected  boolean hasName()
          Returns true if the panel should have a Name field.
protected  boolean hasReadOnly()
          Returns true if the panel should have a Read-Only field.
protected  boolean hasShowReadOnlyAsDisabled()
          Returns true if the panel should have a Show Read Only As Disabled field.
protected  boolean hasTabOrder()
          Returns true if the panel should have a Tab Order field.
protected  boolean hasValue()
          Returns true if the panel should have a Value field.
protected  boolean hasVisible()
          Returns true if the panel should have a Visible field.
protected  boolean hasWidth()
          Returns true if the panel should have a Width field.
 
Methods inherited from class com.ibm.commons.swt.data.layouts.PropLayoutGroupBox
createGroupBoxContents, getGroupTitle, getNumGroupBoxColumns, getNumRightColumns
 
Methods inherited from class com.ibm.commons.swt.data.layouts.PropLayout2
createChildComposites, createColumnGridData, createContents, getNumParentColumns, isFirstColumnUsed, isSecondColumnUsed
 
Methods inherited from class com.ibm.commons.swt.data.layouts.PropLayout
addStateDependantChild, afterPanelCreation, cacheToolTip, checkEnableText, checkSelection, createChildLayout, createColorButton, createCombo, createCombo, createComboComputed, createComboComputed, createComboComputed, createComboComputed, createControlGDBigWidth, createControlGDDefWidth, createControlGDFill, createControlGDMultiLine, createControlGDNoWidth, createControlGDSmallWidth, createControlNonComputedGD, createDCCheckBox, createDCCheckBox, createDCCheckboxComputed, createDCCheckboxComputed, createDCCheckboxComputed, createDCCheckboxComputed, createDCLabel, createDCRadioButton, createDCText, createDCText, createDCTextComputed, createDCTextComputed, createDCTextComputed, createDCTextComputed, createDCTextComputedPositiveIntegerOnly, createDCTextNoWidth, createExtraIndentGD, createFillGD, createFillSpanGD, createFormatBean, createGroupBoxGridData, createGroupBoxLayout, createHeading, createHeightWidthSection, createIndentGD, createLabel, createLabel, createLabelSpanGD, createMultiLineText, createMultiLineTextComputed, createNoMarginGridLayout, createPanel, createResetButton, createResetButton, createSizeTextGD, createSpanGD, createTableSpanGD, createToggleButton, createUnitsGD, createUnitsTextAndCombo, createUnitsTextAndCombo, dispose, finishCreation, getComputedExtraWidthHint, getControlBigWidthHint, getControlForText, getControlForUnits, getControlIndentAmt, getControlSmallWidthHint, getControlWidthHint, getCSSLookup, getCurrentParent, getDataNode, getDefaultBackgroundColor, getDefaultTextCols, getExtraIndentAmt, getFigureContext, getHeightHint, getLabelToolTipText, getResetImage, handleTooltip, initialize, initLayout, installScrolledCompositeListeners, panelCreated, removeStateDependantChild, resetControlListeners, runAfterCreation, setCurrentParent, setFigureContext, showTooltips, useDCPanel
 
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

NAME_REGEX

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

BasicsPanel

public BasicsPanel(org.eclipse.swt.widgets.Composite parent,
                   int style)
Create a new basics panel that will live inside the given parent. Assumes this parent is ready for controls.

Parameters:
numColumns - - the number of columns in this composite.
Method Detail

hasGroupBox

protected boolean hasGroupBox()
Return true if this basics panel has any options.


createPreSection

protected void createPreSection()
Create any controls that should go before the auto-generated ones.


createPostSection

protected void createPostSection()
Create any controls that should go after the auto-generated ones.


getHeightUnits

protected java.util.List<com.ibm.commons.css.api.CSSLengthUnits> getHeightUnits()

getWidthUnits

protected java.util.List<com.ibm.commons.css.api.CSSLengthUnits> getWidthUnits()

hasName

protected boolean hasName()
Returns true if the panel should have a Name field.

Returns:

hasValue

protected boolean hasValue()
Returns true if the panel should have a Value field.

Returns:

hasVisible

protected boolean hasVisible()
Returns true if the panel should have a Visible field.

Returns:

hasReadOnly

protected boolean hasReadOnly()
Returns true if the panel should have a Read-Only field.

Returns:

hasEnabled

protected boolean hasEnabled()
Returns true if the panel should have an Enabled field.

Returns:

hasTabOrder

protected boolean hasTabOrder()
Returns true if the panel should have a Tab Order field.

Returns:

hasAccelerator

protected boolean hasAccelerator()
Returns true if the panel should have an Accelerator field.

Returns:

hasHeight

protected boolean hasHeight()
Returns true if the panel should have a Height field.

Returns:

hasWidth

protected boolean hasWidth()
Returns true if the panel should have a Width field.

Returns:

hasShowReadOnlyAsDisabled

protected boolean hasShowReadOnlyAsDisabled()
Returns true if the panel should have a Show Read Only As Disabled field.

Returns:

hasBidi

protected boolean hasBidi()
Returns true if the panel should have a Bidi field.

Returns:

getEnabledDefaultValue

protected boolean getEnabledDefaultValue()
Returns the default value for the Enabled field.

Returns:

getVisibleDefaultValue

protected boolean getVisibleDefaultValue()
Returns the default value for the Visible field.

Returns:

getReadOnlyDefaultValue

protected boolean getReadOnlyDefaultValue()
Returns the default value for the Read-Only field.

Returns:

getNameAttr

protected java.lang.String getNameAttr()
Returns the attribute name for the Name field (normally 'id').

Returns:

getAcceleratorAttr

protected java.lang.String getAcceleratorAttr()
Returns the attribute name of the Accelerator attribute.

Returns:

getEnabledAttr

protected java.lang.String getEnabledAttr()
Returns the attribute name of the Enabled attribute.

Returns:

getShowReadOnlyAsDisabledAttr

protected java.lang.String getShowReadOnlyAsDisabledAttr()
Returns the attribute name of the Show Read Only As Disabled attribute.

Returns:

getTabOrderAttr

protected java.lang.String getTabOrderAttr()
Returns the attribute name of the Tab Order attribute.

Returns:

getVisibleAttr

protected java.lang.String getVisibleAttr()
Returns the attribute name of the Visible attribute.

Returns:

getReadOnlyAttr

protected java.lang.String getReadOnlyAttr()
Returns the attribute name of the Read-Only attribute.

Returns:

getValueAttr

protected java.lang.String getValueAttr()
Returns the attribute name of the Value attribute.

Returns:

getTabOrderValidator

protected IValidator getTabOrderValidator()
Returns a validator to be used with the Tab Order field.

Returns:

getAcceleratorValidator

protected IValidator getAcceleratorValidator()
Returns a validator to be used with the Accelerator field.

Returns:

getNameValidator

protected IValidator getNameValidator()
Returns a validator to be used with the Name field.

Returns:

getBidiAttr

protected java.lang.String getBidiAttr()
Returns the attribute name of the Bidi attribute.

Returns:

getBidiTypesLookup

protected StringLookup getBidiTypesLookup()
Returns a StringLookup that is to be used to populate the Bidi field.

Returns:

getNumLeftColumns

protected int getNumLeftColumns()
Description copied from class: PropLayout2
Return the number of columns in the left child composite.

Overrides:
getNumLeftColumns in class PropLayout2
Returns:
returns 2 by default

createLeftContents

protected void createLeftContents(org.eclipse.swt.widgets.Composite leftChild)
Description copied from class: PropLayout2
Create the controls that go in the left column.

Subclasses SHOULD override this method

Overrides:
createLeftContents in class PropLayout2
Parameters:
leftChild - the left child Composite

createAutomatedSection

protected void createAutomatedSection()
Creates the contents of the panel based on the attributes of the selected control.


createRightContents

protected void createRightContents(org.eclipse.swt.widgets.Composite rightChild)
Description copied from class: PropLayoutGroupBox
Create the group box and initalize its layout.

DO NOT OVERRIDE

Overrides:
createRightContents in class PropLayoutGroupBox
Parameters:
rightChild - the right child Composite

createName

protected org.eclipse.swt.widgets.Control createName()
Creates the Name field.

Returns:
a control that will edit the Name attribute

createValue

protected void createValue()
Creates the Value field.


createVisible

protected void createVisible()
Creates the Visible field.


createReadOnly

protected void createReadOnly()
Creates the Read-Only field.


createEnabled

protected void createEnabled()
Creates the Enabled field.


createShowReadOnlyAsDisabled

protected void createShowReadOnlyAsDisabled()
Creates the Show Read-Only As Disabled field.


createTabOrder

protected void createTabOrder()
Creates the Tab Order field.


createAccelerator

protected void createAccelerator()
Creates the Accelerator field.


createHeightAndWidth

protected void createHeightAndWidth()
Creates the Height and Width fields.


createBidi

protected void createBidi()
Create the Bidi field.


getContextHelpId

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

Overrides:
getContextHelpId in class PropLayout
Returns:
a context id that included the qualified plugin name where the help resides