wt.clients.beans
Class AssociationsPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended bywt.clients.beans.AssociationsPanel
All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable

public class AssociationsPanel
extends Container
implements ItemSelectable

This bean has a dev-time and run-time component. At dev-time, this component can be dragged from the component library in Visual Cafe and dropped onto a container. The properties can also be edited by using Visual Cafe's Property Editor. At run-time, this class retrieves the links of the object and displays them in a multilist. The bean has an Edit and View mode. In edit mode, the user can add new relationships, remove existing relationships, and update existing relationships by editing the attributes on the link. In view mode, the user can view the relationships and view the attributes on the link. The bean keeps track of the creates, updates, and removes and is able to persist the changes when save() is invoked. The following is an example of how to use the bean:

		associationsPanel1 = new wt.clients.beans.AssociationsPanel();
		associationsPanel1.setRole("someRole");
		associationsPanel1.setChooserOptions(wt.clients.beans.query.ChooserOptions.SOME_SEARCH_LIST);
		try {
			java.lang.String[] tempString = new java.lang.String[5];
			tempString[0] = display("nameColumn");
			tempString[1] = display("numberColumn");
			tempString[2] = display(SomeRB.TITLE_COLUMN);
			tempString[3] = display(SomeRB.PART_TYPE_COLUMN);
			tempString[4] = display(SomeRB.SOURCE_COLUMN);
			associationsPanel1.setLabels(tempString);
		}
		catch(java.beans.PropertyVetoException e) { }
		try {
			associationsPanel1.setLinkClassName("someClass");
		}
		catch(wt.util.WTPropertyVetoException e) { }
		try {
			associationsPanel1.setObjectClassName("anotherClass");
		}
		catch(java.lang.ClassNotFoundException e) { }
		try {
			java.lang.String[] tempString = new java.lang.String[5];
			tempString[0] = new java.lang.String("name");
			tempString[1] = new java.lang.String("number");
			tempString[2] = new java.lang.String("title");
			tempString[3] = new java.lang.String("partType");
			tempString[4] = new java.lang.String("source");
			associationsPanel1.setOtherSideAttributes(tempString);
		}
		catch(wt.util.WTPropertyVetoException e) { }
		try {
			associationsPanel1.setOtherSideClassName("someClass");
		}
		catch(java.lang.ClassNotFoundException e) { }
		associationsPanel1.setMode("Edit");
		try {
			java.lang.String[] tempString = new java.lang.String[1];
			tempString[0] = new java.lang.String("description");
			associationsPanel1.setLinkAttributes(tempString);
		}
		catch(wt.util.WTPropertyVetoException e) { }
		associationsPanel1.setBounds(0,0,530,62);
		associationsPanel1.setBackground(new Color(12632256));
		gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.weightx = 1.0;
		gbc.weighty = 1.0;
		gbc.fill = GridBagConstraints.BOTH;
		gbc.insets = new Insets(0,0,0,0);
		((GridBagLayout)panel3.getLayout()).setConstraints(associationsPanel1, gbc);
		panel3.add(associationsPanel1);
		associationsPanel1.addHelpListener(helpListener);
       associationsPanel1.setObject(taskLogic.getCurrentObject());
       associationsPanel1.setEnabled(true);
		associationsPanel1.save(taskLogic.getCurrentObject());
	    associationsPanel1.getHelpContext().stopIt();
   
The class accommodates validating and persisting changes only when the save() method is invoked. To turn on this behavior invoke the setSaveUpdatesOnly(true) method. The normal behavior is to verify and persist all association entries even though some of the entries are not changed. When the normal behavior is used existing described by documents that are in a checked out state by another user will error when the save() method is invoked. This results in adds, removes, or updates not being saved. If this is not the desired behavior then invoke the setSaveUpdatesOnly(true) method immediately after instantiating the class.

Supported API: true.

Extendable: true.

See Also:
Serialized Form

Nested Class Summary
 class AssociationsPanel.AddObjectListener
          This class listens for the user to select an objec.
(package private)  class AssociationsPanel.SymAction
           
(package private)  class AssociationsPanel.SymComponent
           
(package private)  class AssociationsPanel.SymItem
           
(package private)  class AssociationsPanel.SymPropertyChange
           
(package private)  class AssociationsPanel.WorkThread
           
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int ADD
           
(package private)  Button addButton
           
private  Applet applet
           
(package private)  AttributesForm attributesForm1
           
private  boolean attributesFormSetObjectInProcess
           
private  boolean autoCheckout
           
private  Color background
           
(package private)  Panel buttonPanel
           
private  String chooserOptions
           
protected  ThreadGroup contextGroup
           
private  boolean currentLinkAttributeDirty
           
private static boolean DEBUG
           
private  boolean dirty
           
static String EDIT_MODE
           
private  Color foregound
           
private  Frame frame
           
