de.enough.polish.devices
Class DeviceTreeItem

java.lang.Object
  extended by de.enough.polish.devices.DeviceTreeItem

public class DeviceTreeItem
extends Object

Maps a vendor, the "virtual category" or a device to the DeviceTree.

Copyright Enough Software 2005

 history
        05-Jan-2006 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de
See Also:
DeviceTree

Constructor Summary
DeviceTreeItem(DeviceTreeItem parentItem, Vendor vendor, Device device)
          Creates a new tree item.
 
Method Summary
protected  void addChild(DeviceTreeItem child)
           
 void addSelectionListener(PropertyChangeListener propertyChangeListener)
           
 void clearChildren()
           
 int getChildCount()
           
 int getChildCount(Object parent)
           
 DeviceTreeItem[] getChildren()
           
 Object getData()
           
 String getDescription()
           
 Device getDevice()
           
 DeviceTreeItem getParentItem()
          Returns the parent item of this item.
 Vendor getVendor()
           
 boolean isDevice()
           
 boolean isExpanded()
           
 boolean isSelected()
           
 boolean isVendor()
           
 void removeSelectionListener(PropertyChangeListener propertyChangeListener)
           
 void setData(Object data)
           
 void setExpanded(boolean isExpanded)
           
 void setIsSelected(boolean selected)
           
 void setParentItem(DeviceTreeItem parentItem)
          Sets a new parent of this item.
 void setSelectionListener(DeviceTreeItemSelectionListener listener)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviceTreeItem

public DeviceTreeItem(DeviceTreeItem parentItem,
                      Vendor vendor,
                      Device device)
Creates a new tree item.

Parameters:
parentItem - the parent of this item, can be null
vendor - the current vendor, can be null
device - the mapped device, can be null
Method Detail

getChildren

public DeviceTreeItem[] getChildren()

getChildCount

public int getChildCount()

getChildCount

public int getChildCount(Object parent)

setIsSelected

public void setIsSelected(boolean selected)

isSelected

public boolean isSelected()

toString

public String toString()
Overrides:
toString in class Object

isVendor

public boolean isVendor()

isDevice

public boolean isDevice()

getVendor

public Vendor getVendor()

getDevice

public Device getDevice()

getDescription

public String getDescription()

addChild

protected void addChild(DeviceTreeItem child)

getParentItem

public DeviceTreeItem getParentItem()
Returns the parent item of this item.

Returns:
the parent this item or null if is has none.

setParentItem

public void setParentItem(DeviceTreeItem parentItem)
Sets a new parent of this item.

Parameters:
parentItem - the new parent of this item or null it it has none.

setData

public void setData(Object data)

getData

public Object getData()

setSelectionListener

public void setSelectionListener(DeviceTreeItemSelectionListener listener)

clearChildren

public void clearChildren()

isExpanded

public boolean isExpanded()
Returns:
Returns the isExpanded.

setExpanded

public void setExpanded(boolean isExpanded)
Parameters:
isExpanded - The isExpanded to set.

addSelectionListener

public void addSelectionListener(PropertyChangeListener propertyChangeListener)

removeSelectionListener

public void removeSelectionListener(PropertyChangeListener propertyChangeListener)