wt.clients.beans
Class EffectivityPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by wt.clients.beans.EffectivityPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class EffectivityPanel
extends Container

This bean is used to create, update, or view effectivity for an EffectivityManageable object. The following is an example of how to use the EffectivityPanel:

   effectivityPanel1 = new wt.clients.beans.EffectivityPanel();
        try {
                effectivityPanel1.setMode("Edit");
        }
        catch(java.beans.PropertyVetoException e) { }
        effectivityPanel1.setBounds(0,0,415,75);
        effectivityPanel1.setFont(new Font("Dialog", Font.PLAIN, 11));
        effectivityPanel1.setForeground(new Color(0));
        effectivityPanel1.setBackground(new Color(12632256));
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 2;
        gbc.weightx = 1.0;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.insets = new Insets(0,0,0,0);
        ((GridBagLayout)panel1.getLayout()).setConstraints(effectivityPanel1, gbc);
        panel1.add(effectivityPanel1);

         effectivityPanel1.addHelpListener(helpListener);
         effectivityPanel1.setObject(em);
         if (effectivityPanel1.isDirty()) {
            effectivityPanel1.save();
         }
  


Supported API: true.

Extendable: true.

See Also:
Serialized Form

Nested Class Summary
 class EffectivityPanel.ConfigItemListener
          This class listens for the user to select a ConfigurationItem and adds it to the configItemTextField.
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
EffectivityPanel()
          This constructs an EffectivityPanel with the default mode of view.
 
Method Summary
 void addHelpListener(PropertyChangeListener pcl)
          Method addHelpListener adds the given listener to be notified of PropertyChangeEvents in the help system.
protected  void addViewFields()
          this adds the fields for view mode and removes the fields for edit mode

Supported API: true.
 wt.effectivity.Effectivity assignValues()
          This method will set the values of the Effectivity from the user's entry.
 void clear()
          This clears the fields

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

Supported API: true.
protected  void createViewFields()
          this creates the fields for view mode

Supported API: true.
protected  void displayException(Exception e)
          This displays an exception to the user and prints out a stack trace.
 Color getBackground()
          This will get the background color of this panel

Supported API: true.
 wt.effectivity.Effectivity getEffectivity()
          This method returns the Effectivity currently assigned to the EffectivityManageable object.
 Font getFont()
          This will get the font color of this panel

Supported API: true.
 Color getForeground()
          This will get the foreground color of this panel

Supported API: true.
 HelpContext getHelpContext()
          This is a public accessor for the current HelpContext and can be used to stop the help for the bean when the client is closed.
 HelpSystem getHelpSystem()
          This is a public accessor for the current HelpSystem

Supported API: true.
 Dimension getMinimumSize()
          This overrides the minimum size for the bean.
 Dimension getMinimumSize(int rows, int cols)
          This overrides the minimum size for the bean.
 String getMode()
          This is the public accessor for the current mode of the bean.
 wt.effectivity.EffectivityManageable getObject()
          This is the public getter for the EffectivityManageable object for which the Effectivity is being edited or viewed.
 wt.effectivity.Effectivity getOldEffectivity()
          This is the public getter for the Effectivity that is deleted.
 Dimension getPreferredSize()
          This overrides the preferred size for the bean.
 Dimension getPreferredSize(int rows, int cols)
          This overrides the preferred size for the bean.
 boolean isDirty()
          Call this method to determine if the user has changed any of the fields on the bean.
protected  void localize()
          This sets the display text of the fields to the localized string from the resource bundle.
 void removeHelpListener(PropertyChangeListener pcl)
          Method removeHelpListener removes a listener which was being notified of PropertyChangeEvents in the help system.
protected  void removeViewFields()
          this removes the fields for view mode and adds the fields for edit mode

Supported API: true.
 void requestFocus()
          Invoking requestFocus on this panel will set the focus on the appropriate field in this panel.
 void save()
          This method will update the Effectivity with the user's input and persist it.
 void save(Enumeration effectivities, Enumeration old_effectivities)
          This method takes Enumerations of effectivities and will store the new Effectivities and remove the old.
 void setBackground(Color color)
          This will set the background color of this panel

Supported API: true.
protected  void setEditValues()
          This sets the values of the fields for editing.
 void setEnabled(boolean b)
          This will set the state of each component within the bean to either enabled or disabled based on the boolean passed in.
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 will set the font color of this panel

Supported API: true.
 void setForeground(Color color)
          This will set the foreground color of this panel

Supported API: true.
 void setMode(String mode)
          This sets the mode of the bean to Edit or View and modifies the fields accordingly.
 void setObject(wt.effectivity.EffectivityManageable object)
          Use this method to set the EffectivityManageable object for which the Effectivity will be edited or viewed.
 void setObject(wt.effectivity.EffectivityManageable object, wt.effectivity.Effectivity new_effectivity)
          Use this method to assign an already created Effectivity to an EffectivityManageable.
 void setParentApplet(Applet applet)
          Set the Applet that started this panel

Supported API: true.
 void setParentFrame(Frame frame)
          Set the parent Frame that started this panel

Supported API: true.
protected  void setViewValues()
          This displays the values for the effectivity to the user

Supported API: true.
 
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, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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
 

Constructor Detail

EffectivityPanel

public EffectivityPanel()
This constructs an EffectivityPanel with the default mode of view.

Supported API: true.

Method Detail

localize

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

Supported API: true.


setMode

public void setMode(String mode)
             throws PropertyVetoException
This sets the mode of the bean to Edit or View and modifies the fields accordingly.

Supported API: true.

Throws:
PropertyVetoException

getMode

public String getMode()
This is the public accessor for the current mode of the bean.

Supported API: true.


getPreferredSize

public Dimension getPreferredSize()
This overrides the preferred size for the bean.

Supported API: true.

Overrides:
getPreferredSize in class Container

getPreferredSize

public Dimension getPreferredSize(int rows,
                                  int cols)
This overrides the preferred size for the bean.

Supported API: true.


getMinimumSize

public Dimension getMinimumSize()
This overrides the minimum size for the bean.

Supported API: true.

Overrides:
getMinimumSize in class Container

getMinimumSize

public Dimension getMinimumSize(int rows,
                                int cols)
This overrides the minimum size for the bean.

Supported API: true.


setForeground

public void setForeground(Color color)
This will set the foreground color of this panel

Supported API: true.

Overrides:
setForeground in class Component

getForeground

public Color getForeground()
This will get the foreground color of this panel

Supported API: true.

Overrides:
getForeground in class Component

setBackground

public void setBackground(Color color)
This will set the background color of this panel

Supported API: true.

Overrides:
setBackground in class Component

getBackground

public Color getBackground()
This will get the background color of this panel

Supported API: true.

Overrides:
getBackground in class Component

setFont

public void setFont(Font font)
This will set the font color of this panel

Supported API: true.

Overrides:
setFont in class Container

getFont

public Font getFont()
This will get the font color of this panel

Supported API: true.

Specified by:
getFont in interface MenuContainer
Overrides:
getFont in class Component

setEnabled

public void setEnabled(boolean b)
This will set the state of each component within the bean to either enabled or disabled based on the boolean passed in.

Supported API: true.

Overrides:
setEnabled in class Component
Parameters:
b - - Sets all fields to enabled when true

clear

public void clear()
This clears the fields

Supported API: true.


displayException

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

Supported API: true.


getHelpContext

public HelpContext getHelpContext()
This is a public accessor for the current HelpContext and can be used to stop the help for the bean when the client is closed.

Supported API: true.


getHelpSystem

public HelpSystem getHelpSystem()
This is a public accessor for the current HelpSystem

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

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.


createUI

protected void createUI()
This adds or removes fields based on the mode

Supported API: true.


setViewValues

protected void setViewValues()
This displays the values for the effectivity to the user

Supported API: true.


setEditValues

protected void setEditValues()
This sets the values of the fields for editing.

Supported API: true.


addViewFields

protected void addViewFields()
this adds the fields for view mode and removes the fields for edit mode

Supported API: true.


removeViewFields

protected void removeViewFields()
this removes the fields for view mode and adds the fields for edit mode

Supported API: true.


createViewFields

protected void createViewFields()
this creates the fields for view mode

Supported API: true.


setObject

public void setObject(wt.effectivity.EffectivityManageable object)
               throws WTException
Use this method to set the EffectivityManageable object for which the Effectivity will be edited or viewed.

Supported API: true.

Throws:
WTException

setObject

public void setObject(wt.effectivity.EffectivityManageable object,
                      wt.effectivity.Effectivity new_effectivity)
               throws WTException
Use this method to assign an already created Effectivity to an EffectivityManageable.

Supported API: true.

Throws:
WTException

getObject

public wt.effectivity.EffectivityManageable getObject()
This is the public getter for the EffectivityManageable object for which the Effectivity is being edited or viewed.

Supported API: true.


assignValues

public wt.effectivity.Effectivity assignValues()
                                        throws WTPropertyVetoException,
                                               WTException
This method will set the values of the Effectivity from the user's entry.

Supported API: true.

Throws:
WTPropertyVetoException
WTException

save

public void save()
          throws WTPropertyVetoException,
                 WTException
This method will update the Effectivity with the user's input and persist it.

Supported API: true.

Throws:
WTPropertyVetoException
WTException

save

public void save(Enumeration effectivities,
                 Enumeration old_effectivities)
          throws WTException
This method takes Enumerations of effectivities and will store the new Effectivities and remove the old.

Supported API: true.

Throws:
WTException

isDirty

public boolean isDirty()
Call this method to determine if the user has changed any of the fields on the bean.

Supported API: true.


getEffectivity

public wt.effectivity.Effectivity getEffectivity()
This method returns the Effectivity currently assigned to the EffectivityManageable object.

Supported API: true.


getOldEffectivity

public wt.effectivity.Effectivity getOldEffectivity()
This is the public getter for the Effectivity that is deleted.

Supported API: true.


setParentApplet

public void setParentApplet(Applet applet)
Set the Applet that started this panel

Supported API: true.


setParentFrame

public void setParentFrame(Frame frame)
Set the parent Frame that started this panel

Supported API: true.


requestFocus

public void requestFocus()
Invoking requestFocus on this panel will set the focus on the appropriate field in this panel.

Supported API: true.

Overrides:
requestFocus in class Component