(package private)  HelpContext helpContext
           
(package private)  HelpSystem helpSystem
           
(package private)  ItemListener itemListener
           
private  String[] labels
           
private  String[] linkAttributes
           
private  String linkClassName
           
private  Hashtable links
           
private  Schema linkSchema
           
private  String mode
           
private  AssociationsModel model
           
(package private)  WTMultiList multiList
           
private  String[] multiListLinkAttributes
           
private  Object object
           
private  Class objectClass
           
private  String objectClassName
           
private  int oldSelection
           
private  String[] otherSideAttributes
           
private  Class otherSideClass
           
private  String otherSideClassName
           
private  Schema otherSideSchema
           
(package private)  Panel panel1
           
static int POPULATE
           
private  Dialog queryDialog
           
private  String[] relativeColumnWidths
           
(package private)  Button removeButton
           
private  Hashtable removedLinks
           
private static ResourceBundle resource
           
private static String RESOURCE
           
private  String role
           
private  boolean saveUpdatesOnly
           
private  boolean showIBA
           
private  AssociationsLogic taskLogic
           
static int UPDATE
           
private  Hashtable updatedLinks
           
static int VIEW
           
static String VIEW_MODE
           
(package private)  Button viewButton
           
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AssociationsPanel()
          This is the no arg constructor that creates the panel with a multilist, a view button, and an attributesForm which will be used to display or edit the attributes on the link.
AssociationsPanel(String mode)
          This creates an instance of the associationsPanel and sets the mode to the parameter.
 
Method Summary
(package private)  void addButton_ActionPerformed(ActionEvent event)
           
protected  void addEditButtons()
          This adds the buttons that are associated with the edit mode

Supported API: true.
 void addHelpListener(PropertyChangeListener pcl)
          Method addHelpListener adds the given listener to be notified of PropertyChangeEvents in the help system.
 void addItemListener(ItemListener l)
           
protected  void addObject()
          This is called when the user clicks the Add button.
protected  void addSelectedObject(Persistable added_object)
          This creates a new link to an object selected by the user and adds it to the multilist.
protected  void addToTable(BinaryLink link)
          this adds a new object to the table

Supported API: true.
private  void addToUpdatedTable(BinaryLink aLink)
           
(package private)  void attributesForm1_propertyChange(PropertyChangeEvent event)
           
protected  void createEditButtons()
          This creates the buttons used in edit mode

Supported API: true.
protected  void createUI()
          This adds and removes fields based on the mode

Supported API: true.
private  void debug(String message)
           
protected  void defaultColumnWidths()
          This initialized the column widths of the multilist to equal widths with a hidden last column.
private  String display(String key, Object[] params)
          Returns the localized string to be displayed to the user given a key.
protected  void displayException(Exception e)
          This displays an exception to the user and prints the stack trace for it.
 Applet getApplet()
          This is the public getter used to get the Applet that started this bean.
 boolean getAutoCheckout()
          Return the value of the auto checkout flag.
 Color getBackground()
          This gets the background of the panel.
 String getChooserOptions()
          This is used to get the list of classes that the user can pick from on the frame that pops up when the user clicks the Add button.
private  WTContext getContext()
          Retrieves the WTContext associated with this dialog.
 Font getFont()
          This gets the font of the panel.
 Color getForeground()
          This gets the foreground of the panel.
 Frame getFrame()
          This is the public getter used to get the Frame that started this bean.
 HelpContext getHelpContext()
          This returns the helpContext being used for online help.
 HelpSystem getHelpSystem()
          This returns the helpSystem being used for online help.
 String[] getLabels()
          This gets the labels that are used as the column headers for the multilist.
 String[] getLinkAttributes()
          This gets the names of the attributes of the other-side class that are displayed in the columns of the multilist.
 String getLinkClassName()
          This gets the name of the linkClass that to be traversed.
private  Object getLinkInTable(BinaryLink aLink, Hashtable theTable)
           
 Schema getLinkSchema()
          This method returns the linkSchema set by the developer at dev-time

Supported API: true.
 Dimension getMinimumSize()
          This returns the minimum size that will be used at dev-time and at run-time depending on the layout.
 Dimension getMinimumSize(int cols, int rows)
          This returns the minimum size that will be used at dev-time and at run-time depending on the layout.
 String getMode()
          This is the public getter that returns the current mode of the bean.
 AssociationsModel getModel()
           
 String[] getMultiListLinkAttributes()
          This gets the names of the attributes of the link class that are displayed in the columns of the multilist.
 Object getObject()
          This is the public getter that will return the object that is being edited or viewed.
 Class getObjectClass()
          This is the public getter for the objectClass whose links are navigated & updated, or viewed.
 String getObjectClassName()
          This is the public getter for the objectClassName which is the string that represents the objectClass whose links are navigated & updated, or viewed.
 String[] getOtherSideAttributes()
          This is the public getter used to get the otherSideAttributes that are displayed in the multilist.
 Class getOtherSideClass()
          This is the public getter that returns the class that is being navigated to along the role.
 String getOtherSideClassName()
          This is the public getter that returns the name of the class that is being navigated to along the role.
 Schema getOtherSideSchema()
          This method returns the otherSideSchema set by the developer at dev-time

Supported API: true.
 Dimension getPreferredSize()
          This returns the preferred size that will be used at dev-time and at run-time depending on the layout.
 Dimension getPreferredSize(int cols, int rows)
          This returns the preferred size that will be used at dev-time and at run-time depending on the layout.
 String[] getRelativeColumnWidths()
          This method is used to get the widths of the of the multilist relative to 1 which represents the smallest column width.
 String getRole()
          This is the public getter for the role that is navigated.
 boolean getSaveUpdatesOnly()
          This is the public getter that returns the boolean value of the saveUpdatesOnly flag.
 BinaryLink getSelectedLink()
          This returns the link represented by the row that the user has selected in the multilist.
 Persistable getSelectedObject()
          This returns the object that the user has currently selected in the multilist.
 Object[] getSelectedObjects()
          This returns the objects that the user has currently selected in the multilist.
protected  int getSelectedRow()
           
 boolean getShowIBA()
          Get whether IBA tab will show.
(package private)  Frame getTopLevelParent(Component component)
          This method gets the top level parent of the Component passed in and returns it if it is a Frame.
private  void initHelpSystem()
           
(package private)  void initializeHelp()
           
private  void initResources()
          Initializes resource bundles used by this class.
protected  boolean isAttributesFormSetObjectInProcess()
           
protected  boolean isCurrentLinkAttributeDirty()
          This returns a boolean value representing whether or not the user has modified the current link attribute(s).
 boolean isDirty()
          This returns a boolean value representing whether or not the user has modified anything.
protected  void launchChooserDialog()
          This launches a dialog that will allow the user to select an object and add it to the multilist, create a new link to it, and edit the link.
protected  void launchQueryDialog()
          This launches a dialog that will allow the user to select an object and add it to the multilist, create a new link to it, and edit the link.
protected  void localize()
          This method sets the text of the components to the localized string from the resource bundle.
(package private)  void multiList_actionPerformed(ActionEvent event)
           
(package private)  void multiList_componentResized(ComponentEvent event)
           
(package private)  void multiList_itemStateChanged(ItemEvent event)
           
protected  void notifyItemListeners(ItemEvent event)
           
protected  void populate()
          This retrieves the links on the object and displays them in the multilist.
 void refresh()
          This method redraws the column widths after the multilist has been displayed.
(package private)  void removeButton_ActionPerformed(ActionEvent event)
           
protected  void removeEditButtons()
          This removes the buttons that are associated with the edit mode

Supported API: true.
 void removeHelpListener(PropertyChangeListener pcl)
          Method removeHelpListener removes a listener which was being notified of PropertyChangeEvents in the help system.
 void removeItemListener(ItemListener l)
           
protected  void removeSelectedObject(BinaryLink link)
          this removes the link that the user has selected from the links hashtable and adds it to the removedLinks hashtable if it is persistent so that it can be removed from the db.
 void requestFocus()
          Calling requestFocus() on this panel will set the focus to the first field in the panel which is the multilist.
protected  void resetCurrentRow()
          Helper method invoked by save() method to reset the attributeform with the currently selected row..
protected  void resetHashtables()
          This resets the hashtables

Supported API: true.
protected  void resetLabels()
          This resets the column headers with the context of the labels property and the multiListLinkAttributes property.
 Persistable save(Persistable persistable)
          This is used to save the links the to Persistable passed in.
 void setApplet(Applet applet)
          This is the public setter used to set the Applet that started this bean.
protected  void setAttributesFormSetObjectInProcess(boolean flag)
           
 void setAutoCheckout(boolean flag)
          Set this flag to auto checkout and checkin the role A object if it isn't already checked out.
 void setBackground(Color color)
          This sets the background of the panel.
 void setChooserOptions(String options)
          This is used to set the list of classes that the user can pick from on the frame that pops up when the user clicks the Add button.
private  void setContext(boolean context_on)
           
protected  void setCurrentLinkAttributeDirty(boolean flag)
          This sets the dirty flag and should be called when the user makes some action to change the state of the bean.
protected  void setDirty(boolean flag)
          This sets the dirty flag and should be called when the user makes some action to change the state of the bean.
 void setEnabled(boolean b)
          This sets the panel and it's components to enabled or disabled based on the passed in boolean.
protected  void setFieldState(boolean b, Container container)
          This sets the fields to either editable or enabled depending on the boolean and the type of component.
 void setFont(Font font)
          This sets the font of the panel.
 void setForeground(Color color)
          This sets the foreground of the panel.
 void setFrame(Frame frame)
          This is the public setter used to set the Frame that started this bean.
 void setLabels(String[] labels)
          This sets the labels that will be used as the column headers for the multilist.
 void setLinkAttributes(String[] link_attributes)
          This sets the names of the attributes of the other-side class that will be displayed in the columns of the multilist.
 void setLinkClassName(String class_name)
          This sets the name of the linkClass that is being traversed.
 void setLinkSchema(Schema schema)
          This is used at dev-time when the developer uses the schema editor to select the class and the attributes of the link.
 void setMode(String mode)
          This is used to set the mode of the bean to either EDIT_MODE or VIEW_MODE and the GUI will be updated based on the mode.
 void setModel(AssociationsModel model)
          This method sets the model class used to navigate the relationship.
 void setMultiListLinkAttributes(String[] link_attributes)
          This sets the names of the attributes of the link class that will be displayed in the columns of the multilist.
 void setObject(Object object)
          This is the public setter that will set the object that to be edited or viewed.
 void setObjectClass(Class object_class)
          This is the public setter for the objectClass whose links will be navigated & updated, or viewed.
 void setObjectClassName(String object_class)
          This is the public setter for the objectClassName which is the string that represents the objectClass whose links will be navigated & updated, or viewed.
 void setOtherSideAttributes(String[] attributes)
          This is the public setter used to set the otherSideAttributes that are displayed in the multilist.
 void setOtherSideClass(Class other_side)
          This is the public setter that sets the class to be navigated to along the role.
 void setOtherSideClassName(String other_side)
          This is the public setter that sets the name of the class to be navigated to along the role.
 void setOtherSideSchema(Schema schema)
          This is used at dev-time when the developer uses the schema editor to select the class and the attributes of the other-side object.
 void setRelativeColumnWidths(String[] widths)
          This method is used to set the widths of the of the multilist relative to 1 which represents the smallest column width.
 void setRole(String role)
          This is the public setter for the role that will be navigated.
 void setSaveUpdatesOnly(boolean flagValue)
          This sets the boolean value of the saveUpdatesOnly flag.
 void setShowIBA(boolean show_iba)
          Used to set if IBA tab will show up.
protected  void updateLinks()
          This updates the links with the results of the user's actions

Supported API: true.
protected  void updateTableLinkValues(int row, BinaryLink link)
          Update the string values displayed in the MultiList.
(package private)  void viewButton_ActionPerformed(ActionEvent event)
           
protected  void viewSelectedObject()
          This will use the TaskDelegate for the selected object to launch a view of that object.
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

labels

private String[] labels

relativeColumnWidths

private String[] relativeColumnWidths

foregound

private Color foregound

background

private Color background

objectClassName

private String objectClassName

role

private String role

otherSideClassName

private String otherSideClassName

otherSideAttributes

private String[] otherSideAttributes

linkClassName

private String linkClassName

linkAttributes

private String[] linkAttributes

multiListLinkAttributes

private String[] multiListLinkAttributes

linkSchema

private Schema linkSchema

otherSideSchema

private Schema otherSideSchema

chooserOptions

private String chooserOptions

showIBA

private boolean showIBA

EDIT_MODE

public static final String EDIT_MODE
See Also:
Constant Field Values

VIEW_MODE

public static final String VIEW_MODE
See Also:
Constant Field Values

mode

private String mode

object

private Object object

objectClass

private Class objectClass

otherSideClass

private Class otherSideClass

links

private Hashtable links

updatedLinks

private Hashtable updatedLinks

removedLinks

private Hashtable removedLinks

applet

private Applet applet

frame

private Frame frame

taskLogic

private AssociationsLogic taskLogic

queryDialog

private Dialog queryDialog

model

private AssociationsModel model

POPULATE

public static final int POPULATE
See Also:
Constant Field Values

VIEW

public static final int VIEW
See Also:
Constant Field Values

ADD

public static final int ADD
See Also:
Constant Field Values

UPDATE

public static final int UPDATE
See Also:
Constant Field Values

dirty

private boolean dirty

currentLinkAttributeDirty

private boolean currentLinkAttributeDirty

attributesFormSetObjectInProcess

private boolean attributesFormSetObjectInProcess

saveUpdatesOnly

private boolean saveUpdatesOnly

autoCheckout

private boolean autoCheckout

oldSelection

private int oldSelection

resource

private static ResourceBundle resource

RESOURCE

private static String RESOURCE

helpSystem

HelpSystem helpSystem

helpContext

HelpContext helpContext

contextGroup

protected ThreadGroup contextGroup

itemListener

transient ItemListener itemListener

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

multiList

WTMultiList multiList

buttonPanel

Panel buttonPanel

viewButton

Button viewButton

panel1

Panel panel1

attributesForm1

AttributesForm attributesForm1

addButton

Button addButton

removeButton

