wt.clients.beans
Class FolderPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bywt.clients.beans.FolderPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class FolderPanel
extends Panel

Javabean Panel which provides support for choosing and/or viewing a location in the Windchill cabinet-folder hierarchy.

Supported API:true

Extendable:true

See Also:
Serialized Form

Nested Class Summary
(package private)  class FolderPanel.SymAction
           
(package private)  class FolderPanel.SymKey
           
 
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  boolean addUpdateableUI
          Used to determine if updateable fields need to be added.
(package private)  Button browseButton
           
protected  Cabinet[] cabinets
          The set of cabinets from which a user can choose a folder
private  symantec.itools.beans.PropertyChangeSupport changes
          Vector of listeners to PropertyChangeEvents
private  ThreadGroup contextThreadGroup
          The thread group in which this panel was constructed.
private static boolean DEBUG
           
protected  Folder folder
          The folder being displayed by this panel.
protected  FolderEntry foldered
          The foldered object whose parent folder is to be displayed by this panel.
protected  HelpContext helpContext
          Help Context used for displaying help messages and online help
protected  HelpSystem helpSystem
          Help System used for displaying help messages and online help
protected  boolean inPersonalCabinet
          Boolean value indicating whether or not the user is restricted to choosing only folders that are contained in his/her personal cabinet
private  boolean layoutInitialized
          Used to control layouts when visually manipulating this bean.
(package private)  Label locationLabel
           
protected  String locationLabelString
          String label associated with the location field
(package private)  TextField locationTextField
           
protected  Label locationValueLabel
          The label which is used to display the value of the location when this panel is in view-only mode
protected static String NO_PERMISSION
          Defined constant used to represent that no permission has been selected.
protected static String ONLINE_HELP
          Defined Constant used to specify which browser window to launch online help in.
protected  String permission
          String permission which is used in determining which folders a user may choose from.
protected  boolean required
          Boolean value indicating whether or not the location of this panel is considered to be required
protected static ResourceBundle resources
          ResourceBundle containing values used to localize this panel
protected static String RESOURCES
          Fully-qualified string name of the resource bundle containing the localized text and values for this panel
private static String versionID
           
protected  boolean viewOnly
          Boolean value indicating whether or not this panel is in view-only mode or supports user interaction
 
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
FolderPanel()
          Default constructor for this panel.
 
Method Summary
 void addHelpListener(PropertyChangeListener pcl)
          Method addHelpListener adds the given listener to be notified of PropertyChangeEvents in the help system.
protected  void addLabel()
          Adds the label which is used for displaying the value of the folder location when this panel is in view-only mode.
 void addLocationLabel()
          Convenience method for adding the label associated with the location field.
protected  void addUpdateableFields()
          Adds the textfield and browse button used when this panel is in editable mode (not view-only).
 Foldered assignFolder()
          Assigns the initial location of the given foldered object to the folder set in this panel.
(package private)  void browseButton_ActionPerformed(ActionEvent event)
          Event callback invoked in response to pressing the browse button
(package private)  void browseButton_KeyPressed(KeyEvent event)
          Event callback invoked in response to the user hitting a key when the browse button is in focus.
private static String capitalize(String string)
          Returns the given string with the first letter of the given string in Upper case.
 FolderEntry changeFolders()
          Changes the current location of the given foldered object to the folder set in this panel.
private  boolean checkPermissions(Folder folder)
          Determines if the current user has the correct permissions on the given folder.
private  void displayLocation(String location)
          Displays the given String as the location.
private  String getCabinetNames()
          Returns a String comma-separated list of the names of the cabinets specified by invoking setCabinets.
 Cabinet[] getCabinets()
          Returns the set of cabinets from which a folder can be chosen.
protected  WTContext getContext()
          Returns the WTContext associated with this panel.
 Folder getFolder()
          Returns the folder displayed in this panel.
 FolderEntry getFolderedObject()
          Returns the foldered object whose parent folder is displayed by this panel.
 String getFolderPath()
          Returns the String path of the folder displayed in this panel.
 HelpContext getHelpContext()
          Return the HelpContext being used to provide online help and help messages for this panel.
 HelpSystem getHelpSystem()
          Return the HelpSystem being used to provide online help and help messages for this panel.
 String getLocationLabel()
          Returns the String label currently associated with the location field of this panel.
 Dimension getMinimumSize()
          Overload the getMinimumSize method to return an appropriate Dimension.
 String getPermission()
          Returns the string permission which is being used to restrict the set of folders from which a user can choose.
 Dimension getPreferredSize()
          Overload the getPreferredSize method to return an appropriate Dimension.
private  boolean inCabinets(Folder folder)
          Determines if the given Folder is a member of one of the cabinets set for this FolderPanel.
protected  void initializeHelpContext()
          Initialize the help context for displaying help messages.
private  void initializeHelpSystem()
          Initialize the help system for displaying help messages.
private  void initResources()
          Initialize the ResourceBundle used for localizing this panel.
private static boolean inPersonalCabinet(Folder folder)
          Determines if the given folder is in the current user's personal cabinet.
 boolean isInPersonalCabinet()
          If true, then this panel will allow the user to choose only folders which are in his/her personal cabinet.
 boolean isRequired()
          Returns a boolean value indicating whether or not the location of this panel is considered to be required.
 boolean isViewOnly()
          If true, this panel supports viewing only and no manipulation.
private  void localize()
          Update this panel to take all text and localizable values from the ResourceBundle for this panel.
(package private)  void locationTextField_KeyTyped(KeyEvent event)
          Event callback invoked in response to a key typed in the location TextField.
static void main(String[] args)
          main method used for testing this bean.
protected  void processBrowseAction()
          Invoked to respond to events on the browse button.
 void removeHelpListener(PropertyChangeListener pcl)
          Method removeHelpListener removes a listener which was being notified of PropertyChangeEvents in the help system.
 void removeLocationLabel()
          Convenience method for removing the label associated with the location field.
 void setCabinets(Cabinet[] cabinets)
          Sets the set of cabinets for which the folder displayed by this panel must reside in.
 void setEnabled(boolean enable)
           
 void setFolder(Folder the_folder)
          Initializes the folder displayed by this panel with the given folder.
 void setFolderedObject(FolderEntry foldered)
          Sets the foldered object whose parent folder is displayed by this panel.
 void setFolderPath(String folder_path)
          Initializes the folder displayed by this panel with the folder specified by the given String folder path.
 void setInPersonalCabinet(boolean inPersonalCabinet)
          Specifies whether or not only folders in the current user's personal cabinet can be selected and displayed by this panel.
 void setLayout(LayoutManager layout)
          Override the setLayout method to properly handle setting the layout on this panel.
 void setLocationLabel(String label)
          Sets the value of the label associated with the location field of this panel.
 void setPermission(String permission)
          Sets the value of the permission which is used in determining which folders the user can select.
 void setRequired(boolean required)
          Specifies whether or not the location is considered to be a required field.
 void setViewOnly(boolean viewOnly)
          Sets whether or not this panel supports updating the location of an object or supports only viewing the location.
protected  void showMessageDialog(String message, boolean modal)
          Displays a dialog containing the given message.
protected  void updateUI()
          Updates the user interface of this panel to reflect changes in whether or not this panel is view-only.
 
Methods inherited from class java.awt.Panel
addNotify, 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, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, 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

DEBUG

private static boolean DEBUG

versionID

private static final String versionID
See Also:
Constant Field Values

locationLabel

Label locationLabel

locationTextField

TextField locationTextField

browseButton

Button browseButton

changes

private symantec.itools.beans.PropertyChangeSupport changes
Vector of listeners to PropertyChangeEvents


contextThreadGroup

private ThreadGroup contextThreadGroup
The thread group in which this panel was constructed. This thread group is used to retrieve the appropriate WTContext for this panel.


locationValueLabel

protected Label locationValueLabel
The label which is used to display the value of the location when this panel is in view-only mode


cabinets

