|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Widget org.eclipse.swt.widgets.Control org.eclipse.swt.widgets.Scrollable org.eclipse.swt.widgets.Composite com.ibm.commons.swt.data.layouts.PropLayout
public class PropLayout
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 |
---|
protected static final java.lang.String TEXT_SUFFIX
protected static final java.lang.String UNITS_SUFFIX
Constructor Detail |
---|
public PropLayout(org.eclipse.swt.widgets.Composite parent, int style)
parent
- a Composite control which will be the parent of the new instance (CANNOT be null).style
- the style of control to constructMethod Detail |
---|
public final void createPanel()
public final void panelCreated()
createPanel()
. Subclasses will usually not need
to call this method.
protected void afterPanelCreation()
protected void initialize()
createContents()
.
protected void createContents()
protected void finishCreation()
protected void installScrolledCompositeListeners()
SWTACCUtils
public void runAfterCreation(java.lang.Runnable runnable)
runnable
- protected void resetControlListeners()
installScrolledCompositeListeners()
protected boolean useDCPanel()
DCPanel
protected void initLayout()
Composite.setLayout(org.eclipse.swt.widgets.Layout)
in order to set an
appropriate layout on this Composite.
protected int getNumParentColumns()
protected int getControlWidthHint()
protected int getControlBigWidthHint()
protected int getControlSmallWidthHint()
protected int getComputedExtraWidthHint()
protected int getControlIndentAmt()
protected int getExtraIndentAmt()
protected int getDefaultTextCols()
protected org.eclipse.swt.widgets.Composite getCurrentParent()
protected void setCurrentParent(org.eclipse.swt.widgets.Composite newParent)
protected DataNode getDataNode()
public void setFigureContext(com.ibm.commons.swt.util.IFigureContext context)
protected com.ibm.commons.swt.util.IFigureContext getFigureContext()
protected org.eclipse.swt.graphics.Image getResetImage()
protected org.eclipse.swt.widgets.Label createHeading(java.lang.String label, int numColumns)
protected DCText createDCText(java.lang.String attrName, java.lang.Object layoutData)
Control.getParent()
. The width of the control is determined by calling
getDefaultTextCols()
. The style SWT.BORDER is applied to the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is created
protected DCText createDCText(java.lang.String attrName, java.lang.Object layoutData, int style)
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.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdstyle
- the SWT style bit that is to be applied to the control
protected DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData)
Control.getParent()
.
The style SWT.BORDER is applied to the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is created
protected DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, java.lang.String id)
Control.getParent()
.
The style SWT.BORDER is applied to the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdid
- a programmatic id which can later be used to identify the control
protected DCCompositeText createDCTextComputedPositiveIntegerOnly(java.lang.String attrName, java.lang.Object layoutData)
Control.getParent()
.
The style SWT.BORDER is applied to the control. The resulting control only accepts positive integers
as input.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is created
IntegerValidator
protected DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, int style)
Control.getParent()
. The value of the resulting control can be computed.
The style flag is used to set the look/behavior of the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdstyle
- the SWT style bit that is to be applied to the control
protected DCCompositeText createDCTextComputed(java.lang.String attrName, java.lang.Object layoutData, int style, java.lang.String id)
Control.getParent()
. The value of the resulting control can be computed.
The style flag is used to set the look/behavior of the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdstyle
- the SWT style bit that is to be applied to the controlid
- a programmatic id that can later be used to identify the control
protected DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, boolean isEditable)
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.
attrName
- the name of the attribute that this control will representlookup
- the lookup used to populate the contents of the combolayoutData
- the layout to apply to the control that is createdhasFirstBlankLine
- 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
protected DCCompositeCombo createComboComputed(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, boolean isEditable, java.lang.String id)
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.
attrName
- the name of the attribute that this control will representlookup
- the lookup used to populate the contents of the combolayoutData
- the layout to apply to the control that is createdhasFirstBlankLine
- 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
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)
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.
attrName
- the name of the attribute that this control will representlookup
- the lookup used to populate the contents of the combolayoutData
- the layout to apply to the control that is createdhasFirstBlankLine
- 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 editableid
- a programmatic id that can later be used to identify the controlfirtLineTitle
- if the first line is set to be blank, then the title provided in this parameter is used as the title of the item
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)
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.
attrName
- the name of the attribute that this control will representlookup
- the lookup used to populate the contents of the combolayoutData
- the layout to apply to the control that is createdhasFirstBlankLine
- 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 defaultisEditable
- determines whether or not the combo box should be editableid
- a programmatic id that can later be used to identify the control
protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData)
Control.getParent()
.
The value of the resulting control can be computed.
attrName
- the name of the attribute that this control will representcheckedValue
- the value in the model that results in the control being checkedlabelText
- the text to appear in the label portion of the controllayoutData
- the layout to be set on the resulting control
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)
Control.getParent()
.
The value of the resulting control can be computed.
attrName
- the name of the attribute that this control will representcheckedValue
- the value in the model that results in the control being checkeduncheckedValue
- the value in the model that results in the control being uncheckeddefaultValue
- the default value of the control (checked/unchecked)labelText
- the text to appear in the label portion of the controllayoutData
- the layout to be set on the resulting control
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)
Control.getParent()
.
The value of the resulting control can be computed.
attrName
- the name of the attribute that this control will representcheckedValue
- the value in the model that results in the control being checkeduncheckedValue
- the value in the model that results in the control being uncheckeddefaultValue
- the default value of the control (checked/unchecked)labelText
- the text to appear in the label portion of the controllayoutData
- the layout to be set on the resulting controlid
- a programmatic id that can later be used to identify the control
protected DCCompositeCheckbox createDCCheckboxComputed(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData, java.lang.String id)
Control.getParent()
.
The value of the resulting control can be computed.
attrName
- the name of the attribute that this control will representcheckedValue
- the value in the model that results in the control being checkedlabelText
- the text to appear in the label portion of the controllayoutData
- the layout to be set on the resulting controlid
- a programmatic id that can later be used to identify the control
protected DCRadioButton createDCRadioButton(java.lang.String attrName, java.lang.String checkedValue, java.lang.String labelText, java.lang.Object layoutData)
Control.getParent()
.
The value of the resulting control can be computed.
attrName
- the name of the attribute that this control will representcheckedValue
- the value in the model that results in the control being checkedlabelText
- the text to appear in the label portion of the controllayoutData
- the layout to be set on the resulting control
protected DCText createDCTextNoWidth(java.lang.String attrName, java.lang.Object layoutData)
Control.getParent()
. The style SWT.BORDER is applied to the control.
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is created
protected int getHeightHint(int lines)
protected DCText createMultiLineText(java.lang.String attrName, java.lang.Object layoutData, int lines)
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdlines
- - 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.
protected DCCompositeText createMultiLineTextComputed(java.lang.String attrName, java.lang.Object layoutData, int lines)
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is createdlines
- - 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.
protected DCLabel createDCLabel(java.lang.String attrName, java.lang.Object layoutData)
attrName
- the name of the attribute that this control will representlayoutData
- the layout to apply to the control that is created
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)
attrName
- the name of the attribute that this control will representimg
- an image to use on the buttoncheckedValue
- the value which when set in the model will cause the button to be selecteduncheckedValue
- the value which when set in the model will cause the button to be unselectedtooltip
- the tooltip text to be set on the button
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)
attributes
- a list of attributes whose values should be reset to null when the button is pressedtext
- the text to appear on the buttonlayoutData
- the layout of the buttontooltip
- the tooltip text to appear on the button
protected org.eclipse.swt.widgets.Button createResetButton(java.util.List<java.lang.String> attributes, java.lang.Object layoutData, java.lang.String tooltip)
attributes
- a list of attributes whose values should be reset to null when the button is pressedlayoutData
- the layout of the buttontooltip
- the tooltip text to appear on the button
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)
textLayoutData
- - the layout data for the text boxes (specify to set span, or indent).protected DCComboBox createCombo(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine, int swtStyle)
Control.getParent()
.
attrName
- the name of the attribute that this control will representlookup
- the lookup that is used to populate the combo boxlayoutData
- the layout to apply to the control that is createdhasFirstLineBlank
- determines whether or not the first item in the combo should be blank (empty)
protected DCComboBox createCombo(java.lang.String attrName, ILookup lookup, org.eclipse.swt.layout.GridData layoutData, boolean hasFirstBlankLine)
Control.getParent()
.
attrName
- the name of the attribute that this control will representlookup
- the lookup that is used to populate the combo boxlayoutData
- the layout to apply to the control that is createdhasFirstLineBlank
- determines whether or not the first item in the combo should be blank (empty)
protected org.eclipse.swt.widgets.Label createLabel(java.lang.String text, java.lang.Object layoutData)
text
- the text to appear in the labellayoutData
- the layout data to be applied to the control
protected org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
protected org.eclipse.swt.widgets.Label createLabel(java.lang.String text, java.lang.Object layoutData, java.lang.String toolTipText)
text
- the text that is to appear in the labellayoutData
- the layout data that is to be applied to the labeltoolTipText
- the text to apply as a tooltip for the label
protected java.lang.String getLabelToolTipText(java.lang.String propertyName)
propertyName
- the name of the property whose tooltip is sought
protected void handleTooltip(org.eclipse.swt.widgets.Control control, java.lang.String tooltip)
control
- the control that the tooltip will be set ontooltip
- the tooltip textcacheToolTip(Control, String)
protected void cacheToolTip(org.eclipse.swt.widgets.Control control, java.lang.String tooltip)
control
- the control whose tooltip is providedtooltip
- the tooltip textprotected boolean showTooltips()
protected DCCheckbox createDCCheckBox(java.lang.String attrName, java.lang.String checkedValue, java.lang.String unCheckedValue, java.lang.String text, java.lang.Object layoutData)
Control.getParent()
.
attrName
- the name of the attribute that this control will representcheckedValue
- the value that will cause this control to be checkeduncheckedValue
- the value that will cuase this control to be uncheckedtext
- the text to appear on the controllayoutData
- the layout data that is to be applied to the control
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)
Control.getParent()
.
attrName
- the name of the attribute that this control will representcheckedValue
- the value that will cause this control to be checkeduncheckedValue
- the value that will cuase this control to be uncheckedtext
- the text to appear on the controllayoutData
- the layout data that is to be applied to the controlid
- a programmatic id that can later be used to identify the control
protected DCColorButton createColorButton(java.lang.String attrName, java.lang.Object layoutData, java.lang.String colorTooltip, java.lang.String resetTooltip)
Control.getParent()
. A reset button is also created.
attrName
- the name of the attribute that this control will representlayoutData
- the layout data that is to be used to lay out the controlcolorTooltip
- the tooltip to be used with the color buttonresetTooltip
- the tooltip to be used with the corresponding reset button
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)
attrName
- the name of the attribute that this control will representacceptedUnits
- the units that can be used by this attributetextLayoutData
- the layout data for the text part of the controisVertical
- specifies whether the units we are dealing with are vertical unitsisComputable
- determines whether or not the attribute can be computedconvertAuto
- textToolTip
- the tooltip to be set on the text fieldunitsToolTip
- the tooltip to be set on the units fieldunitsLabel
- the label to correspond to the units fieldprotected 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)
attrName
- the name of the attribute that this control will representacceptedUnits
- the units that can be used by this attributetextLayoutData
- the layout data for the text part of the controisVertical
- specifies whether the units we are dealing with are vertical unitsisComputable
- determines whether or not the attribute can be computedconvertAuto
- textToolTip
- the tooltip to be set on the text fieldunitsToolTip
- the tooltip to be set on the units fieldunitsLabel
- the label to correspond to the units fieldid1
- the programmatic id to be used on the first text fieldid2
- the programmatic id to be used on the second text fieldprotected com.ibm.commons.css.FormatBean createFormatBean(DataNode node)
node
- The DataNode associated with the current model
FormatBean
protected org.eclipse.swt.widgets.Control getControlForUnits(java.lang.String attribute)
protected org.eclipse.swt.widgets.Control getControlForText(java.lang.String attribute)
protected org.eclipse.swt.layout.GridData createUnitsGD()
protected void checkEnableText(DCCompositeText text, IAttribute textAttr, IAttribute unitsAttr)
text
- textAttr
- unitsAttr
- protected StringLookup getCSSLookup(java.util.List<com.ibm.commons.css.api.CSSLengthUnits> acceptedUnits)
protected org.eclipse.swt.layout.GridData createFillGD(int hSpan)
hSpan
- the number of horizontal columns that need to be spanned
protected org.eclipse.swt.layout.GridData createLabelSpanGD(int hSpan, int vSpan)
hSpan
- the number of columns to spanvSpan
- the number of rows to span
protected org.eclipse.swt.layout.GridData createControlGDDefWidth(int hSpan)
hSpan
- the number of columns to span
protected org.eclipse.swt.layout.GridData createControlNonComputedGD(int hSpan, int computedWidthHint)
hSpan
- the number of columns to spancomputedWidthHint
- the width hint of the computed controlprotected org.eclipse.swt.layout.GridData createControlGDMultiLine(int hSpan, int numLines, boolean grabVSpace)
hSpan
- the number of columns to spannumLines
- the height in rowsgrabVSpace
- determines whether or not the GridData should grab excess horizontal space
protected org.eclipse.swt.layout.GridData createControlGDBigWidth(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createControlGDSmallWidth(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createControlGDNoWidth(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createControlGDFill(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createSizeTextGD(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createIndentGD(int indentAmt, int hSpan)
indentAmt
- the number of pixels to indent the controlhSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createExtraIndentGD(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createSpanGD(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createTableSpanGD(int hSpan, int vSpan)
hSpan
- the number of columns to spanvSpan
- the number of rows to spanprotected org.eclipse.swt.layout.GridData createFillSpanGD(int hSpan)
hSpan
- the number of columns to spanprotected org.eclipse.swt.layout.GridData createGroupBoxGridData()
protected org.eclipse.swt.layout.GridLayout createChildLayout(int numColumns)
numColumns
- the number of columns that the child Composite should contain
protected org.eclipse.swt.layout.GridLayout createNoMarginGridLayout(int numColumns)
numColumns
- the number of columns
com.ibm.commons.swt.SWTLayoutUtils.createLayoutNoMarginNoSpacing(int)
protected org.eclipse.swt.layout.GridLayout createGroupBoxLayout(int numColumns)
numColumns
- the number of columns
protected void addStateDependantChild(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Control child, boolean association)
button
- a checkbox or radio button (DC or not)child
- a child control to be dependantassociation
- 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.protected void removeStateDependantChild(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Control child)
button
- SWT button that is associated with the provided child controlchild
- control associated with the provided buttonprotected void checkSelection(org.eclipse.swt.widgets.Button button, org.eclipse.swt.widgets.Button notifier)
button
- the button whose selection needs to be calculatednotifier
- 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.protected java.lang.String getContextHelpId()
public void dispose()
dispose
in class org.eclipse.swt.widgets.Widget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |