wt.clients.beans.lifecycle
Class ProjectPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bywt.clients.beans.lifecycle.ProjectPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
JITProjectPanel

public class ProjectPanel
extends Panel

Class ProjectPanel is a Panel which supplies the functionality to assign a project to LifeCycleManaged objects. ProjectPanel provides both create and view modes.

The create mode is comprised of an optional Project label, choicebox, and browse button for finding and selecting a Project.

The view mode displays the Project value associated with a LifeCycleManaged object.

Supported API: true

Extendable: true

See Also:
Serialized Form

Nested Class Summary
(package private)  class ProjectPanel.SymAction
          This class listens for ActionEvents of the screen Components and calls the appropriate method for the action.
(package private)  class ProjectPanel.WorkThread
           
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
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
private  LifeCycleManaged anObject
           
(package private)  Button browseButton
           
private  boolean cardLayoutInitialized
           
private static WTContainerRef context
           
private  String CREATE_CARD
           
static int CREATE_MODE
          Create Mode allows the user to assign a Project to a LifeCycleManaged object, a Project label is displayed to the left of the choice box.
(package private)  Choice createChoice
           
(package private)  Label createLabel
           
(package private)  Panel createPanel
           
private  String defaultProjectChoice
           
private static String EMPTY_STRING
           
private  boolean enabledState
           
private static String HELP_RESOURCE
           
private static String HELP_TARGET
          Defined constant String which defines the name of the browser window to launch online help in.
private  NFHelpContext helpContext
           
private  NFHelpSystem helpSystem
           
(package private) static int INIT_CHOICE_LIST
           
private  boolean initialized
           
private  boolean initReady
           
private  Hashtable initThreadHash
           
private  LayoutManager layout
           
private  ResourceBundle messagesResource
           
static int NO_LABEL_CREATE_MODE
          No Label Create Mode allows the user to assign a Project to a LifeCycleManaged object.
static int NO_LABEL_UPDATE_MODE
          No Label Update Mode displays the project associated with a LifeCycleManaged object.When using this mode the Project label is omitted from the display.
static int NO_LABEL_VIEW_MODE
          No Label View Mode displays the project associated with a LifeCycleManaged object.
private  boolean notifyDone
           
(package private) static int PROCESS_BROWSE
           
private static String PROJECT
           
private static String RESOURCE
          Defined constant used for referencing the ResourceBundle class for this LifeCyclePanel.
private static String TEAMTEMPLATE
           
private  Hashtable teamTemplates
           
protected  ThreadGroup theThreadGroup
           
static int UPDATE_MODE
          No Label Update Mode allows the user to assign a Project to a LifeCycleManaged object.
private  boolean verbose
           
private  String VIEW_CARD
           
static int VIEW_MODE
          View Mode displays the name of the Project associated with a LifeCycleManaged object.
(package private)  Label viewLabel
           
(package private)  Label viewLabelValue
           
private  int viewMode
           
(package private)  Panel viewPanel
           
 
Fields inherited from class java.awt.Panel
 
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
ProjectPanel()
          Creates a ProjectPanel.
ProjectPanel(WTContainerRef aContext)
          Creates a ProjectPanel.
 
Method Summary
 void addHelpListener(PropertyChangeListener pcl)
          Method addHelpListener adds the given listener to be notified of PropertyChangeEvents in the help system.
 void addNotify()
          Notifies this component that it has been added to a container and if a peer is required, it should be created.
protected  void addTeamTemplate(TeamTemplateReference teamTemplateRef)
          Add a team template to the choice list.
 void assign()
          Save the currently selected project in the LifeCycleManaged object previously set by setObject.
 void assign(LifeCycleManaged an_object)
          Save the currently selected project in the object.
(package private)  void browseButton_ActionPerformed(ActionEvent event)
          This method is called when the browse button has been pressed.
 void clear()
          Reset the project drop down list to the blank choice.
 void enableChoice(boolean b)
          Enables/disables Project listbox
static WTContainerRef getContext()
           
 NFHelpContext getHelpContext()
          Returns the help context.
private  NFHelpSystem getHelpSystem()
          The work thread for this Applet.
 LayoutManager getLayout(LayoutManager mgr)
          Gets the layout manager for this container.
protected  ResourceBundle getMessagesResource()
          getMessagesResource gets the ResourceBundle used for providing localized error-messages and feedback.
 int getMode()
          Return the current mode.
 TeamTemplateReference getSelectedTeamTemplate()
          Get the currently selected team template reference.
private  TeamTemplateReference getTeamTemplate(LifeCycleManaged an_object)
          Get the teamTemplate reference associated with the specified object.
