|
|||||||||
| Home >> All >> ulu >> [ view overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
ulu.view
Class ItemImpl

java.lang.Objectulu.view.ItemImpl
- All Implemented Interfaces:
- ContentSource, Handler, Invokable, Item, java.util.Observer, Propertied, Referrer, java.io.Serializable, Typed, UContained
- Direct Known Subclasses:
- FilterItem, ViewImpl
- public class ItemImpl
- extends java.lang.Object
- implements Item, java.util.Observer, Handler
- extends java.lang.Object
generic implementation of Item interface
| Field Summary | |
protected java.beans.PropertyChangeSupport |
changes
bean support helper class |
protected UMethod |
defmeth
the default method fore this item |
(package private) java.util.Hashtable |
methods
collection of methods assigned to this object |
static java.lang.String |
PROP_REFSTRING
field name denoting the (hidden) reference string |
(package private) java.util.Hashtable |
props
collection of properties assigned to this item |
(package private) java.lang.Object |
reference
the reference object, as defined by Referer interface |
(package private) boolean |
sealed
denotes whether methods/properties can be added |
(package private) static java.util.Properties |
types
mini-registry of valid Item types |
(package private) static boolean |
useScrap
whether to make use of the scrapbook feature - in some cases, its useful to have, in others, its an unnecessary distraction |
| Fields inherited from interface ulu.view.Item |
METHOD_ADD_TO_SCRAPBOOK |
| Fields inherited from interface ulu.view.UContained |
PROP_PARENT |
| Fields inherited from interface ulu.view.Propertied |
PROP_DISPLAY_LOD, PROP_NAME |
| Fields inherited from interface ulu.view.Typed |
PROP_TYPE |
| Fields inherited from interface ulu.view.ContentSource |
PROP_CONTENT_URL |
| Constructor Summary | |
ItemImpl()
default no-argument constructor for subclasses to use |
|
ItemImpl(java.lang.String name)
by default, the Item has no methods, and only one property, its name. |
|
| Method Summary | |
void |
addDefaultMethods()
add default methods for opening and refreshing container. |
static void |
addJAFMethods(JAFable jaf)
Deprecated. |
boolean |
addMethod(UMethod u)
(attempt to) add a method |
boolean |
addProp(java.lang.String name,
java.lang.Object obj)
convenience method to quickly add fields |
boolean |
addProp(UField u)
(attempt to) add a property |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
add a property listener for bean support |
boolean |
clearMethods()
clear all methods |
boolean |
clearProps()
clear all properties |
java.net.URL |
getContent()
by default, a null implementation, leave this alone unless the Item does have a content source to talk to |
UMethod |
getDefaultMethod()
get the default method |
UMethod |
getMethod(java.lang.String name)
get a method by name |
java.lang.String |
getName()
convenience method to get the name |
UContainer |
getParent()
generic UContained imlementation |
View |
getParentView()
convenience method to get the parent View |
UField |
getProp(java.lang.String name)
get a property by name |
java.lang.Object |
getReference()
convenience getter for primary reference property (Not all items will have a reference, but many will - it's the thing behind the item, the file, the resultset, the object, etc.) |
static View |
getScrapbook(java.lang.Object obj)
get the scrapbook View |
java.lang.String |
getType()
denote the type of this item, used in the UI to differentiate between different sorts (e.g. |
protected java.lang.String |
inferTypeByClass()
Deprecated. with shaper-based architecture, items aren't differentiated by subclass |
java.lang.Object |
invoke(UMethod u)
implementation of Handler - this is the callback point for an invoked method. |
UMethod[] |
methods()
get names of this object's invokable methods |
UField[] |
properties()
get this object's properties |
boolean |
removeMethod(UMethod u)
(attempt to) remove a method |
boolean |
removeProp(UField u)
(attempt to) remove a property |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
remove a property listener (for bean support) |
void |
seal()
prevent any further addition/removal of methods or properties |
void |
setDefaultMethod(UMethod u)
set the default method (and add it to methods list if not already there) |
void |
setName(java.lang.String s)
convenience method to set the name |
void |
setParent(UContainer u)
convenience method to set the parent View |
void |
setParentView(View v)
convenience method to set the parent View |
void |
setReference(java.lang.Object o)
conenience setter for primary reference property (Not all items will have a reference, but many will - it's the thing behind the item, the file, the resultset, the object, etc.) |
boolean |
setRefImpl(java.lang.Object o)
implementation of setReference for subclasses to override - return true if successful |
protected void |
setRefString(java.lang.String str)
record the reference string used to initialise this reference object (e.g. |
void |
setType(java.lang.String str)
convenience method to set the type of this item |
void |
update(java.util.Observable o,
java.lang.Object arg)
respond to change in a field value by getting parent container to fire an update event |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
changes
protected java.beans.PropertyChangeSupport changes
- bean support helper class
useScrap
static boolean useScrap
- whether to make use of the scrapbook feature - in some cases, its useful to have, in others, its an unnecessary distraction
types
static java.util.Properties types
- mini-registry of valid Item types
reference
java.lang.Object reference
- the reference object, as defined by Referer interface
PROP_REFSTRING
public static final java.lang.String PROP_REFSTRING
- field name denoting the (hidden) reference string
- See Also:
- Constant Field Values
props
java.util.Hashtable props
- collection of properties assigned to this item
methods
java.util.Hashtable methods
- collection of methods assigned to this object
defmeth
protected UMethod defmeth
- the default method fore this item
sealed
boolean sealed
- denotes whether methods/properties can be added
| Constructor Detail |
ItemImpl
public ItemImpl()
- default no-argument constructor for subclasses to use
ItemImpl
public ItemImpl(java.lang.String name)
- by default, the Item has no methods, and only one property, its name. This is
passed in at construct-time. Every item ought to have a name!
| Method Detail |
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
- add a property listener for bean support
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
- remove a property listener (for bean support)
addDefaultMethods
public void addDefaultMethods()
- add default methods for opening and refreshing container. These will
always be restored after a call to clearMethods(), so may be useful to override
this method in some cases
invoke
public java.lang.Object invoke(UMethod u) throws java.lang.Exception
- implementation of Handler - this is the callback point for an invoked method.
The default implementation here handles the ubiquitous open() and refresh() methods
of the View, so subclasses adding their own handler code should call the super.invoke()
at some point in order to preserve this important functionality
getScrapbook
public static View getScrapbook(java.lang.Object obj)
- get the scrapbook View
getName
public java.lang.String getName()
- convenience method to get the name
- Specified by:
getNamein interfacePropertied
setName
public void setName(java.lang.String s)
- convenience method to set the name
- Specified by:
setNamein interfacePropertied
getParent
public UContainer getParent()
- generic UContained imlementation
- Specified by:
getParentin interfaceUContained
getParentView
public View getParentView()
- convenience method to get the parent View
- Specified by:
getParentViewin interfaceItem
setParent
public void setParent(UContainer u)
- convenience method to set the parent View
- Specified by:
setParentin interfaceUContained
setParentView
public void setParentView(View v)
- convenience method to set the parent View
- Specified by:
setParentViewin interfaceItem
getReference
public java.lang.Object getReference()
- convenience getter for primary reference property (Not all items
will have a reference, but many will - it's the thing behind the item, the
file, the resultset, the object, etc.)
- Specified by:
getReferencein interfaceReferrer
setReference
public void setReference(java.lang.Object o)
- conenience setter for primary reference property (Not all items
will have a reference, but many will - it's the thing behind the item, the
file, the resultset, the object, etc.)
- Specified by:
setReferencein interfaceReferrer
setRefImpl
public boolean setRefImpl(java.lang.Object o)
- implementation of setReference for subclasses to override - return true if successful
setRefString
protected void setRefString(java.lang.String str)
- record the reference string used to initialise this reference object (e.g. a directory spec,
or a JDBC url)
getType
public java.lang.String getType()
- denote the type of this item, used in the UI to differentiate between
different sorts (e.g. by assigning icons, allowing grouping by type, etc.
setType
public void setType(java.lang.String str)
inferTypeByClass
protected java.lang.String inferTypeByClass()
- Deprecated. with shaper-based architecture, items aren't differentiated by subclass
- helper to infer type by class name
- helper to infer type by class name
properties
public UField[] properties()
- get this object's properties
- Specified by:
propertiesin interfacePropertied
getProp
public UField getProp(java.lang.String name)
- get a property by name
- Specified by:
getPropin interfacePropertied
addProp
public boolean addProp(UField u)
- (attempt to) add a property
- Specified by:
addPropin interfacePropertied
addProp
public boolean addProp(java.lang.String name, java.lang.Object obj)
- convenience method to quickly add fields
removeProp
public boolean removeProp(UField u)
- (attempt to) remove a property
- Specified by:
removePropin interfacePropertied
clearProps
public boolean clearProps()
- clear all properties
- Specified by:
clearPropsin interfacePropertied
update
public void update(java.util.Observable o, java.lang.Object arg)
- respond to change in a field value by getting parent container to fire an update event
- Specified by:
updatein interfacejava.util.Observer
methods
public UMethod[] methods()
getMethod
public UMethod getMethod(java.lang.String name)
getDefaultMethod
public UMethod getDefaultMethod()
- get the default method
- Specified by:
getDefaultMethodin interfaceInvokable
setDefaultMethod
public void setDefaultMethod(UMethod u)
- set the default method (and add it to methods list if not already there)
- Specified by:
setDefaultMethodin interfaceInvokable
addMethod
public boolean addMethod(UMethod u)
removeMethod
public boolean removeMethod(UMethod u)
- (attempt to) remove a method
- Specified by:
removeMethodin interfaceInvokable
clearMethods
public boolean clearMethods()
- clear all methods
- Specified by:
clearMethodsin interfaceInvokable
seal
public void seal()
- prevent any further addition/removal of methods or properties
addJAFMethods
public static void addJAFMethods(JAFable jaf)
- Deprecated.
- add the JAF-based methods for a JAF-enabled Item
- add the JAF-based methods for a JAF-enabled Item
getContent
public java.net.URL getContent()
- by default, a null implementation, leave this alone unless the Item does have a
content source to talk to
- Specified by:
getContentin interfaceContentSource
|
|||||||||
| Home >> All >> ulu >> [ view overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
ulu.view.ItemImpl