Class AssociationsLogic

java.lang.Object
wt.clients.beans.AssociationsLogic

public class AssociationsLogic extends Object
This class contains the task logic for the AssociationsPanel. It assumes a BinaryLink between two Persitables.

Supported API: true.

Extendable: true.
  • Constructor Summary

    Constructors
    Constructor
    Description
    No arg constructor for AssociationsLogic

    Supported API: true.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected BinaryLink
    createNewLink(Persistable added_object)
    This creates a new link between this side object and an added other-side object using the linkClass.
    getAttrValue(Object obj, Method getter)
    This invokes the getter on the object passed in and returns the string value representing that object.
    This returns the ClassInfo for the current object whose links are being manipulated.
    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.
    getGetterMethod(String attribute, Object object)
    This uses introspection to find the getter method for the object passed in and it's attribute.
    This is the public getter for the link class being displayed in the multilist and being created, updated, or viewed.
    This is the public getter for the name of the link class being displayed in the multilist and being created, updated, or viewed.
    Get the model used to navigate the association

    Supported API: true.
    This is the getter for the object for which the links can be created, updated, and viewed.
    This returns the Class for which the links are being displayed in the multilist.
    This returns an array of attributes on the other side object that are displayed in the columns of the multilist.
    This returns the class on the other side of the link.
    This method navigates the links on the object and returns all links that are of the same class as the linkClass.
    This is the getter of the role of the other side object.
    getStandardIcon(WTObject myObject, WTContext context)
    Returns an Image that symbolically represents the object instance or class.
    protected void
    This initializes the classInfo variable with a new instance of ClassInfo for the current objectClass

    Supported API: true.
    boolean
    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
    This is the public setter for the name of the link class to be displayed in the multilist and created, updated, or viewed.
    void
    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
    This sets the attributes on the other side object that will be displayed in the columns of the multilist.
    void
    This sets the class on the other side of the link.
    void
    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
  • Constructor Details

    • AssociationsLogic

      public AssociationsLogic()
      No arg constructor for AssociationsLogic

      Supported API: true.
  • Method Details

    • setObject

      public void setObject(Object object)
      This sets the object for which the links can be created, updated, and viewed.

      Supported API: true.
    • getObject

      public Object getObject()
      This is the getter for the object for which the links can be created, updated, and viewed.

      Supported API: true.
    • setRole

      public void setRole(String role)
      Call this to set the role of the other side object. It is used to traverse the link that will be created, updated, or viewed.

      Supported API: true.
    • getRole

      public String getRole()
      This is the getter of the role of the other side object.

      Supported API: true.
    • getOtherSideClass

      public Class getOtherSideClass()
      This returns the class on the other side of the link.

      Supported API: true.
    • setOtherSideClass

      public void setOtherSideClass(Class other_side)
      This sets the class on the other side of the link.

      Supported API: true.
    • setOtherSideAttributes

      public void setOtherSideAttributes(String[] attributes)
      This sets the attributes on the other side object that will be displayed in the columns of the multilist.

      Supported API: true.
    • getOtherSideAttributes

      public String[] getOtherSideAttributes()
      This returns an array of attributes on the other side object that are displayed in the columns of the multilist.

      Supported API: true.
    • setLinkClassName

      public 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.

      Supported API: true.
    • getLinkClassName

      public String getLinkClassName() throws WTIntrospectionException, WTException
      This is the public getter for the name of the link class being displayed in the multilist and being created, updated, or viewed.

      Supported API: true.
      Throws:
      WTIntrospectionException
      WTException
    • getLinkClass

      This is the public getter for the link class being displayed in the multilist and being created, updated, or viewed.

      Supported API: true.
      Throws:
      WTIntrospectionException
      WTException
      ClassNotFoundException
    • setModel

      public void setModel(AssociationsModel model)
      Set the model used to navigate the association

      Supported API: true.
    • getModel

      public AssociationsModel getModel()
      Get the model used to navigate the association

      Supported API: true.
    • setObjectClass

      public void setObjectClass(Class object_class)
      This is the public setter for the class to be displayed in the multilist and created, updated, or viewed.

      Supported API: true.
    • getObjectClass

      public Class getObjectClass()
      This returns the Class for which the links are being displayed in the multilist.

      Supported API: true.
    • getAttrValue

      public String getAttrValue(Object obj, Method getter) throws InvocationTargetException, IllegalAccessException
      This invokes the getter on the object passed in and returns the string value representing that object.

      Supported API: true.
      Throws:
      InvocationTargetException
      IllegalAccessException
    • getRelations

      This method navigates the links on the object and returns all links that are of the same class as the linkClass.

      Supported API: true.
      Throws:
      WTIntrospectionException
      WTException
      ClassNotFoundException
    • getGetterMethod

      public Method getGetterMethod(String attribute, Object object) throws WTException
      This uses introspection to find the getter method for the object passed in and it's attribute.

      Supported API: true.
      Parameters:
      attribute - for which to find the getter
      object - that the getter is on
      Throws:
      WTException
    • save

      public void save(Enumeration removed_links, Hashtable links) throws WTException
      This persists any new links that the user created, and any links that the user updated. It also removes the links that the user removed.

      Supported API: true.
      Throws:
      WTException
    • createNewLink

      This creates a new link between this side object and an added other-side object using the linkClass.

      Supported API: true.
      Throws:
      WTIntrospectionException
      IllegalAccessException
      NoSuchMethodException
      InstantiationException
      ClassNotFoundException
      InvocationTargetException
      WTException
    • getClassInfo

      public ClassInfo getClassInfo() throws WTException
      This returns the ClassInfo for the current object whose links are being manipulated.

      Supported API: true.
      Throws:
      WTException
    • initClassInfo

      protected void initClassInfo() throws WTException
      This initializes the classInfo variable with a new instance of ClassInfo for the current objectClass

      Supported API: true.
      Throws:
      WTException
    • isPersistent

      public boolean isPersistent(Persistable persistable)
      Tests to see if the Peristable parameter is persistent in the database.

      Supported API: true.
      Parameters:
      persistable - A Peristable that will be tested to see if it is persistent.
      Returns:
      A boolean. The value true means that the Peristable parameter is persistent.
      See Also:
    • getStandardIcon

      public Image getStandardIcon(WTObject myObject, WTContext context)
      Returns an Image that symbolically represents the object instance or class. For the WTQuery list, the Image should be 16x16 pixels. By convention, the background should be transparent which is readily supported by the GIF images. This method is used by WTQuery during run-time.

      Supported API: true.
      Returns:
      Image to be displayed.
      Since:
      Windchill Foundation 1.0: WTQuery
      See Also:
    • getDisplayName

      public String getDisplayName(String attribute, String class_name) throws ClassNotFoundException, WTIntrospectionException
      This uses introspection to find the display name for the passed in attribute and the passed in class_name.

      Supported API: true.
      Throws:
      ClassNotFoundException
      WTIntrospectionException