private  void initChoiceList()
          Spin off a thread to initialize the choice list.
private  void initValues()
          If an object has been set, set the text for project value.
private  boolean inUpdateMode()
          Return true if in update mode, otherwise false.
 boolean isInitialized()
           
private  void localize()
          Localizes the text in this container.
static void main(String[] args)
          A main test driver.
private  void processBrowse()
          When the Browse button is pressed bring up a dialog box to allow the user to select a project location.
private  void processInitChoiceList()
          Initialize the drop down list with available project choices.
 void removeHelpListener(PropertyChangeListener pcl)
          Method removeHelpListener removes a listener which was being notified of PropertyChangeEvents in the help system.
 void removeNotify()
          Notifies this component that it has been removed from its container and if a peers exists, it destroys it.
 void setDefaultChoice(String teamTemplateString)
          Manually override initial project selected in the drop down list.
 void setEnabled(boolean b)
          Enables components used by this Panel.
(package private)  void setInitialized(boolean initialized)
           
 void setLayout(LayoutManager mgr)
          Sets the layout manager for this container.
 void setMode(int mode)
          Set the mode to either create or view.
 void setObject(LifeCycleManaged an_object)
          This method will set the object to be used when initializing the project choice list and project display value.
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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
 

Field Detail

CREATE_MODE

public static final int CREATE_MODE
Create Mode allows the user to assign a Project to a LifeCycleManaged object, a Project label is displayed to the left of the choice box.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

VIEW_MODE

public static final int VIEW_MODE
View Mode displays the name of the Project associated with a LifeCycleManaged object.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

NO_LABEL_CREATE_MODE

public static final int NO_LABEL_CREATE_MODE
No Label Create Mode allows the user to assign a Project to a LifeCycleManaged object. When using this mode the Project label is omitted from the display.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

NO_LABEL_VIEW_MODE

public static final int NO_LABEL_VIEW_MODE
No Label View Mode displays the project associated with a LifeCycleManaged object.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

UPDATE_MODE

public static final int UPDATE_MODE
No Label Update Mode allows the user to assign a Project to a LifeCycleManaged object. When using this mode the Project label is omitted from the display.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

NO_LABEL_UPDATE_MODE

public static final int NO_LABEL_UPDATE_MODE
No Label Update Mode displays the project associated with a LifeCycleManaged object.When using this mode the Project label is omitted from the display.

Supported API: true

See Also:
setMode(int), getMode(), Constant Field Values

EMPTY_STRING

private static final String EMPTY_STRING
See Also:
Constant Field Values

PROCESS_BROWSE

static final int PROCESS_BROWSE
See Also:
Constant Field Values

INIT_CHOICE_LIST

static final int INIT_CHOICE_LIST
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
Defined constant used for referencing the ResourceBundle class for this LifeCyclePanel.

See Also:
Constant Field Values

VIEW_CARD

private String VIEW_CARD

CREATE_CARD

private String CREATE_CARD

viewMode

private int viewMode

HELP_RESOURCE

private static final String HELP_RESOURCE
See Also:
Constant Field Values

helpSystem

private NFHelpSystem helpSystem

helpContext

private NFHelpContext helpContext

layout

private LayoutManager layout

PROJECT

private static final String PROJECT
See Also:
Constant Field Values

TEAMTEMPLATE

private static final String TEAMTEMPLATE
See Also:
Constant Field Values

context

private static WTContainerRef context

HELP_TARGET

private static final String HELP_TARGET
Defined constant String which defines the name of the browser window to launch online help in.

See Also:
Constant Field Values

notifyDone

private boolean notifyDone

initReady

private boolean initReady

teamTemplates

private Hashtable teamTemplates

anObject

private LifeCycleManaged anObject

cardLayoutInitialized

private boolean cardLayoutInitialized

theThreadGroup

protected ThreadGroup theThreadGroup

messagesResource

private ResourceBundle messagesResource

verbose

private boolean verbose

enabledState

private boolean enabledState

defaultProjectChoice

private String defaultProjectChoice

initialized

private boolean initialized

initThreadHash

private Hashtable initThreadHash

createPanel

Panel createPanel

createLabel

Label createLabel

createChoice

Choice createChoice

browseButton

Button browseButton

viewPanel

Panel viewPanel

viewLabel

Label viewLabel

viewLabelValue

Label viewLabelValue
Constructor Detail

ProjectPanel

public ProjectPanel()
Creates a ProjectPanel. The default mode is CREATE_MODE.

Supported API: true


ProjectPanel

