jbcl.view Package
java.lang.Object +----com.borland.jbcl.view.CompositeItemEditor
Constructors Properties Methods Event Listeners
Implements ItemEditor, ToggleItemEditor, Serializable
A CompsiteItemEditor
enables editing items in a control, for data items that consist of two parts, such as an image and a string in a tree. It uses a CompositeItemPainter
to calculate the rectangles for the individual items. It delegates all ItemEditor
methods to the appropriate item editors.
See also: CompositeItemPainter
public CompositeItemEditor()Constructs a
CompositeItemEditor
.
public CompositeItemEditor(CompositeItemPainter compositePainter)Constructs a
CompositeItemEditor
using specified the CompositeItemPainter
to do the painting.
public CompositeItemEditor(CompositeItemPainter compositePainter, ItemEditor firstEditor, ItemEditor secondEditor)Constructs a
CompositeItemEditor
using the specified composite item painter to do the painting and the specified item editors to handle the editing.
Parameters:
compositePainter
firstEditor
secondEditor
public CompositeItemEditor(CompositeItemPainter compositePainter, ItemEditor firstEditor, ItemEditor secondEditor, int defaultEditor)Constructs a
CompositeItemEditor
, with the specified item editor as the default editor.
Parameters:
compositePainter
firstEditor
secondEditor
defaultEditor
firstEditor
, 2 specifies the secondEditor
.
public Component getComponent()The
component
property stores which component is added to the host control as an item editor. It dispatches all key events from the main component to the individual controls.
public CompositeItemPainter getCompositeItemPainter() public void setCompositeItemPainter(CompositeItemPainter compositePainter)Determines the
CompositeItemPainter
used to handle the painting tasks.
public int getDefaultEditor() public void setDefaultEditor(int defaultEditor)The
defaultEditor
property stores which item editor to use for each element of a composite data item if no other item editor is specified. A value of 1 specifies the first editor is the default editor. A value of 2 specifies the second editor is the default editor.
public ItemEditor getEditor1() public void setEditor1(ItemEditor firstEditor)Determines the item editor to use to edit the first item in the pair of items.
public ItemEditor getEditor2() public void setEditor2(ItemEditor secondEditor)Determines the item editor to use to edit the second item in the pair of items.
public Object getValue()The
value
property stores the current value that is in the active item editor. The editor host can ask for the value at any time and should always ask for the value when posting to the data object.
public int hitTest(Point clickPoint, Rectangle rect1, Rectangle rect2)Returns which item editor or item painter contains the location that was clicked.
rect1
contains the point, returns 1.
rect1
doesn't contain the point, but rect2
contains the point, returns 2.
defaultEditor
property.
Parameters:
clickPoint
rect1
rect2
public void addKeyListener(KeyListener l) public void removeKeyListener(KeyListener l)