Button removeButton
Constructor Detail

AssociationsPanel

public AssociationsPanel()
This is the no arg constructor that creates the panel with a multilist, a view button, and an attributesForm which will be used to display or edit the attributes on the link.

Supported API: true.


AssociationsPanel

public AssociationsPanel(String mode)
This creates an instance of the associationsPanel and sets the mode to the parameter.

Supported API: true.

Method Detail

localize

protected void localize()
This method sets the text of the components to the localized string from the resource bundle.

Supported API: true.


getMinimumSize

public Dimension getMinimumSize()
This returns the minimum size that will be used at dev-time and at run-time depending on the layout.

Supported API: true.


getMinimumSize

public Dimension getMinimumSize(int cols,
                                int rows)
This returns the minimum size that will be used at dev-time and at run-time depending on the layout.

Supported API: true.


getPreferredSize

public Dimension getPreferredSize()
This returns the preferred size that will be used at dev-time and at run-time depending on the layout.

Supported API: true.


getPreferredSize

public Dimension getPreferredSize(int cols,
                                  int rows)
This returns the preferred size that will be used at dev-time and at run-time depending on the layout.

Supported API: true.


isDirty

public boolean isDirty()
This returns a boolean value representing whether or not the user has modified anything.

Supported API: true.


setDirty

protected void setDirty(boolean flag)
This sets the dirty flag and should be called when the user makes some action to change the state of the bean.

Supported API: true.


isCurrentLinkAttributeDirty

protected boolean isCurrentLinkAttributeDirty()
This returns a boolean value representing whether or not the user has modified the current link attribute(s).

Supported API: true.


setCurrentLinkAttributeDirty

protected void setCurrentLinkAttributeDirty(boolean flag)
This sets the dirty flag and should be called when the user makes some action to change the state of the bean.

Supported API: true.


isAttributesFormSetObjectInProcess

protected boolean isAttributesFormSetObjectInProcess()

setAttributesFormSetObjectInProcess

protected void setAttributesFormSetObjectInProcess(boolean flag)

setMode

public void setMode(String mode)
This is used to set the mode of the bean to either EDIT_MODE or VIEW_MODE and the GUI will be updated based on the mode.

Supported API: true.


getMode

public String getMode()
This is the public getter that returns the current mode of the bean.

Supported API: true.


setChooserOptions

public void setChooserOptions(String options)
This is used to set the list of classes that the user can pick from on the frame that pops up when the user clicks the Add button.

Supported API: true.


getChooserOptions

public String getChooserOptions()
This is used to get the list of classes that the user can pick from on the frame that pops up when the user clicks the Add button.

Supported API: true.


setShowIBA

public void setShowIBA(boolean show_iba)
Used to set if IBA tab will show up.

Supported API: true.


getShowIBA

public boolean getShowIBA()
Get whether IBA tab will show.

Supported API: true.


getObject

public Object getObject()
This is the public getter that will return the object that is being edited or viewed.

Supported API: true.


setObject

public void setObject(Object object)
This is the public setter that will set the object that to be edited or viewed. It will spawn a thread that navigates the relationships on the object and populates the multilist with the links of type linkClass.

Supported API: true.


setRole

public void setRole(String role)
This is the public setter for the role that will be navigated.

Supported API: true.


getRole

public String getRole()
This is the public getter for the role that is navigated.

Supported API: true.


setObjectClass

public void setObjectClass(Class object_class)
This is the public setter for the objectClass whose links will be navigated & updated, or viewed.

Supported API: true.


getObjectClass

public Class getObjectClass()
This is the public getter for the objectClass whose links are navigated & updated, or viewed.

Supported API: true.


setObjectClassName

public void setObjectClassName(String object_class)
                        throws ClassNotFoundException
This is the public setter for the objectClassName which is the string that represents the objectClass whose links will be navigated & updated, or viewed.

Supported API: true.

Throws:
ClassNotFoundException

getObjectClassName

public String getObjectClassName()
This is the public getter for the objectClassName which is the string that represents the objectClass whose links are navigated & updated, or viewed.

Supported API: true.


getOtherSideClass

public Class getOtherSideClass()
This is the public getter that returns the class that is being navigated to along the role.

Supported API: true.


setOtherSideClass

public void setOtherSideClass(Class other_side)
This is the public setter that sets the class to be navigated to along the role.

Supported API: true.


getOtherSideClassName

public String getOtherSideClassName()
This is the public getter that returns the name of the class that is being navigated to along the role.

Supported API: true.


setOtherSideClassName

public void setOtherSideClassName(String other_side)
                           throws ClassNotFoundException
This is the public setter that sets the name of the class to be navigated to along the role.

Supported API: true.

Throws:
ClassNotFoundException

setLinkClassName

public void setLinkClassName(String class_name)
                      throws WTPropertyVetoException
This sets the name of the linkClass that is being traversed.