public ProjectPanel(WTContainerRef aContext)
Creates a ProjectPanel. The default mode is CREATE_MODE.

Supported API: true

Parameters:
aContext - the container to use for searching team templates.
Method Detail

removeNotify

public void removeNotify()
Notifies this component that it has been removed from its container and if a peers exists, it destroys it. This method should be called by Container.remove, and not by user code directly. If a help context has been created, it will be stopped.

Supported API: false


addNotify

public void addNotify()
Notifies this component that it has been added to a container and if a peer is required, it should be created. It seems that it is necessary to perform the addNotify processing prior to initializing the choice list.

Supported API: false


localize

private void localize()
Localizes the text in this container.

Supported API: false


getMessagesResource

protected ResourceBundle getMessagesResource()
getMessagesResource gets the ResourceBundle used for providing localized error-messages and feedback.

Supported API: false

See Also:
ResourceBundle

getHelpContext

public NFHelpContext getHelpContext()
Returns the help context.

Supported API: false

Returns:
the help context.

setLayout

public void setLayout(LayoutManager mgr)
Sets the layout manager for this container.

Supported API: false


getLayout

public LayoutManager getLayout(LayoutManager mgr)
Gets the layout manager for this container.

Supported API: false


setEnabled

public void setEnabled(boolean b)
Enables components used by this Panel.

Supported API: false


addTeamTemplate

protected void addTeamTemplate(TeamTemplateReference teamTemplateRef)
                        throws Exception
Add a team template to the choice list.

Parameters:
teamTemplateRef - a reference to the teamTemplate being added.

Supported API: false
Throws:
Exception

clear

public void clear()
Reset the project drop down list to the blank choice.

Supported API: true


initValues

private void initValues()
If an object has been set, set the text for project value.


initChoiceList

private void initChoiceList()
Spin off a thread to initialize the choice list.


inUpdateMode

private boolean inUpdateMode()
Return true if in update mode, otherwise false.

Returns:
true if in update mode, otherwise false.

processInitChoiceList

private void processInitChoiceList()
Initialize the drop down list with available project choices.


getMode

public int getMode()
Return the current mode.

Supported API: true

Returns:
the current mode
See Also:
CREATE_MODE, VIEW_MODE, NO_LABEL_CREATE_MODE, UPDATE_MODE, NO_LABEL_UPDATE_MODE

setMode

public void setMode(int mode)
Set the mode to either create or view.

Supported API: true

Parameters:
mode - either create or view
See Also:
CREATE_MODE, VIEW_MODE, NO_LABEL_CREATE_MODE, UPDATE_MODE, NO_LABEL_UPDATE_MODE

getSelectedTeamTemplate

public TeamTemplateReference getSelectedTeamTemplate()
Get the currently selected team template reference.

Supported API: true

Returns:
The currently selected team template reference.

getTeamTemplate

private TeamTemplateReference getTeamTemplate(LifeCycleManaged an_object)
Get the teamTemplate reference associated with the specified object.

Parameters:
an_object - the object whose project will be returned
Returns:
the TeamTemplateReference associated with the specified object.

setObject

public void setObject(LifeCycleManaged an_object)
This method will set the object to be used when initializing the project choice list and project display value.

Supported API: true

Parameters:
an_object - The LifeCycleManaged object to obtain and set the project to/from.

assign

public void assign(LifeCycleManaged an_object)
Save the currently selected project in the object.

Supported API: true

Parameters:
an_object - The LifeCycleManaged object to set the current project value into.

assign

public void assign()
Save the currently selected project in the LifeCycleManaged object previously set by setObject.

Supported API: true

See Also:
setObject(wt.lifecycle.LifeCycleManaged)

getHelpSystem

private NFHelpSystem getHelpSystem()
The work thread for this Applet. The work thread is used to place long operations in a separate WTThread so the AWT thread isn't tied up.


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

processBrowse

private void processBrowse()
When the Browse button is pressed bring up a dialog box to allow the user to select a project location.


setInitialized

void setInitialized(boolean initialized)

isInitialized

public boolean isInitialized()

browseButton_ActionPerformed

void browseButton_ActionPerformed(ActionEvent event)
This method is called when the browse button has been pressed.


enableChoice

public void enableChoice(boolean b)
Enables/disables Project listbox


main

public static void main(String[] args)
A main test driver.

Supported API: false


setDefaultChoice

public void setDefaultChoice(String teamTemplateString)
Manually override initial project selected in the drop down list. This is not necessary when using setObject, as the default will be taken from the object.

Supported API: true


getContext

public static WTContainerRef getContext()