protected Cabinet[] cabinets
The set of cabinets from which a user can choose a folder


folder

protected Folder folder
The folder being displayed by this panel. If this panel is in view-only mode, the folder is explicitly set by the calling environment. If this panel is not in view-only mode, the folder is set by user interaction


foldered

protected FolderEntry foldered
The foldered object whose parent folder is to be displayed by this panel.


viewOnly

protected boolean viewOnly
Boolean value indicating whether or not this panel is in view-only mode or supports user interaction


required

protected boolean required
Boolean value indicating whether or not the location of this panel is considered to be required


inPersonalCabinet

protected boolean inPersonalCabinet
Boolean value indicating whether or not the user is restricted to choosing only folders that are contained in his/her personal cabinet


permission

protected String permission
String permission which is used in determining which folders a user may choose from. If the permission is other than NO_PERMISSION, the user may only choose folders for which s/he has the given permission


locationLabelString

protected String locationLabelString
String label associated with the location field


layoutInitialized

private boolean layoutInitialized
Used to control layouts when visually manipulating this bean. When using this bean in Visual Cafe, Cafe will automatically generate code to set the layout of the bean.


addUpdateableUI

private boolean addUpdateableUI
Used to determine if updateable fields need to be added.


RESOURCES

protected static String RESOURCES
Fully-qualified string name of the resource bundle containing the localized text and values for this panel


resources

protected static ResourceBundle resources
ResourceBundle containing values used to localize this panel


NO_PERMISSION

protected static String NO_PERMISSION
Defined constant used to represent that no permission has been selected.


helpSystem

protected HelpSystem helpSystem
Help System used for displaying help messages and online help


helpContext

protected HelpContext helpContext
Help Context used for displaying help messages and online help


ONLINE_HELP

protected static String ONLINE_HELP
Defined Constant used to specify which browser window to launch online help in.

Constructor Detail

FolderPanel

public FolderPanel()
Default constructor for this panel. By default, this panel is editable (not in view-only mode).

Method Detail

setFolderPath

public void setFolderPath(String folder_path)
                   throws NotAuthorizedException,
                          WTException
Initializes the folder displayed by this panel with the folder specified by the given String folder path.

Parameters:
folder_path - the String folder path of the folder with which this panel is initialized.
Throws:
NotAuthorizedException - if the current user does not have the set permissions on the folder specified by the folder path.
WTException - if the given folder specified by the folder path does not correspond to a valid folder or the folder specified by the folder path is not contained in one of the set cabinets.

setFolder

public void setFolder(Folder the_folder)
               throws NotAuthorizedException,
                      WTException
Initializes the folder displayed by this panel with the given folder.

Throws:
NotAuthorizedException - if the current user does not have the set permissions on the given folder
WTException - if the given folder does not correspond to a valid folder or the folder is not contained in one of the set cabinets.

getFolder

public Folder getFolder()
                 throws NotAuthorizedException,
                        WTException
Returns the folder displayed in this panel. This method uses lazy initialization to retrieve the folder. If the user has specified the folder associated with this panel by entering a string folder path, it is not until this method is invoked that the entered folder path is validated and a folder is retrieved from it. Validation includes validating that the folder path corresponds to a valid folder, validating that the folder is in the user's personal cabinet, if this panel has been configured to only support folders in the user's personal cabinet, validating that the user has the necessary permissions on the selected folder if this panel has been configured to support certain permissions, and validation that the folder is in one of the specified cabinets if this panel has been configured to only allow selection of folders in a particular set of cabinets.

Returns:
the folder associated with this panel. If this method attempts to retrieve the folder from the folder path and results in a folder that is not valid, null will be returned.
Throws:
NotAuthorizedException - if the current user does not have the configured permission on the folder
WTException - if the folder is specified by a folder path and that path does not correspond to an existing folder; if the folder is not in the user's personal cabinet; if the folder is not in the set of cabinets specified by invoking setCabinets.

setFolderedObject

public void setFolderedObject(FolderEntry foldered)
                       throws NotAuthorizedException,
                              WTException