Supported API: true.

Throws:
WTPropertyVetoException

getLinkClassName

public String getLinkClassName()
This gets the name of the linkClass that to be traversed.

Supported API: true.


setLinkAttributes

public void setLinkAttributes(String[] link_attributes)
                       throws WTPropertyVetoException
This sets the names of the attributes of the other-side class that will be displayed in the columns of the multilist.

Supported API: true.

Throws:
WTPropertyVetoException

getLinkAttributes

public String[] getLinkAttributes()
This gets the names of the attributes of the other-side class that are displayed in the columns of the multilist.

Supported API: true.


setMultiListLinkAttributes

public void setMultiListLinkAttributes(String[] link_attributes)
                                throws WTPropertyVetoException,
                                       PropertyVetoException,
                                       ClassNotFoundException,
                                       WTIntrospectionException
This sets the names of the attributes of the link class that will be displayed in the columns of the multilist.

Supported API: true.

Throws:
WTPropertyVetoException
PropertyVetoException
ClassNotFoundException
WTIntrospectionException

getMultiListLinkAttributes

public String[] getMultiListLinkAttributes()
This gets the names of the attributes of the link class that are displayed in the columns of the multilist.

Supported API: true.


setLinkSchema

public void setLinkSchema(Schema schema)
                   throws PropertyVetoException
This is used at dev-time when the developer uses the schema editor to select the class and the attributes of the link. This method takes the users entries and sets the linkClassName and the linkAttributes.

Supported API: true.

Throws:
PropertyVetoException

getLinkSchema

public Schema getLinkSchema()
This method returns the linkSchema set by the developer at dev-time

Supported API: true.


getModel

public AssociationsModel getModel()

setModel

public void setModel(AssociationsModel model)
              throws PropertyVetoException
This method sets the model class used to navigate the relationship. If no model class is defined, the bean uses PersistenceHelper.manage.navigate to return the QueryResult containing the link classes and the other side objects.

Supported API: true.

Throws:
PropertyVetoException

setOtherSideSchema

public void setOtherSideSchema(Schema schema)
                        throws PropertyVetoException,
                               ClassNotFoundException
This is used at dev-time when the developer uses the schema editor to select the class and the attributes of the other-side object. This method takes the users entries and sets the otherSideClassName and the otherSideAttributes.

Supported API: true.

Throws:
PropertyVetoException
ClassNotFoundException

getOtherSideSchema

public Schema getOtherSideSchema()
This method returns the otherSideSchema set by the developer at dev-time

Supported API: true.


setApplet

public void setApplet(Applet applet)
This is the public setter used to set the Applet that started this bean.

Supported API: true.


getApplet

public Applet getApplet()
This is the public getter used to get the Applet that started this bean.

Supported API: true.


setFrame

public void setFrame(Frame frame)
This is the public setter used to set the Frame that started this bean.

Supported API: true.


getFrame

public Frame getFrame()
This is the public getter used to get the Frame that started this bean.

Supported API: true.


setOtherSideAttributes

public void setOtherSideAttributes(String[] attributes)
This is the public setter used to set the otherSideAttributes that are displayed in the multilist.

Supported API: true.


getOtherSideAttributes

public String[] getOtherSideAttributes()
This is the public getter used to get the otherSideAttributes that are displayed in the multilist.

Supported API: true.


setLabels

public void setLabels(String[] labels)
               throws PropertyVetoException
This sets the labels that will be used as the column headers for the multilist.

Supported API: true.

Throws:
PropertyVetoException

getLabels

public String[] getLabels()
This gets the labels that are used as the column headers for the multilist.

Supported API: true.


getSaveUpdatesOnly

public boolean getSaveUpdatesOnly()
This is the public getter that returns the boolean value of the saveUpdatesOnly flag.

Supported API: true.


setSaveUpdatesOnly

public void setSaveUpdatesOnly(boolean flagValue)
This sets the boolean value of the saveUpdatesOnly flag. The flag is used when the save() method is invoked and determines whether or not all links are validated and then persisted. When set to true, only those links that have been added are validated and persisted. When set to false, all links are validated and persisted, even though a change may not of occurred. The default value for the flag is false.

Supported API: true.


setAutoCheckout

public void setAutoCheckout(boolean flag)
Set this flag to auto checkout and checkin the role A object if it isn't already checked out. If this flag remains false then the behavior is the same as always, it will give the user an error message if the role A object is not in a state where the change to the relationship can occur.


getAutoCheckout

public boolean getAutoCheckout()
Return the value of the auto checkout flag. This flag is used to determine if the code should automatically checkout the role A object if it isn't already check out. The flag defaults to false unless set to true. If this flag is false then the behavior is the same as always, it will give the user an error message if the role A object is not in a state where the change to the relationship can occur.


setRelativeColumnWidths

public void setRelativeColumnWidths(String[] widths)
                             throws PropertyVetoException
This method is used to set the widths of the of the multilist relative to 1 which represents the smallest column width. A width of 2 will create a width twice the size of the column of width 1.

Supported API: true.

Throws:
PropertyVetoException

getRelativeColumnWidths

public String[] getRelativeColumnWidths()
This method is used to get the widths of the of the multilist relative to 1 which represents the smallest column width. A width of 2 will create a width twice the size of the column of width 1.

Supported API: true.


refresh

public void refresh()
             throws PropertyVetoException
This method redraws the column widths after the multilist has been displayed.

Supported API: true.

Throws:
PropertyVetoException

setForeground

public void setForeground(Color color)
This sets the foreground of the panel.

Supported API: true.


getForeground

public Color getForeground()
This gets the foreground of the panel.

Supported API: true.


setBackground

public void setBackground(Color color)
This sets the background of the panel.

Supported API: true.


getBackground

public Color getBackground()
This gets the background of the panel.

Supported API: true.


setFont

public void setFont(Font font)
This sets the font of the panel.

Supported API: true.


getFont

public Font getFont()
This gets the font of the panel.

Supported API: true.

Specified by:
getFont in interface MenuContainer

save

public Persistable save(Persistable persistable)
                 throws WTException,
                        WTIntrospectionException
This is used to save the links the to Persistable passed in. It persists the created & updated links, and deletes the removed links.

Supported API: true.

Throws:
WTException
WTIntrospectionException

resetCurrentRow

protected void resetCurrentRow()
Helper method invoked by save() method to reset the attributeform with the currently selected row..

Supported API: false.


createUI

protected void createUI()
                 throws WTPropertyVetoException
This adds and removes fields based on the mode

Supported API: true.

Throws:
WTPropertyVetoException

removeEditButtons

protected void removeEditButtons()
This removes the buttons that are associated with the edit mode

Supported API: true.


addEditButtons

protected void addEditButtons()
This adds the buttons that are associated with the edit mode

Supported API: true.


createEditButtons

protected void createEditButtons()
This creates the buttons used in edit mode

Supported API: true.


resetHashtables

protected void resetHashtables()
This resets the hashtables

Supported API: true.


updateLinks

protected void updateLinks()
                    throws WTIntrospectionException,
                           WTException
This updates the links with the results of the user's actions

Supported API: true.

Throws:
WTIntrospectionException
WTException

getTopLevelParent

Frame getTopLevelParent(Component component)
This method gets the top level parent of the Component passed in and returns it if it is a Frame. If not, it returns null.

Returns:
The top level Frame

resetLabels

protected void resetLabels()
                    throws PropertyVetoException
This resets the column headers with the context of the labels property and the multiListLinkAttributes property.

Supported API: true.

Throws:
PropertyVetoException

defaultColumnWidths

protected void defaultColumnWidths()
                            throws PropertyVetoException
This initialized the column widths of the multilist to equal widths with a hidden last column.

Supported API: true.

Throws:
PropertyVetoException

populate

protected void populate()
This retrieves the links on the object and displays them in the multilist.

Supported API: true.


addToTable

protected void addToTable(BinaryLink link)
                   throws InvalidRoleException,
                          WTException,
                          InvocationTargetException,
                          IllegalAccessException,
                          NoSuchMethodException
this adds a new object to the table

Supported API: true.

Throws:
InvalidRoleException
WTException
InvocationTargetException
IllegalAccessException
NoSuchMethodException

updateTableLinkValues

protected void updateTableLinkValues(int row,
                                     BinaryLink link)
                              throws InvalidRoleException,
                                     WTException,
                                     InvocationTargetException,
                                     IllegalAccessException,
                                     NoSuchMethodException
Update the string values displayed in the MultiList.

Supported API: true.

Throws:
InvalidRoleException
WTException
InvocationTargetException
IllegalAccessException
NoSuchMethodException

addSelectedObject

protected void addSelectedObject(Persistable added_object)
                          throws WTIntrospectionException,
                                 IllegalAccessException,
                                 NoSuchMethodException,
                                 InstantiationException,
                                 ClassNotFoundException,
                                 InvocationTargetException,
                                 WTException
This creates a new link to an object selected by the user and adds it to the multilist.

Supported API: true.

Throws:
WTIntrospectionException
IllegalAccessException
NoSuchMethodException
InstantiationException
ClassNotFoundException
InvocationTargetException
WTException

removeSelectedObject

protected void removeSelectedObject(BinaryLink link)
                             throws WTException,
                                    InvalidRoleException
this removes the link that the user has selected from the links hashtable and adds it to the removedLinks hashtable if it is persistent so that it can be removed from the db.

Supported API: true.

Throws:
WTException
InvalidRoleException

launchQueryDialog

protected void launchQueryDialog()
                          throws WTException
This launches a dialog that will allow the user to select an object and add it to the multilist, create a new link to it, and edit the link.

Supported API: true.

Throws:
WTException

launchChooserDialog

protected void launchChooserDialog()
                            throws WTException
This launches a dialog that will allow the user to select an object and add it to the multilist, create a new link to it, and edit the link.

Supported API: true.

Throws:
WTException

addObject

protected void addObject()
This is called when the user clicks the Add button. It launches a dialog for the user to select and object to add.


viewButton_ActionPerformed

void viewButton_ActionPerformed(ActionEvent event)

addButton_ActionPerformed

void addButton_ActionPerformed(ActionEvent event)

removeButton_ActionPerformed

void removeButton_ActionPerformed(ActionEvent event)

addItemListener

public void addItemListener(ItemListener l)
Specified by:
addItemListener in interface ItemSelectable

removeItemListener

public void removeItemListener(ItemListener l)
Specified by:
removeItemListener in interface ItemSelectable

getSelectedObjects

public Object[] getSelectedObjects()
This returns the objects that the user has currently selected in the multilist. If no objects are selected, null is returned. This returns the other-side Persistable object, not the link.

Supported API: true.

Specified by:
getSelectedObjects in interface ItemSelectable

getSelectedObject

public Persistable getSelectedObject()
                              throws InvalidRoleException,
                                     WTException
This returns the object that the user has currently selected in the multilist.

Supported API: true.

Throws:
InvalidRoleException
WTException

getSelectedLink

public BinaryLink getSelectedLink()
This returns the link represented by the row that the user has selected in the multilist.

Supported API: true.


viewSelectedObject

protected void viewSelectedObject()
This will use the TaskDelegate for the selected object to launch a view of that object.

Supported API: true.


multiList_componentResized

void multiList_componentResized(ComponentEvent event)

multiList_itemStateChanged

void multiList_itemStateChanged(ItemEvent event)

notifyItemListeners

protected void notifyItemListeners(ItemEvent event)

displayException

protected void displayException(Exception e)
This displays an exception to the user and prints the stack trace for it.


initResources

private void initResources()
Initializes resource bundles used by this class.


display

private String display(String key,
                       Object[] params)
Returns the localized string to be displayed to the user given a key.

Parameters:
key - The string that represents the key in the ChangeMgmtRB.
Returns:
A string to be displayed to the user.

initializeHelp

void initializeHelp()

initHelpSystem

private void initHelpSystem()

getHelpContext

public HelpContext getHelpContext()
This returns the helpContext being used for online help.

Supported API: true.


getHelpSystem

public HelpSystem getHelpSystem()
This returns the helpSystem being used for online help.

Supported API: true.


addHelpListener

public void addHelpListener(PropertyChangeListener pcl)
Method addHelpListener adds the given listener to be notified of PropertyChangeEvents in the help system. Tool description PropertyChangeEvents are generated when the user mouses over the buttons and list of ContentItems in this panel. The given listener will be notified of those events.

Supported API: true.

Parameters:
pcl - The PropertyChangeListener to be notified of PropertyChangeEvents generated by the help system.
See Also:
removeHelpListener(java.beans.PropertyChangeListener), HelpSystem, HelpContext, PropertyChangeListener

removeHelpListener

public void removeHelpListener(PropertyChangeListener pcl)
Method removeHelpListener removes a listener which was being notified of PropertyChangeEvents in the help system. If the given listener is not currently a listener, no changes are made.

Supported API: true.

Parameters:
pcl - the PropertyChangeListener to be removed as a listener of events generated by the help system of this panel.
See Also:
addHelpListener(java.beans.PropertyChangeListener), PropertyChangeListener

setEnabled

public void setEnabled(boolean b)
This sets the panel and it's components to enabled or disabled based on the passed in boolean.

Supported API: true.


setFieldState

protected void setFieldState(boolean b,
                             Container container)
This sets the fields to either editable or enabled depending on the boolean and the type of component. It recurses through all of the fields in the passed container.

Supported API: true.


getContext

private WTContext getContext()
Retrieves the WTContext associated with this dialog. If the parentApplet has been set, the parentApplet is used to retrieve the appropriate context.

Returns:
the WTContext associate with this dialog
See Also:
#setParentApplet, WTContext

setContext

private void setContext(boolean context_on)

multiList_actionPerformed

void multiList_actionPerformed(ActionEvent event)

requestFocus

public void requestFocus()
Calling requestFocus() on this panel will set the focus to the first field in the panel which is the multilist.

Supported API: true.


attributesForm1_propertyChange

void attributesForm1_propertyChange(PropertyChangeEvent event)

getSelectedRow

protected int getSelectedRow()

debug

private void debug(String message)

addToUpdatedTable

private void addToUpdatedTable(BinaryLink aLink)

getLinkInTable

private Object getLinkInTable(BinaryLink aLink,
                              Hashtable theTable)