SilverStream
Application Server 3.5

com.sssw.rt.form
Class PvBaseContainer

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JPanel
                         |
                         +--com.sssw.rt.atlas.AtPanel
                               |
                               +--com.sssw.rt.form.PvBasePanel
                                     |
                                     +--com.sssw.rt.form.PvBaseContainer
All Implemented Interfaces:
Accessible, AgiControl, AgiHelpInfo, AgiTabstopHandler, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
AgcTabControl, AgfForm

public class PvBaseContainer
extends PvBasePanel
implements AgiTabstopHandler

Internal SilverStream class. It is the base class for container controls such as AgfForm and AgcTabControl.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class com.sssw.rt.atlas.AtPanel
BGIMAGE_DRAW_CENTERED, BGIMAGE_DRAW_NORMAL, BGIMAGE_DRAW_STRETCH, BGIMAGE_DRAW_TILED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
PvBaseContainer()
           
 
Method Summary
 void acceptValues()
          For each control on the form, instructs the control to accept its current value.
 void addControl(Component child)
          Deprecated. use Container.add(Component)
 void addControlAt(Component child, int zpos)
          Deprecated. use Container.add(Component, int)
 Component getControl(int index)
          Deprecated. use Container.getComponent(int)
 int getControlCount()
          Deprecated. use Container.getComponentCount()
protected  Component[] getUserDefinedTabOrder()
          Gets the tab order of controls on the form or other container.
 void removeControl(Component child)
          Deprecated. use Container.remove(Component)
 void setTabOrder(Component[] taborder)
          Deprecated. as of SilverStream 3.0. Use PvBaseContainer.setUserDefinedTabOrder(Component[]).
 void setUserDefinedTabOrder(Component[] taborder)
          Specifies the tab order of the controls in the container.
 
Methods inherited from class com.sssw.rt.form.PvBasePanel
getBackgroundColor, getFontIdentifier, setBackgroundColor, setFontIdentifier
 
Methods inherited from class com.sssw.rt.atlas.AtPanel
addImpl, addNotify, clientPaint, clientPaint, deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, drawTiledImage, enableAtCommands, getBackgroundImage, getBackgroundImageMode, getHelper, getTransparent, hide, hideToolTip, imageUpdate, isFocusTraversable, isOptimizedDrawingEnabled, ownedImage, paintBorder, paintComponent, paintImmediately, paintImmediately, paintNow, preprocessKeyEvent, processEvent, reshape, setBackgroundImage, setBackgroundImageMode, setTransparent, show, showToolTip
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isOpaque, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiControl
getComponent, getHelpInfo, setHelpInfo
 
Methods implemented from interface com.sssw.rt.util.AgiTabstopHandler
getTabOrder
 

Constructor Detail

PvBaseContainer

public PvBaseContainer()
Method Detail

addControl

public void addControl(Component child)
Deprecated. use Container.add(Component)

Adds a named SilverStream control to a form.
Specified by:
addControl in interface com.sssw.rt.form.AgiControlContainer
Parameters:
child - the name of the control to add. The control must already be defined.
Example:

The following example illustrates how to add a control to the top left corner of a form.

  ControlName1.setBounds(0,0,100,10);
  FormName.addControl(ControlName1);
 
See Also:
PvBaseContainer.removeControl(Component), PvBaseContainer.addControlAt(Component, int)

addControlAt

public void addControlAt(Component child,
                         int zpos)
Deprecated. use Container.add(Component, int)

Adds a named control to a form or subForm.
Specified by:
addControlAt in interface com.sssw.rt.form.AgiControlContainer
Parameters:
child - the control to add. The control must already be defined.
zpos - specifies the control's back-to-front stacking order on the form The stacking order is in relation to the other controls on the form.
Usage:

SilverStream keeps a list of the controls that are added to the form. The order of the controls in this list define the control's back-to-front stacking order. If a z position is not specified when a control is added, the control gets added to the end of the list. The list is ordered so that the control at the end of the list is the control at the top of the stacking order.

Example:

The following code fragment illustrates how to add the MyLabel control in front of the first five controls.

  MyLabel.setBounds(50,50,100,10);
  addControlAt(MyLabel,5);
 