Sets the foldered object whose parent folder is displayed by this panel. The given foldered object is also used by assignFolder, to assign the given foldered object to a specified folder.

Parameters:
foldered - the FolderEntry object whose parent folder is displayed by this panel
Throws:
NotAuthorizedException - if the current user does not have the configured permission on the parent folder of the given foldered
WTException - if the parent folder of the given foldered cannot be found; if this panel has been configured to support only folders in the user's personal cabinet and the parent folder of the given foldered is not in the user's personal cabinet; if the parent folder of the given foldered is not in the set of cabinets specified by invoking setCabinets.
See Also:
getFolderedObject(), Folder, FolderEntry

getFolderPath

public String getFolderPath()
                     throws NotAuthorizedException,
                            WTException
Returns the String path of the folder displayed in this panel. This method uses lazy initialization to retrieve the folder. If the user has specified the folder associated with this panel by entering a string folder path, it is not until this method is invoked that the entered folder path is validated and a folder is retrieved from it. Validation includes validating that the folder path corresponds to a valid folder, validating that the folder is in the user's personal cabinet, if this panel has been configured to only support folders in the user's personal cabinet, validating that the user has the necessary permissions on the selected folder if this panel has been configured to support certain permissions, and validation that the folder is in one of the specified cabinets if this panel has been configured to only allow selection of folders in a particular set of cabinets.

Returns:
the String path of the folder associated with this panel. If this method attempts to retrieve the folder from the folder path and results in a folder that is not valid, null will be returned.
Throws:
NotAuthorizedException - if the current user does not have the configured permission on the folder
WTException - if the folder is specified by a folder path and that path does not correspond to an existing folder; if the folder is not in the user's personal cabinet; if the folder is not in the set of cabinets specified by invoking setCabinets.

getFolderedObject

public FolderEntry getFolderedObject()
Returns the foldered object whose parent folder is displayed by this panel.

Returns:
the foldered object whose parent folder is displayed by this panel.
See Also:
setFolderedObject(wt.folder.FolderEntry)

setCabinets

public void setCabinets(Cabinet[] cabinets)
Sets the set of cabinets for which the folder displayed by this panel must reside in. Initializing this panel to support a set of cabinets will restrict the user to selecting a folder which resides in a cabinet in the given set of cabinets. It is not neccessary to use this method to restrict this panel to supporting only the user's personal cabinet. To restrict to the user's personal cabinet, use the setInPersonalCabinet method.

Parameters:
cabinets - the set of cabinets supported by this panel
See Also:
getCabinets(), setInPersonalCabinet(boolean), Cabinet

getCabinets

public Cabinet[] getCabinets()
Returns the set of cabinets from which a folder can be chosen.

Returns:
an array of cabinets this panel is supporting.

setViewOnly

public void setViewOnly(boolean viewOnly)
Sets whether or not this panel supports updating the location of an object or supports only viewing the location. If true, this panel will only allow viewing of a location.


isViewOnly

public boolean isViewOnly()
If true, this panel supports viewing only and no manipulation.

Returns:
a boolean value indicating whether or not this panel only supports viewing.

setInPersonalCabinet

public void setInPersonalCabinet(boolean inPersonalCabinet)
Specifies whether or not only folders in the current user's personal cabinet can be selected and displayed by this panel. If true, only those folders which are contained in the user's personal cabinet can be selected and viewed by this panel.


isInPersonalCabinet

public boolean isInPersonalCabinet()
If true, then this panel will allow the user to choose only folders which are in his/her personal cabinet.

Returns:
a boolean value indicating whether or not the user is restricted to choosing from only those folders in his/her personal cabinet

setRequired

public void setRequired(boolean required)
Specifies whether or not the location is considered to be a required field. If the given value is true, the label of this panel will be prefixed with an asterisk (*) marking the field as required.

Parameters:
required - boolean value indicating whether or not the location is considered to be required.

isRequired

public boolean isRequired()
Returns a boolean value indicating whether or not the location of this panel is considered to be required.

Returns:
if true, the location displayed in this panel is considered to be required.

setLocationLabel

public void setLocationLabel(String label)
Sets the value of the label associated with the location field of this panel.

Parameters:
label - the String label to be displayed

getLocationLabel

public String getLocationLabel()
Returns the String label currently associated with the location field of this panel.

Returns:
the String label being displayed

setPermission

public void setPermission(String permission)
Sets the value of the permission which is used in determining which folders the user can select. If a permission is specified, the user may only choose a folder for which s/he has the given permission on that folder. For example, if setPermission( wt.access.WTPermission.MODIFY ) is invoked on this panel, the user may only choose from those folders for which s/he has permissions to modify.

Parameters:
permission - the string permission which determines which folders a user can select.
See Also:
getPermission(), WTPermission

getPermission

public String getPermission()
Returns the string permission which is being used to restrict the set of folders from which a user can choose.

Returns:
the String permission
See Also:
setPermission(java.lang.String)

main

public static void main(String[] args)
main method used for testing this bean. This method allows the bean to be executed as a standalone Java application.


addLabel

protected void addLabel()
Adds the label which is used for displaying the value of the folder location when this panel is in view-only mode.


addUpdateableFields

protected void addUpdateableFields()
Adds the textfield and browse button used when this panel is in editable mode (not view-only).


updateUI

protected void updateUI()
Updates the user interface of this panel to reflect changes in whether or not this panel is view-only. If the panel is in view-only mode, the textfield and browse button are removed, and a label is added to display the value of the folder location. If this panel is editable (not in view-only mode), the label used to display the location value is removed and the textfield and browse button are added.


initResources

private void initResources()
                    throws MissingResourceException
Initialize the ResourceBundle used for localizing this panel.

Throws:
MissingResourceException - if the ResourceBundle cannot be loaded.

localize

private void localize()
Update this panel to take all text and localizable values from the ResourceBundle for this panel.


getContext

protected WTContext getContext()
Returns the WTContext associated with this panel. This method attempts to find the correct WTContext by using the threadgroup in which this panel was constructed. If no context is found, this method returns a new WTContext.

Returns:
the WTContext associated with this panel.

showMessageDialog

protected void showMessageDialog(String message,
                                 boolean modal)
Displays a dialog containing the given message. The given boolean value determines whether or not the dialog is shown as modal.

Parameters:
message - the String message to be displayed in the message dialog.
modal - if true, the dialog is displayed as modal.

getPreferredSize

public Dimension getPreferredSize()
Overload the getPreferredSize method to return an appropriate Dimension.

Returns:
the Dimension of the panel

getMinimumSize

public Dimension getMinimumSize()
Overload the getMinimumSize method to return an appropriate Dimension.

Returns:
the Dimension of the panel

assignFolder

public Foldered assignFolder()
                      throws NotAuthorizedException,
                             WTException
Assigns the initial location of the given foldered object to the folder set in this panel. The assigning of a foldered object to a folder must occur before the foldered object is stored in the database. Note that there is currently only a server-side API for assigning the folder of a wt.folder.Foldered object, but no API for assigning the folder of a wt.folder.FolderEntry object. If the current object is a FolderEntry object, this method will throw an exception.

Returns:
the foldered object updated to contain a location
Throws:
NotAuthorizedException - if the current user does not have the set permissions on the given folder
WTException - if the given folder does not correspond to a valid folder; if the folder is not contained in one of the set cabinets; if the user does not have the set permission against the selected folder; if the attempt to assign the location of the foldered object fails.

changeFolders

public FolderEntry changeFolders()
                          throws NotAuthorizedException,
                                 WTException
Changes the current location of the given foldered object to the folder set in this panel. The changing of a foldered object to a new folder must occur after the foldered object is stored in the database.

Returns:
the foldered object updated with the new location
Throws:
NotAuthorizedException - if the current user does not have the set permissions on the given folder
WTException - if the given folder does not correspond to a valid folder; if the folder is not contained in one of the set cabinets; if the user does not have the set permission against the selected folder; if the attempt to change the location of the foldered object fails.

browseButton_ActionPerformed

void browseButton_ActionPerformed(ActionEvent event)
Event callback invoked in response to pressing the browse button

Parameters:
event - the ActionEvent generated by pressing the browse button

processBrowseAction

protected void processBrowseAction()
Invoked to respond to events on the browse button. This method with launch the folder browser dialog to allow the user to browse for a folder.


browseButton_KeyPressed

void browseButton_KeyPressed(KeyEvent event)
Event callback invoked in response to the user hitting a key when the browse button is in focus. This callback tests to see if the key pressed was the Enter key.

Parameters:
event - the KeyEvent generated when the key is pressed

displayLocation

private void displayLocation(String location)
Displays the given String as the location.

Parameters:
location - the String to be displayed

capitalize

private static String capitalize(String string)
Returns the given string with the first letter of the given string in Upper case.

Returns:
the given string with its first letter converted to upper case

setLayout

public void setLayout(LayoutManager layout)
Override the setLayout method to properly handle setting the layout on this panel. When this panel is visually manipulated in Visual Cafe, Cafe will automatically generate code to set the layout of this panel. To correctly handle the setting of the layout for this panel, this method will only use the given layout if the layout of this panel has not yet been set already.

Parameters:
layout - the LayoutManager

checkPermissions

private boolean checkPermissions(Folder folder)
                          throws WTException
Determines if the current user has the correct permissions on the given folder. If a permission has been set for this FolderPanel, this method will determine whether or not the current user has that set permission on the given folder.

Parameters:
folder - the folder for which the permission of the current user is tested
Returns:
true if the current user has the set permission against the given folder
Throws:
WTException - if an error occurs checking the user's access

inPersonalCabinet

private static boolean inPersonalCabinet(Folder folder)
                                  throws WTException
Determines if the given folder is in the current user's personal cabinet.

Parameters:
folder - the folder to test if it is in the user's personal cabinet
Returns:
true if the given folder is in the user's personal cabinet
Throws:
WTException - if an error occurs testing the folder against the user's personal cabinet

inCabinets

private boolean inCabinets(Folder folder)
                    throws WTException
Determines if the given Folder is a member of one of the cabinets set for this FolderPanel.

Parameters:
folder - the Folder to check its membership in the cabinets set for this FolderPanel
Returns:
true if the given folder is in the cabinets set for this FolderPanel
Throws:
WTException - if an error occurs getting the cabinet in which the given folder is contained

getCabinetNames

private String getCabinetNames()
Returns a String comma-separated list of the names of the cabinets specified by invoking setCabinets.

Returns:
a String list of the names of the cabinets

removeLocationLabel

public void removeLocationLabel()
Convenience method for removing the label associated with the location field. This method is useful for those GUIs which want fine-grained control over label and field alignment.

See Also:
addLocationLabel()

addLocationLabel

public void addLocationLabel()
Convenience method for adding the label associated with the location field. This method should not be invoked unless removeLocationLabel has been previously invoked. This method is useful for those GUIs which want fine-grained control over label and field alignment.

See Also:
removeLocationLabel()

initializeHelpContext

protected void initializeHelpContext()
Initialize the help context for displaying help messages.

See Also:
HelpContext

initializeHelpSystem

private void initializeHelpSystem()
Initialize the help system for displaying help messages.

See Also:
HelpSystem

getHelpContext

public HelpContext getHelpContext()
Return the HelpContext being used to provide online help and help messages for this panel.

Returns:
the HelpContext associated with this panel
See Also:
HelpContext

getHelpSystem

public HelpSystem getHelpSystem()
Return the HelpSystem being used to provide online help and help messages for this panel.

Returns:
the HelpSystem associated with this panel
See Also:
HelpSystem

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.

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.

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

locationTextField_KeyTyped

void locationTextField_KeyTyped(KeyEvent event)
Event callback invoked in response to a key typed in the location TextField.

Parameters:
event - the KeyEvent generated when a key is typed in the location text field.

setEnabled

public void setEnabled(boolean enable)