|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.beans.AssociationsLogic
This class contains the task logic for the
AssociationsPanel
. It assumes a BinaryLink
between two Persitables
.
Supported API: true.
Extendable: true.
Field Summary | |
protected static AttributeHelper |
attributeHelper
|
private ClassInfo |
classInfo
|
private static boolean |
DEBUG
|
private static IconCache |
iconCache
|
private String |
linkClassName
|
private AssociationsModel |
model
|
private Object |
object
|
private Class |
objectClass
|
private String[] |
otherSideAttributes
|
private Class |
otherSideClass
|
private String |
role
|
private String |
standardIconResource
|
Constructor Summary | |
AssociationsLogic()
No arg constructor for AssociationsLogic Supported API: true. |
Method Summary | |
protected BinaryLink |
createNewLink(Persistable added_object)
This creates a new link between this side object and an added other-side object using the linkClass. |
private void |
debug(String message)
|
String |
getAttrValue(Object obj,
Method getter)
This invokes the getter on the object passed in and returns the string value representing that object. |
String |
getAttrValue(Object obj,
String attribute)
|
ClassInfo |
getClassInfo()
This returns the ClassInfo for the current object
whose links are being manipulated. |
String |
getDisplayName(String attribute,
String class_name)
This uses introspection to find the display name for the passed in attribute and the passed in class_name. |
Method |
getGetterMethod(String attribute,
Object object)
This uses introspection to find the getter method for the object passed in and it's attribute. |
Class |
getLinkClass()
This is the public getter for the link class being displayed in the multilist and being created, updated, or viewed. |
String |
getLinkClassName()
This is the public getter for the name of the link class being displayed in the multilist and being created, updated, or viewed. |
AssociationsModel |
getModel()
Get the model used to navigate the association Supported API: true. |
Object |
getObject()
This is the getter for the object for which the links can be created, updated, and viewed. |
Class |
getObjectClass()
This returns the Class for which the links
are being displayed in the multilist. |
String[] |
getOtherSideAttributes()
This returns an array of attributes on the other side object that are displayed in the columns of the multilist. |
Class |
getOtherSideClass()
This returns the class on the other side of the link. |
Object |
getRelations()
This method navigates the links on the object and returns all links that are of the same class as the linkClass . |
String |
getRole()
This is the getter of the role of the other side object. |
protected String |
getSimpleName(Class a_class)
Helper method to get the name of the class without the package qualification. |
Image |
getStandardIcon(WTObject myObject,
WTContext context)
Returns an Image that symbolically represents the object instance or class. |
protected void |
initClassInfo()
This initializes the classInfo variable
with a new instance of ClassInfo for the current
objectClass
Supported API: true. |
private void |
initIconCache()
|
boolean |
isPersistent(Persistable persistable)
Tests to see if the Peristable parameter is persistent
in the database. |
void |
save(Enumeration removed_links,
Hashtable links)
This persists any new links that the user created, and any links that the user updated. |
void |
setLinkClassName(String class_name)
This is the public setter for the name of the link class to be displayed in the multilist and created, updated, or viewed. |
void |
setModel(AssociationsModel model)
Set the model used to navigate the association Supported API: true. |
void |
setObject(Object object)
This sets the object for which the links can be created, updated, and viewed. |
void |
setObjectClass(Class object_class)
This is the public setter for the class to be displayed in the multilist and created, updated, or viewed. |
void |
setOtherSideAttributes(String[] attributes)
This sets the attributes on the other side object that will be displayed in the columns of the multilist. |
void |
setOtherSideClass(Class other_side)
This sets the class on the other side of the link. |
void |
setRole(String role)
Call this to set the role of the other side object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final boolean DEBUG
private String standardIconResource
private static IconCache iconCache
private String[] otherSideAttributes
private Object object
private Class objectClass
private String role
private Class otherSideClass
private String linkClassName
private ClassInfo classInfo
private AssociationsModel model
protected static AttributeHelper attributeHelper
Constructor Detail |
public AssociationsLogic()
Method Detail |
public void setObject(Object object)
public Object getObject()
public void setRole(String role)
public String getRole()
public Class getOtherSideClass()
public void setOtherSideClass(Class other_side)
public void setOtherSideAttributes(String[] attributes)
public String[] getOtherSideAttributes()
public void setLinkClassName(String class_name)
public String getLinkClassName() throws WTIntrospectionException, WTException
WTIntrospectionException
WTException
public Class getLinkClass() throws WTIntrospectionException, WTException, ClassNotFoundException
WTIntrospectionException
WTException
ClassNotFoundException
public void setModel(AssociationsModel model)
public AssociationsModel getModel()
public void setObjectClass(Class object_class)
public Class getObjectClass()
Class
for which the links
are being displayed in the multilist.
public String getAttrValue(Object obj, Method getter) throws InvocationTargetException, IllegalAccessException
InvocationTargetException
IllegalAccessException
public String getAttrValue(Object obj, String attribute) throws InvocationTargetException, IllegalAccessException, WTException
InvocationTargetException
IllegalAccessException
WTException
public Object getRelations() throws WTIntrospectionException, WTException, ClassNotFoundException
linkClass
.
WTIntrospectionException
WTException
ClassNotFoundException
public Method getGetterMethod(String attribute, Object object) throws WTException
attribute
- for which to find the getterobject
- that the getter is on
WTException
public void save(Enumeration removed_links, Hashtable links) throws WTException
WTException
protected BinaryLink createNewLink(Persistable added_object) throws WTIntrospectionException, IllegalAccessException, NoSuchMethodException, InstantiationException, ClassNotFoundException, InvocationTargetException, WTException
WTIntrospectionException
IllegalAccessException
NoSuchMethodException
InstantiationException
ClassNotFoundException
InvocationTargetException
WTException
protected String getSimpleName(Class a_class)
public ClassInfo getClassInfo() throws WTException
ClassInfo
for the current object
whose links are being manipulated.
WTException
protected void initClassInfo() throws WTException
classInfo
variable
with a new instance of ClassInfo for the current
objectClass
WTException
public boolean isPersistent(Persistable persistable)
Peristable
parameter is persistent
in the database.
persistable
- A Peristable
that will be tested to see
if it is persistent.
boolean
. The value true
means that the Peristable
parameter
is persistent.Persistable
private void debug(String message)
public Image getStandardIcon(WTObject myObject, WTContext context)
Image
to be displayed.Image
private void initIconCache()
public String getDisplayName(String attribute, String class_name) throws ClassNotFoundException, WTIntrospectionException
ClassNotFoundException
WTIntrospectionException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |