Class ListItem
All Packages Class Hierarchy This Package Previous Next Index
Class ListItem
public class netscape.application.ListItem
extends java.lang.Object
implements java.lang.Cloneable,
netscape.util.Codable
{
/* Constructors
*/
public ListItem();
/* Methods
*/
public Object clone();
public String command();
public Object data();
public void decode(Decoder);
public void describeClassInfo(ClassInfo);
protected void drawBackground(Graphics, Rect);
public void drawInRect(Graphics, Rect);
protected void drawStringInRect(Graphics, String, Font, Rect, int);
public void encode(Encoder);
public void finishDecoding();
public Font font();
public Image image();
public boolean isEnabled();
public boolean isSelected();
public boolean isTransparent();
public ListView listView();
public int minHeight();
public int minWidth();
public Color selectedColor();
public Image selectedImage();
public void setCommand(String);
public void setData(Object);
public void setEnabled(boolean);
public void setFont(Font);
public void setImage(Image);
public void setSelected(boolean);
public void setSelectedColor(Color);
public void setSelectedImage(Image);
public void setTextColor(Color);
public void setTitle(String);
public Color textColor();
public String title();
}
Object subclass representing a single ListView entry.
- See Also:
- ListView
Constructors
.ListItem
public ListItem()
- Constructs an empty ListItem.
Methods
public Object clone()
- Clones the ListItem. ListView adds addtional rows by cloning its
prototype ListItem. Note that if you have setData() on the
prototype ListItem, clone() does not clone the data (all
ListItem clones will reference the same data).
- Overrides:
- clone in class Object
public ListView listView()
- Returns the ListView associated with the ListItem. Returns
null if the ListItem is not in a ListView.
public boolean isTransparent()
- Returns true if the ListItem is transparent, allowing
ListView to optimize its drawing. ListView only draws the background of
transparent ListItems.
public void setCommand(String newCommand)
- Sets the command associated with this ListItem. ListView sends
ListItem's command instead of its own when the ListItem is
single-clicked.
public String command()
- Returns the command associated with this ListItem.
- See Also:
- setCommand
public void setTitle(String aString)
- Sets the title the ListItem displays.
public String title()
- Returns the title the ListItem displays.
- See Also:
- setTitle
public void setSelected(boolean flag)
- Called by ListView when a ListItem is selected. By default, selected
ListItems highlight by painting a white background.
public boolean isSelected()
- Returns true if the ListItem is selected.
- See Also:
- setSelected
public void setEnabled(boolean flag)
- Enables or disables the ListItem. Disabled ListItems cannot be
selected, and render their title using Color.gray.
public boolean isEnabled()
- Returns true if the ListItem is enabled.
- See Also:
- setEnabled
public void setImage(Image anImage)
- Sets the Image the ListItem displays next to its title.
- See Also:
- setSelectedImage
public Image image()
- Returns the Image the ListItem displays next to its title.
- See Also:
- setImage
public void setSelectedImage(Image anImage)
- Sets the Image the ListItem displays next to its title when selected.
- See Also:
- setImage
public Image selectedImage()
- Returns the Image the ListItem displays next to its title when
selected.
- See Also:
- setSelectedImage
public void setFont(Font aFont)
- Sets the Font the ListItem uses to render its title.
public Font font()
- Returns the Font the ListItem uses to render its title. If no Font has
been set, returns Font.defaultFont().
- See Also:
- defaultFont
public void setSelectedColor(Color color)
- Sets the color the ListItem uses to draw its background when
selected.
public Color selectedColor()
- Returns the color the ListItem uses to draw its background when
selected.
public void setTextColor(Color color)
- Sets the color the ListItem uses to draw its foreground text.
public Color textColor()
- Returns the color the ListItem uses to draw its foreground text.
public void setData(Object data)
- Sets the ListItem's data, a storage place for arbitrary data associated
with the ListItem.
public Object data()
- Returns the ListItem's data.
- See Also:
- setData
public int minWidth()
- Returns the minimum width required to display the ListItem's title
and Image, if any.
public int minHeight()
- Returns the minimum height required to display the ListItem's title
and Image, if any.
protected void drawBackground(Graphics g,
Rect boundsRect)
- Called from drawInRect() to draw the ListItem's background.
Subclasses can override this method to draw custom backgrounds.
protected void drawStringInRect(Graphics g,
String title,
Font titleFont,
Rect textBounds,
int justification)
- Called from drawInRect() to draw the ListItem's title.
Subclasses can override this method to draw the title string in a
special way.
public void drawInRect(Graphics g,
Rect boundsRect)
- Called by ListView to draw the ListItem. If the ListItem is
transparent, its ListView will have already drawn its background. If
not, the ListItem should entirely fill boundsRect.
public void describeClassInfo(ClassInfo info)
- Describes the ListItem class' information.
- See Also:
- describeClassInfo
public void encode(Encoder encoder) throws CodingException
- Archives the ListItem instance.
- See Also:
- encode
public void decode(Decoder decoder) throws CodingException
- Unarchives the ListItem instance.
- See Also:
- decode
public void finishDecoding() throws CodingException
- Finishes the ListItem's unarchiving.
- See Also:
- finishDecoding
All Packages Class Hierarchy This Package Previous Next Index
Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997