|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
wt.clients.beans.FolderPanel
Javabean Panel
which provides support for choosing and/or
viewing a location in the Windchill cabinet-folder hierarchy.
Supported API:true
Extendable:true
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static boolean DEBUG
private static final String versionID
Label locationLabel
TextField locationTextField
Button browseButton
private symantec.itools.beans.PropertyChangeSupport changes
private ThreadGroup contextThreadGroup
protected Label locationValueLabel
protected Cabinet[] cabinets
protected Folder folder
protected FolderEntry foldered
protected boolean viewOnly
protected boolean required
protected boolean inPersonalCabinet
protected String permission
protected String locationLabelString
private boolean layoutInitialized
private boolean addUpdateableUI
protected static String RESOURCES
protected static ResourceBundle resources
protected static String NO_PERMISSION
protected HelpSystem helpSystem
protected HelpContext helpContext
protected static String ONLINE_HELP
Constructor Detail |
public FolderPanel()
Method Detail |
public void setFolderPath(String folder_path) throws NotAuthorizedException, WTException
String
folder path.
folder_path
- the String folder path of the folder with which this
panel is initialized.
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.public void setFolder(Folder the_folder) throws NotAuthorizedException, WTException
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.public Folder getFolder() throws NotAuthorizedException, WTException
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
.public void setFolderedObject(FolderEntry foldered) throws NotAuthorizedException, WTException
assignFolder
, to
assign the given foldered object to a specified folder.
foldered
- the FolderEntry
object whose parent folder is
displayed by this panel
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
.getFolderedObject()
,
Folder
,
FolderEntry
public String getFolderPath() throws NotAuthorizedException, WTException
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
.public FolderEntry getFolderedObject()
setFolderedObject(wt.folder.FolderEntry)
public void setCabinets(Cabinet[] cabinets)
cabinets
- the set of cabinets supported by this panelgetCabinets()
,
setInPersonalCabinet(boolean)
,
Cabinet
public Cabinet[] getCabinets()
public void setViewOnly(boolean viewOnly)
public boolean isViewOnly()
public void setInPersonalCabinet(boolean inPersonalCabinet)
public boolean isInPersonalCabinet()
public void setRequired(boolean required)
required
- boolean value indicating whether or not the location
is considered to be required.public boolean isRequired()
public void setLocationLabel(String label)
label
- the String
label to be displayedpublic String getLocationLabel()
String
label currently associated with
the location field of this panel.
public void setPermission(String permission)
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.
permission
- the string permission which determines which
folders a user can select.getPermission()
,
WTPermission
public String getPermission()
setPermission(java.lang.String)
public static void main(String[] args)
protected void addLabel()
protected void addUpdateableFields()
protected void updateUI()
private void initResources() throws MissingResourceException
ResourceBundle
used for localizing this
panel.
MissingResourceException
- if the ResourceBundle
cannot be loaded.private void localize()
protected WTContext getContext()
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.
protected void showMessageDialog(String message, boolean modal)
message
- the String
message to be displayed in
the message dialog.modal
- if true
, the dialog is displayed as modal.public Dimension getPreferredSize()
public Dimension getMinimumSize()
public Foldered assignFolder() throws NotAuthorizedException, WTException
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.public FolderEntry changeFolders() throws NotAuthorizedException, WTException
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.void browseButton_ActionPerformed(ActionEvent event)
event
- the ActionEvent generated by pressing the browse
buttonprotected void processBrowseAction()
void browseButton_KeyPressed(KeyEvent event)
event
- the KeyEvent generated when the key is
pressedprivate void displayLocation(String location)
location
- the String to be displayedprivate static String capitalize(String string)
public void setLayout(LayoutManager layout)
layout
- the LayoutManagerprivate boolean checkPermissions(Folder folder) throws WTException
folder
- the folder for which the permission of the current
user is tested
WTException
- if an error occurs checking the user's accessprivate static boolean inPersonalCabinet(Folder folder) throws WTException
folder
- the folder to test if it is in the user's personal
cabinet
WTException
- if an error occurs testing the folder against the
user's personal cabinetprivate boolean inCabinets(Folder folder) throws WTException
Folder
is a member of one of the
cabinets set for this FolderPanel.
folder
- the Folder
to check its membership in the
cabinets set for this FolderPanel
WTException
- if an error occurs getting the cabinet in which
the given folder is containedprivate String getCabinetNames()
setCabinets
.
public void removeLocationLabel()
addLocationLabel()
public void addLocationLabel()
removeLocationLabel()
protected void initializeHelpContext()
HelpContext
private void initializeHelpSystem()
HelpSystem
public HelpContext getHelpContext()
HelpContext
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
void locationTextField_KeyTyped(KeyEvent event)
event
- the KeyEvent generated when a key is typed
in the location text field.public void setEnabled(boolean enable)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |