Class EffectivityPanel

java.lang.Object
java.awt.Component
java.awt.Container
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:
  • Constructor Details

    • EffectivityPanel

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

      Supported API: true.
  • Method Details

    • 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

      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:
    • 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.
    • 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.
    • 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