Package wt.clients.beans
Class EffectivityPanel
java.lang.Object
java.awt.Component
java.awt.Container
wt.clients.beans.EffectivityPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
This bean is used to create, update, or view effectivity
for an
Supported API: true.
Extendable: true.
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis class listens for the user to select aConfigurationItemand adds it to theconfigItemTextField.Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionThis constructs anEffectivityPanelwith the default mode of view. -
Method Summary
Modifier and TypeMethodDescriptionvoidMethodaddHelpListeneradds the given listener to be notified ofPropertyChangeEventsin the help system.protected voidthis adds the fields for view mode and removes the fields for edit mode
Supported API: true.voidclear()This clears the fields
Supported API: true.protected voidcreateUI()This adds or removes fields based on the mode
Supported API: true.protected voidthis creates the fields for view mode
Supported API: true.protected voidThis displays an exception to the user and prints out a stack trace.This will get the background color of this panel
Supported API: true.getFont()This will get the font color of this panel
Supported API: true.This will get the foreground color of this panel
Supported API: true.This is a public accessor for the currentHelpContextand can be used to stop the help for the bean when the client is closed.This is a public accessor for the currentHelpSystem
Supported API: true.This overrides the minimum size for the bean.getMinimumSize(int rows, int cols) This overrides the minimum size for the bean.getMode()This is the public accessor for the current mode of the bean.This overrides the preferred size for the bean.getPreferredSize(int rows, int cols) This overrides the preferred size for the bean.booleanisDirty()Call this method to determine if the user has changed any of the fields on the bean.protected voidlocalize()This sets the display text of the fields to the localized string from the resource bundle.voidMethodremoveHelpListenerremoves a listener which was being notified ofPropertyChangeEventsin the help system.protected voidthis removes the fields for view mode and adds the fields for edit mode
Supported API: true.voidInvokingrequestFocuson this panel will set the focus on the appropriate field in this panel.voidsave()This method will update theEffectivitywith the user's input and persist it.voidsave(Enumeration effectivities, Enumeration old_effectivities) This method takesEnumerationsof effectivities and will store the newEffectivitiesand remove the old.voidsetBackground(Color color) This will set the background color of this panel
Supported API: true.protected voidThis sets the values of the fields for editing.voidsetEnabled(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 voidsetFieldState(boolean b, Container container) This sets the fields to either editable or enabled depending on the boolean and the type of component.voidThis will set the font color of this panel
Supported API: true.voidsetForeground(Color color) This will set the foreground color of this panel
Supported API: true.voidThis sets the mode of the bean to Edit or View and modifies the fields accordingly.voidsetParentFrame(Frame frame) Set the parent Frame that started this panel
Supported API: true.protected voidThis 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, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, update, validate, validateTreeMethods 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, getBaseline, getBaselineResizeBehavior, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
EffectivityPanel
public EffectivityPanel()This constructs anEffectivityPanelwith 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
This sets the mode of the bean to Edit or View and modifies the fields accordingly.
Supported API: true.- Throws:
PropertyVetoException
-
getMode
This is the public accessor for the current mode of the bean.
Supported API: true. -
getPreferredSize
This overrides the preferred size for the bean.
Supported API: true.- Overrides:
getPreferredSizein classContainer
-
getPreferredSize
This overrides the preferred size for the bean.
Supported API: true. -
getMinimumSize
This overrides the minimum size for the bean.
Supported API: true.- Overrides:
getMinimumSizein classContainer
-
getMinimumSize
This overrides the minimum size for the bean.
Supported API: true. -
setForeground
This will set the foreground color of this panel
Supported API: true.- Overrides:
setForegroundin classComponent
-
getForeground
This will get the foreground color of this panel
Supported API: true.- Overrides:
getForegroundin classComponent
-
setBackground
This will set the background color of this panel
Supported API: true.- Overrides:
setBackgroundin classComponent
-
getBackground
This will get the background color of this panel
Supported API: true.- Overrides:
getBackgroundin classComponent
-
setFont
This will set the font color of this panel
Supported API: true. -
getFont
This will get the font color of this panel
Supported API: true.- Specified by:
getFontin interfaceMenuContainer- Overrides:
getFontin classComponent
-
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:
setEnabledin classComponent- Parameters:
b- - Sets all fields to enabled when true
-
clear
public void clear()This clears the fields
Supported API: true. -
displayException
This displays an exception to the user and prints out a stack trace.
Supported API: true. -
getHelpContext
This is a public accessor for the currentHelpContextand can be used to stop the help for the bean when the client is closed.
Supported API: true. -
getHelpSystem
This is a public accessor for the currentHelpSystem
Supported API: true. -
addHelpListener
MethodaddHelpListeneradds the given listener to be notified ofPropertyChangeEventsin the help system. Tool descriptionPropertyChangeEventsare generated when the user mouses over the buttons and list ofContentItemsin this panel. The given listener will be notified of those events.
Supported API: true.- Parameters:
pcl- ThePropertyChangeListenerto be notified ofPropertyChangeEventsgenerated by the help system.- See Also:
-
removeHelpListener
MethodremoveHelpListenerremoves a listener which was being notified ofPropertyChangeEventsin the help system. If the given listener is not currently a listener, no changes are made.
Supported API: true.- Parameters:
pcl- thePropertyChangeListenerto be removed as a listener of events generated by the help system of this panel.- See Also:
-
setFieldState
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
This method will update theEffectivitywith the user's input and persist it.
Supported API: true.- Throws:
WTPropertyVetoExceptionWTException
-
save
This method takesEnumerationsof effectivities and will store the newEffectivitiesand 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
Set the parent Frame that started this panel
Supported API: true. -
requestFocus
public void requestFocus()InvokingrequestFocuson this panel will set the focus on the appropriate field in this panel.
Supported API: true.- Overrides:
requestFocusin classComponent
-