uk.ac.kcl.cch.jb.pliny.views.utils
Interface IResourceExplorerItem

All Known Implementing Classes:
NoteSearchRoot, ResourceExplorerItemBase

public interface IResourceExplorerItem

items that participate as model items in the Resource Explorer's tree display should implement this interface.

Author:
John Bradley

Method Summary
 boolean canModify()
          return true if this item's name can be edited within the Resource Explorer.
 void dispose()
          performs data cleanup.
 Object getAssociatedObject()
          returns the Pliny model object associated with this item.
 List getChildren()
          returns a list of IResourceExplorerItem items that are children of this item.
 org.eclipse.swt.graphics.Image getIcon()
          returns the Image to be used as the Icon displayed beside the item in the Resource Explorer tree.
 int getNumberChildren()
          returns number of children owned by this item.
 int getPageNumber()
          return the page number data associated with the Pliny model object associated wtih this item.
 IResourceExplorerItem getParent()
          returns the parent item of this item in the Resource Explorer display tree.
 String getText()
          returns text to be used as the textual label for the tree item display.
 boolean hasChildren()
          returns true if this item has children items.
 void setText(String name)
          changes text to be displayed as the label to the given text.
 

Method Detail

getText

public String getText()
returns text to be used as the textual label for the tree item display.

Returns:
String text to be displayed.

setText

public void setText(String name)
changes text to be displayed as the label to the given text. This should result in changes in the backing Pliny model as well.

Parameters:
name - text to be used as the name of this item.

canModify

public boolean canModify()
return true if this item's name can be edited within the Resource Explorer.

Returns:
true if editable.

getAssociatedObject

public Object getAssociatedObject()
returns the Pliny model object associated with this item. Return null if there is not Pliny model object.

Returns:
Object representing associated Pliny model object.

getPageNumber

public int getPageNumber()
return the page number data associated with the Pliny model object associated wtih this item. Return 0 if there is no associated page number.

Returns:
page number associated with the item.

dispose

public void dispose()
performs data cleanup. This will be called then the item is no longer needed.


getIcon

public org.eclipse.swt.graphics.Image getIcon()
returns the Image to be used as the Icon displayed beside the item in the Resource Explorer tree. The image must be disposed of by this object -- it will not be disposed by the caller.

Returns:
SWT Image to act as the icon.

getParent

public IResourceExplorerItem getParent()
returns the parent item of this item in the Resource Explorer display tree.


hasChildren

public boolean hasChildren()
returns true if this item has children items.


getNumberChildren

public int getNumberChildren()
returns number of children owned by this item.


getChildren

public List getChildren()
returns a list of IResourceExplorerItem items that are children of this item.