com.ibm.designer.ide.xsp.components.api.panels
Class XSPBasicsPanel

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
                                  extended by com.ibm.designer.ide.xsp.components.api.panels.XSPBasicsPanel
All Implemented Interfaces:
IPanelDataReciever, org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
JavaControlBasicsPanel, XSPBasicsPanelNoOptions, XSPBasicsPanelWithValue

public class XSPBasicsPanel
extends BasicsPanel
implements IPanelDataReciever

A panel that dynamically builds its contents based on what is available in the FacesRegistry for the selected control.
By default this panel will lay out its controls in two distinct columns. This panel is used by the VAST majority of XPage controls for their basics panel. It is highly recommended to reuse this panel if possible.

See Also:
PropLayoutGroupBox

Field Summary
protected  DataNodeAdapter _listener
           
protected  java.util.Map<org.eclipse.swt.widgets.Control,java.lang.String> controlTooltipMap
           
 
Fields inherited from class com.ibm.commons.swt.data.layouts.BasicsPanel
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
XSPBasicsPanel(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 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 checkComputed(org.eclipse.swt.widgets.Label label, DataNode node)
          Checks if a label should be computed/visible based on presence of the style attribute.
 void createContents()
          Called to create the panel's contents.
protected  com.ibm.commons.css.FormatBean createFormatBean(DataNode node)
          Can be overriden by subclass to provider thier own format bean implementation.
protected  java.lang.String getAcceleratorAttr()
          Returns the attribute name of the Accelerator attribute.
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 getEnabledAttr()
          Returns the attribute name of the Enabled attribute.
protected  IPanelExtraData getExtraData()
          Returns the IPanelExtraData object associated with this panel.
protected  java.util.List getHeightUnits()
           
protected  ILookup getIdLookup()
          Returns a lookup that contains the IDs of all of the controls on the current XPage.
protected  java.lang.String getLabelToolTipText(java.lang.String propName)
          Should be overridden by subclasses to return an appropriate tool tip for the given property name.
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  java.lang.String getReadOnlyAttr()
          Returns the attribute name of the Read-Only attribute.
protected  java.lang.String getShowReadOnlyAsDisabledAttr()
          Returns the attribute name of the Show Read Only As Disabled attribute.
protected  java.lang.String getStyleAttribute()
          Returns the name of the style attribte.
protected  java.lang.String getTabOrderAttr()
          Returns the attribute name of the Tab Order attribute.
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  java.util.List 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 hasField(java.lang.String fieldName)
          Determines whether or not the current control has a particular attribute.
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.
protected  void initPropertyEditor(PropertyEditor propertyEditor, java.lang.String attrName)
          Utility method which is used to initialize a property editor so that it may be used in the context of the current properties panel.
 void setExtraData(IPanelExtraData data)
          Sets the extra panel data on the current panel.
protected  boolean showTooltips()
          Should be overridden by subclasses who need to show tooltips conditionally (e.g.
protected  void toggleControls(java.lang.String attribute, boolean val)
          For internal use..
protected  void toggleHeightAndWidth(boolean val)
           
protected  boolean usesStyleForHeightWidth()
          Determines if the height and width should be set via the style property.
 
Methods inherited from class com.ibm.commons.swt.data.layouts.BasicsPanel
createAccelerator, createAutomatedSection, createBidi, createEnabled, createHeightAndWidth, createLeftContents, createName, createPostSection, createPreSection, createReadOnly, createRightContents, createShowReadOnlyAsDisabled, createTabOrder, createValue, createVisible, getAcceleratorValidator, getContextHelpId, getEnabledDefaultValue, getNumLeftColumns, getReadOnlyDefaultValue, getTabOrderValidator, getVisibleDefaultValue, hasGroupBox
 
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, getNumParentColumns, isFirstColumnUsed, isSecondColumnUsed
 
Methods inherited from class com.ibm.commons.swt.data.layouts.PropLayout
addStateDependantChild, afterPanelCreation, 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, createGroupBoxGridData, createGroupBoxLayout, createHeading, createHeightWidthSection, createIndentGD, createLabel, createLabel, createLabelSpanGD, createMultiLineText, createMultiLineTextComputed, createNoMarginGridLayout, createPanel, createResetButton, createResetButton, createSizeTextGD, createSpanGD, createTableSpanGD, createToggleButton, createUnitsGD, createUnitsTextAndCombo, createUnitsTextAndCombo, finishCreation, getComputedExtraWidthHint, getControlBigWidthHint, getControlForText, getControlForUnits, getControlIndentAmt, getControlSmallWidthHint, getControlWidthHint, getCSSLookup, getCurrentParent, getDataNode, getDefaultBackgroundColor, getDefaultTextCols, getExtraIndentAmt, getFigureContext, getHeightHint, getResetImage, handleTooltip, initialize, initLayout, installScrolledCompositeListeners, panelCreated, resetControlListeners, runAfterCreation, setCurrentParent, setFigureContext, 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, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, 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, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_listener

protected DataNodeAdapter _listener

controlTooltipMap

protected java.util.Map<org.eclipse.swt.widgets.Control,java.lang.String> controlTooltipMap
Constructor Detail

XSPBasicsPanel

public XSPBasicsPanel(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 Composite creates an outter column control which contains an inner Composite with x number of columns. The number of columns is defined by #getNumChildColumns().

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

checkComputed

protected void checkComputed(org.eclipse.swt.widgets.Label label,
                             DataNode node)
Checks if a label should be computed/visible based on presence of the style attribute.

Parameters:
label -
node -

createContents

public void createContents()
Description copied from class: PropLayout2
Called to create the panel's contents.

Subclasses SHOULD NOT override this method

Overrides:
createContents in class PropLayout2

createFormatBean

protected com.ibm.commons.css.FormatBean createFormatBean(DataNode node)
Description copied from class: PropLayout
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.

Overrides:
createFormatBean in class PropLayout
Parameters:
node - The DataNode associated with the current model
Returns:
a formatting bean
See Also:
FormatBean

getAcceleratorAttr

protected java.lang.String getAcceleratorAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Accelerator attribute.

Overrides:
getAcceleratorAttr in class BasicsPanel
Returns:

getBidiAttr

protected java.lang.String getBidiAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Bidi attribute.

Overrides:
getBidiAttr in class BasicsPanel
Returns:

getBidiTypesLookup

protected StringLookup getBidiTypesLookup()
Description copied from class: BasicsPanel
Returns a StringLookup that is to be used to populate the Bidi field.

Overrides:
getBidiTypesLookup in class BasicsPanel
Returns:

getEnabledAttr

protected java.lang.String getEnabledAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Enabled attribute.

Overrides:
getEnabledAttr in class BasicsPanel
Returns:

getShowReadOnlyAsDisabledAttr

protected java.lang.String getShowReadOnlyAsDisabledAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Show Read Only As Disabled attribute.

Overrides:
getShowReadOnlyAsDisabledAttr in class BasicsPanel
Returns:

getExtraData

protected IPanelExtraData getExtraData()
Returns the IPanelExtraData object associated with this panel.

Returns:
an object that reveals additional data which may be useful when constructing a props panel

getHeightUnits

protected java.util.List getHeightUnits()
Overrides:
getHeightUnits in class BasicsPanel

getIdLookup

protected ILookup getIdLookup()
Returns a lookup that contains the IDs of all of the controls on the current XPage.

Returns:
a lookup containing ids

getNameAttr

protected java.lang.String getNameAttr()
Description copied from class: BasicsPanel
Returns the attribute name for the Name field (normally 'id').

Overrides:
getNameAttr in class BasicsPanel
Returns:

getNameValidator

protected IValidator getNameValidator()
Description copied from class: BasicsPanel
Returns a validator to be used with the Name field.

Overrides:
getNameValidator in class BasicsPanel
Returns:

getReadOnlyAttr

protected java.lang.String getReadOnlyAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Read-Only attribute.

Overrides:
getReadOnlyAttr in class BasicsPanel
Returns:

getTabOrderAttr

protected java.lang.String getTabOrderAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Tab Order attribute.

Overrides:
getTabOrderAttr in class BasicsPanel
Returns:

getValueAttr

protected java.lang.String getValueAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Value attribute.

Overrides:
getValueAttr in class BasicsPanel
Returns:

getVisibleAttr

protected java.lang.String getVisibleAttr()
Description copied from class: BasicsPanel
Returns the attribute name of the Visible attribute.

Overrides:
getVisibleAttr in class BasicsPanel
Returns:

getWidthUnits

protected java.util.List getWidthUnits()
Overrides:
getWidthUnits in class BasicsPanel

hasAccelerator

protected boolean hasAccelerator()
Description copied from class: BasicsPanel
Returns true if the panel should have an Accelerator field.

Overrides:
hasAccelerator in class BasicsPanel
Returns:

hasBidi

protected boolean hasBidi()
Description copied from class: BasicsPanel
Returns true if the panel should have a Bidi field.

Overrides:
hasBidi in class BasicsPanel
Returns:

hasEnabled

protected boolean hasEnabled()
Description copied from class: BasicsPanel
Returns true if the panel should have an Enabled field.

Overrides:
hasEnabled in class BasicsPanel
Returns:

hasField

protected boolean hasField(java.lang.String fieldName)
Determines whether or not the current control has a particular attribute.

Parameters:
fieldName - the field being tested for
Returns:
true if the field is an attribute of the current control

hasHeight

protected boolean hasHeight()
Description copied from class: BasicsPanel
Returns true if the panel should have a Height field.

Overrides:
hasHeight in class BasicsPanel
Returns:

hasName

protected boolean hasName()
Description copied from class: BasicsPanel
Returns true if the panel should have a Name field.

Overrides:
hasName in class BasicsPanel
Returns:

hasReadOnly

protected boolean hasReadOnly()
Description copied from class: BasicsPanel
Returns true if the panel should have a Read-Only field.

Overrides:
hasReadOnly in class BasicsPanel
Returns:

hasTabOrder

protected boolean hasTabOrder()
Description copied from class: BasicsPanel
Returns true if the panel should have a Tab Order field.

Overrides:
hasTabOrder in class BasicsPanel
Returns:

hasValue

protected boolean hasValue()
Description copied from class: BasicsPanel
Returns true if the panel should have a Value field.

Overrides:
hasValue in class BasicsPanel
Returns:

hasVisible

protected boolean hasVisible()
Description copied from class: BasicsPanel
Returns true if the panel should have a Visible field.

Overrides:
hasVisible in class BasicsPanel
Returns:

hasWidth

protected boolean hasWidth()
Description copied from class: BasicsPanel
Returns true if the panel should have a Width field.

Overrides:
hasWidth in class BasicsPanel
Returns:

hasShowReadOnlyAsDisabled

protected boolean hasShowReadOnlyAsDisabled()
Description copied from class: BasicsPanel
Returns true if the panel should have a Show Read Only As Disabled field.

Overrides:
hasShowReadOnlyAsDisabled in class BasicsPanel
Returns:

initPropertyEditor

protected void initPropertyEditor(PropertyEditor propertyEditor,
                                  java.lang.String attrName)
Utility method which is used to initialize a property editor so that it may be used in the context of the current properties panel.

Parameters:
propertyEditor - the property editor that is to be initialized
attrName - the attribute that the property editor is to edit

setExtraData

public void setExtraData(IPanelExtraData data)
Description copied from interface: IPanelDataReciever
Sets the extra panel data on the current panel. The data contained in IPanelExtraData is data that is typically very useful when working within a properties panel, data such as the current db etc.

Specified by:
setExtraData in interface IPanelDataReciever
Parameters:
data - extra data which might be needed when creating a properties panel

toggleControls

protected void toggleControls(java.lang.String attribute,
                              boolean val)
For internal use.. Toggles a control based on the attribute and attribute value

Parameters:
attribute -
val -

toggleHeightAndWidth

protected void toggleHeightAndWidth(boolean val)
Parameters:
val -

usesStyleForHeightWidth

protected boolean usesStyleForHeightWidth()
Determines if the height and width should be set via the style property.

Returns:

getLabelToolTipText

protected java.lang.String getLabelToolTipText(java.lang.String propName)
Description copied from class: PropLayout
Should be overridden by subclasses to return an appropriate tool tip for the given property name.

Overrides:
getLabelToolTipText in class PropLayout
Parameters:
propName - the name of the property whose tooltip is sought
Returns:
a tooltip appropriate for the given property. Default is null.

showTooltips

protected boolean showTooltips()
Description copied from class: PropLayout
Should be overridden by subclasses who need to show tooltips conditionally (e.g. according to preferences)

Overrides:
showTooltips in class PropLayout
Returns:
returns whether or not tooltips should be displayed, defaults to true.

cacheToolTip

protected void cacheToolTip(org.eclipse.swt.widgets.Control control,
                            java.lang.String tooltip)
Description copied from class: PropLayout
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.

Overrides:
cacheToolTip in class PropLayout
Parameters:
control - the control whose tooltip is provided
tooltip - the tooltip text

getStyleAttribute

protected java.lang.String getStyleAttribute()
Returns the name of the style attribte.

Returns: