|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
wt.clients.beans.EffectivityPanel
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.
Nested Class Summary | |
class |
EffectivityPanel.ConfigItemListener
This class listens for the user to select a ConfigurationItem and adds it to the
configItemTextField . |
(package private) class |
EffectivityPanel.SymAction
|
(package private) class |
EffectivityPanel.SymFocus
|
(package private) class |
EffectivityPanel.SymText
|
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 | |
(package private) Button |
browseButton
|
(package private) Label |
configItemField
|
(package private) Label |
configItemLabel
|
(package private) TextField |
configItemTextField
|
protected ThreadGroup |
contextGroup
|
private boolean |
dirty
|
static String |
EDIT_MODE
|
(package private) Label |
endField
|
(package private) Label |
endLabel
|
(package private) TextField |
endTextField
|
(package private) HelpContext |
helpContext
|
(package private) HelpSystem |
helpSystem
|
private String |
mode
|
private Applet |
parentApplet
|
private Frame |
parentFrame
|
private static ResourceBundle |
resource
|
private static String |
RESOURCE
|
(package private) Label |
startField
|
(package private) Label |
startLabel
|
(package private) TextField |
startTextField
|
private EffectivityTaskLogic |
taskLogic
|
(package private) Label |
typeField
|
(package private) Label |
typeLabel
|
static String |
VIEW_MODE
|
(package private) Label |
viewConfigLabel
|
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 | |
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. |
Effectivity |
assignValues()
This method will set the values of the Effectivity
from the user's entry. |
(package private) void |
browseButton_ActionPerformed(ActionEvent event)
|
void |
clear()
This clears the fields Supported API: true. |
(package private) void |
configItemTextField_EnterHit(ActionEvent event)
|
(package private) void |
configItemTextField_FocusLost(FocusEvent event)
|
(package private) void |
configItemTextField_TextValueChanged(TextEvent event)
|
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. |
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 out a stack trace. |
(package private) void |
endTextField_TextValueChanged(TextEvent event)
|
Color |
getBackground()
This will get the background color of this panel Supported API: true. |
private WTContext |
getContext()
Retrieves the WTContext associated with this dialog. |
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. |
EffectivityManageable |
getObject()
This is the public getter for the EffectivityManageable
object for which the Effectivity is being
edited or viewed. |
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. |
(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. |
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. |
protected void |
resetForNewConfigItem()
|
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. |
private void |
setContext(boolean context_on)
|
private void |
setDirty(boolean d)
|
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(EffectivityManageable object)
Use this method to set the EffectivityManageable
object for which the Effectivity will be edited
or viewed. |
void |
setObject(EffectivityManageable object,
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. |
(package private) void |
startTextField_TextValueChanged(TextEvent event)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static ResourceBundle resource
private static String RESOURCE
HelpSystem helpSystem
HelpContext helpContext
private String mode
public static String VIEW_MODE
public static String EDIT_MODE
private EffectivityTaskLogic taskLogic
private boolean dirty
protected ThreadGroup contextGroup
private Applet parentApplet
private Frame parentFrame
Label configItemLabel
TextField configItemTextField
Button browseButton
Label typeLabel
Label typeField
Label startLabel
TextField startTextField
Label endLabel
TextField endTextField
Label viewConfigLabel
Label configItemField
Label startField
Label endField
Constructor Detail |
public EffectivityPanel()
EffectivityPanel
with
the default mode of view.
Method Detail |
protected void localize()
public void setMode(String mode) throws PropertyVetoException
PropertyVetoException
public String getMode()
public Dimension getPreferredSize()
public Dimension getPreferredSize(int rows, int cols)
public Dimension getMinimumSize()
public Dimension getMinimumSize(int rows, int cols)
public void setForeground(Color color)
public Color getForeground()
public void setBackground(Color color)
public Color getBackground()
public void setFont(Font font)
public Font getFont()
public void setEnabled(boolean b)
b
- - Sets all fields to enabled when truepublic void clear()
private void initResources()
private String display(String key, Object[] params)
key
- The string that represents the key in the
BeansRB
.
protected void displayException(Exception e)
Frame getTopLevelParent(Component component)
Component
passed in and
returns it if it is a Frame
. If not, it
returns null.
Frame
void initializeHelp()
private void initHelpSystem()
public HelpContext getHelpContext()
HelpContext
and can be used to stop the help for the bean when the client
is closed.
public HelpSystem getHelpSystem()
HelpSystem
public void addHelpListener(PropertyChangeListener pcl)
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.
pcl
- The PropertyChangeListener
to be notified of
PropertyChangeEvents
generated by the help system.removeHelpListener(java.beans.PropertyChangeListener)
,
HelpSystem
,
HelpContext
,
PropertyChangeListener
public void removeHelpListener(PropertyChangeListener pcl)
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.
pcl
- the PropertyChangeListener
to be removed as a
listener of events generated by the help system of this panel.addHelpListener(java.beans.PropertyChangeListener)
,
PropertyChangeListener
protected void setFieldState(boolean b, Container container)
protected void createUI()
protected void setViewValues()
protected void setEditValues()
protected void addViewFields()
protected void removeViewFields()
protected void createViewFields()
public void setObject(EffectivityManageable object) throws WTException
EffectivityManageable
object for which the Effectivity
will be edited
or viewed.
WTException
public void setObject(EffectivityManageable object, Effectivity new_effectivity) throws WTException
Effectivity
to an EffectivityManageable
.
WTException
public EffectivityManageable getObject()
EffectivityManageable
object for which the Effectivity
is being
edited or viewed.
public Effectivity assignValues() throws WTPropertyVetoException, WTException
Effectivity
from the user's entry.
WTPropertyVetoException
WTException
public void save() throws WTPropertyVetoException, WTException
Effectivity
with
the user's input and persist it.
WTPropertyVetoException
WTException
public void save(Enumeration effectivities, Enumeration old_effectivities) throws WTException
Enumerations
of effectivities
and will store the new Effectivities
and
remove the old.
WTException
private void setDirty(boolean d)
public boolean isDirty()
void configItemTextField_TextValueChanged(TextEvent event)
void startTextField_TextValueChanged(TextEvent event)
void endTextField_TextValueChanged(TextEvent event)
public Effectivity getEffectivity()
Effectivity
currently
assigned to the EffectivityManageable
object.
public Effectivity getOldEffectivity()
Effectivity
that is deleted.
private WTContext getContext()
WTContext
associated with this dialog.
If the parentApplet
has been set, the
parentApplet
is used to retrieve the appropriate
context.
WTContext
associate with this dialogsetParentApplet(java.applet.Applet)
,
WTContext
private void setContext(boolean context_on)
public void setParentApplet(Applet applet)
public void setParentFrame(Frame frame)
void browseButton_ActionPerformed(ActionEvent event)
public void requestFocus()
requestFocus
on this panel
will set the focus on the appropriate field in this panel.
void configItemTextField_FocusLost(FocusEvent event)
void configItemTextField_EnterHit(ActionEvent event)
protected void resetForNewConfigItem()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |