uk.ac.kcl.cch.jb.pliny.views.utils
Class ResourceExplorerNamedModelItem

java.lang.Object
  extended byuk.ac.kcl.cch.jb.pliny.views.utils.ResourceExplorerItemBase
      extended byuk.ac.kcl.cch.jb.pliny.views.utils.ResourceExplorerNamedModelItem
All Implemented Interfaces:
EventListener, IResourceExplorerItem, PropertyChangeListener
Direct Known Subclasses:
ResourceExplorerObjectTypeItem, ResourceExplorerResourceItem

public abstract class ResourceExplorerNamedModelItem
extends ResourceExplorerItemBase

this abstract class provides base implementation for all Resource Explorer display items which display names that come from the Pliny data model, and hence can be edited.

The class also tracks name changes that happen elsewhere in Pliny so that the name displaying in the Resource Explorer is updated.

Author:
John Bradley

Field Summary
 
Fields inherited from class uk.ac.kcl.cch.jb.pliny.views.utils.ResourceExplorerItemBase
myChildren, myView
 
Constructor Summary
ResourceExplorerNamedModelItem(IResourceTreeView myView, IResourceExplorerItem parent, INamedObject theObject, String trackingProperty, String nameProperty)
           
 
Method Summary
 boolean canModify()
          return true if this item's name can be edited within the Resource Explorer.
abstract  org.eclipse.swt.graphics.Image getIcon()
          returns the Image to be used as the Icon displayed beside the item in the Resource Explorer tree.
protected  INamedObject getNamedObject()
           
 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.
 void propertyChange(PropertyChangeEvent arg0)
           
 void setText(String text)
          changes text to be displayed as the label to the given text.
 
Methods inherited from class uk.ac.kcl.cch.jb.pliny.views.utils.ResourceExplorerItemBase
createListIterator, dispose, getAssociatedObject, getBaseObject, getChildren, getChildrenList, getMyView, getNumberChildren, getPageNumber, hasChildren, makeChild, setBaseObject, updateMyChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceExplorerNamedModelItem

public ResourceExplorerNamedModelItem(IResourceTreeView myView,
                                      IResourceExplorerItem parent,
                                      INamedObject theObject,
                                      String trackingProperty,
                                      String nameProperty)
Method Detail

getNamedObject

protected INamedObject getNamedObject()

getText

public String getText()
Description copied from interface: IResourceExplorerItem
returns text to be used as the textual label for the tree item display.

Specified by:
getText in interface IResourceExplorerItem
Specified by:
getText in class ResourceExplorerItemBase

setText

public void setText(String text)
Description copied from interface: IResourceExplorerItem
changes text to be displayed as the label to the given text. This should result in changes in the backing Pliny model as well.

Specified by:
setText in interface IResourceExplorerItem
Specified by:
setText in class ResourceExplorerItemBase

canModify

public boolean canModify()
Description copied from interface: IResourceExplorerItem
return true if this item's name can be edited within the Resource Explorer.

Specified by:
canModify in interface IResourceExplorerItem
Specified by:
canModify in class ResourceExplorerItemBase

getParent

public IResourceExplorerItem getParent()
Description copied from interface: IResourceExplorerItem
returns the parent item of this item in the Resource Explorer display tree.

Specified by:
getParent in interface IResourceExplorerItem
Specified by:
getParent in class ResourceExplorerItemBase

getIcon

public abstract org.eclipse.swt.graphics.Image getIcon()
Description copied from interface: IResourceExplorerItem
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.

Specified by:
getIcon in interface IResourceExplorerItem
Specified by:
getIcon in class ResourceExplorerItemBase

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class ResourceExplorerItemBase