See Also:
PvBaseContainer.addControl(Component), AgiControl

removeControl

public void removeControl(Component child)
Deprecated. use Container.remove(Component)

Removes the specified control from the form.
Specified by:
removeControl in interface com.sssw.rt.form.AgiControlContainer
Parameters:
child - the control to remove
Usage:

The Tab Panel control is zero-based so the first pane is 0. Reference the control using its name (specified by the Name property).

Example:

The following code fragment illustrates how to use the removeControl() method.

  AgiControl control;
  control = ControlName1.getControl(3);
  ControlName1.removeControl(AgiControl);
 
See Also:
PvBaseContainer.addControl(Component), PvBaseContainer.addControlAt(Component, int), AgiControl

getControlCount

public int getControlCount()
Deprecated. use Container.getComponentCount()

Returns the number of controls contained on a form control.
Specified by:
getControlCount in interface com.sssw.rt.form.AgiControlContainer
Example:
  int numberOfControls;
  numberOfControls = ControlName1.getControlCount();
 

getControl

public Component getControl(int index)
Deprecated. use Container.getComponent(int)

Returns an AgiControl object that is contained by the form.
Specified by:
getControl in interface com.sssw.rt.form.AgiControlContainer
Parameters:
index - the index of the control to remove
Usage:

Determine a control's index by enumerating the controls on a form.

Example:

The following code fragment illustrates how to enumerate the controls to determine the index.

  // Get all controls from the current form.
  int controlCount;
 

acceptValues

public void acceptValues()
For each control on the form, instructs the control to accept its current value. Calling this method is necessary when a user action triggers an update but another control still has focus.
Specified by:
acceptValues in interface com.sssw.rt.event.AgiBindable
Usage:
Controls generally accept and validate their input when they lose focus. However, some user actions such as selecting from a menu can occur without removing focus from the previously active control. Selecting a menu item does not cause focus to leave the control currently being edited, so the control doesn't get a chance to go through its own validation.

Use acceptValues() to ensure the data updated in the database is the current value in all controls. In code that handles a menu event, call acceptValues() before calling:

  • updateRows() for any AgcData control other than the form's default agData instance variable
  • updateTransactionally() for AgcData controls and the agData instance variable
  • validateAll(), which manually begins the global validation process

You don't need to call acceptValues() before agData.updateRows(), because updateRows() calls acceptValues() internally.

Example:
In a menuItemSelected event, this code triggers the control that has focus to accept its current value. Then the code updates data in the AgcData control called dataCompanies.
 acceptValues();
 dataCompanies.updateRows();
 

In a menuItemSelected event, this code calls updateRows() for the default agData instance variable. Calling acceptValues() is not necessary.

 agData.updateRows();
 
See Also:
AgiRowSetManager.updateRows(), AgoBindingManager.validateAll(), AgcDataPrimary.updateTransactionally(AgcData[])

getUserDefinedTabOrder

protected Component[] getUserDefinedTabOrder()
Gets the tab order of controls on the form or other container.
Returns:
an array of Components that are the controls in this container. Their order in the array is their tab order on the form.
See Also:
PvBaseContainer.setUserDefinedTabOrder(Component[])

setUserDefinedTabOrder

public void setUserDefinedTabOrder(Component[] taborder)
Specifies the tab order of the controls in the container.
Parameters:
taborder[] - an array of Components, which are the controls in this container, in the desired tab order.
Usage:
The tab order is the order in which the controls receive focus when the user presses the Tab key.
Example:

The following code fragment illustrates how to use the setTabOrder() method.

  Component[] taborder = { TextField1, OKButton, CancelButton };
  ControlName1.setUserDefinedTabOrder(taborder);
 
See Also:
PvBaseContainer.getUserDefinedTabOrder()

setTabOrder

public void setTabOrder(Component[] taborder)
Deprecated. as of SilverStream 3.0. Use PvBaseContainer.setUserDefinedTabOrder(Component[]).

Parameters:
taborder[] - an array of Components in tab order

SilverStream
Application Server 3.5