WebLogic Integration


com.bea.wlxt.repository
Class RepositoryDocumentChooser

java.lang.Object
  |
  +--com.bea.wlxt.repository.RepositoryDocumentChooser

public class RepositoryDocumentChooser
extends java.lang.Object
implements java.io.Serializable, RepositoryRscNames

The RepositoryDocumentChooser class is modeled after the Swing JFileChooser class and provides Open and Save dialog boxes for the repository.

Since:
WLXT V2.0
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Field Summary
static int APPROVE_OPTION
          Returned by the showOpenDialog() and showSaveDialog() methods to indicate that the user pressed the OK button.
static int CANCEL_OPTION
          Returned by the showOpenDialog() and showSaveDialog() methods to indicate that the user pressed the Cancel button.
 
Constructor Summary
RepositoryDocumentChooser(RepositoryFolder folder)
          Creates a document chooser object with its initial folder set to the passed RepositoryFolder object.
 
Method Summary
 RepositoryDocument getDocument()
          Returns the selected document.
 RepositoryFolder getFolder()
          Returns the current folder.
 RepositoryFilter getRepositoryFilter()
          Retrieve the repository filter currently in use for this chooser.
 boolean isUpdatable()
          Returns a value indicating of the open and save dialogs are permitted to update information on the repository.
 void setApproveButtonText(java.lang.String text)
          Set the text that appears in the button used to approve the open or save dialog.
 void setCancelButtonText(java.lang.String text)
          Sets the text that will appear in the cancel button of the open and save dialogs.
 void setChoosableFileType(int fileType)
          This method adds a file type to the combo box that displays file type filters on the store as, and retrieve dialogs.
 void setChoosableFileType(java.util.Vector fileTypes)
          This method adds a group of file types to the combo box that displays file type filters on the store as, and retrieve dialogs.
 void setRepositoryFilter(RepositoryFilter filter)
          Set the repository filter used by the open and save document dialogs.
 void setTitle(java.lang.String title)
          Sets the title of the next didplayed dialog.
 void setUpdatable(boolean updatable)
          Enables or disables the ability of the open/save dialogs to perform updates on the repository.
 int showOpenDialog(java.awt.Component parent)
          Displays a modal document open dialog allowing the user to navigate the repository and select an existing document.
 int showSaveDialog(java.awt.Component parent)
          Displays a modal document open dialog allowing the user to navigate the repository and select an existing document or entering the name of a new document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPROVE_OPTION

public static final int APPROVE_OPTION
Returned by the showOpenDialog() and showSaveDialog() methods to indicate that the user pressed the OK button.

CANCEL_OPTION

public static final int CANCEL_OPTION
Returned by the showOpenDialog() and showSaveDialog() methods to indicate that the user pressed the Cancel button.
Constructor Detail

RepositoryDocumentChooser

public RepositoryDocumentChooser(RepositoryFolder folder)
Creates a document chooser object with its initial folder set to the passed RepositoryFolder object.

Parameters:
folder - The folder to be used as the current folder for the dialogs. This constructor sets the file filter to the default implementation, which provides the user with a choice of MFL files only. If you want your users to receive a file filter/combo box with other file types, set them with one of the setChoosableFileType() methods.
Method Detail

getRepositoryFilter

public RepositoryFilter getRepositoryFilter()
Retrieve the repository filter currently in use for this chooser.

Returns:
Returns the repository filter current in use or null if no filter exists.

setRepositoryFilter

public void setRepositoryFilter(RepositoryFilter filter)
Set the repository filter used by the open and save document dialogs.

Parameters:
filter - The repository filter used as a callback to select the objects that will be available in the dialog.

showOpenDialog

public int showOpenDialog(java.awt.Component parent)
                   throws RepositoryException
Displays a modal document open dialog allowing the user to navigate the repository and select an existing document.

Parameters:
parent - The parent window for the dialog. This may be passed as null if no suitable parent exists.
Returns:
Returns APPROVE_OPTION or CANCEL_OPTION.

showSaveDialog

public int showSaveDialog(java.awt.Component parent)
                   throws RepositoryException
Displays a modal document open dialog allowing the user to navigate the repository and select an existing document or entering the name of a new document.

Parameters:
parent - The parent window for the dialog. This may be passed as null if no suitable parent exists.
Returns:
Returns APPROVE_OPTION or CANCEL_OPTION.

getFolder

public RepositoryFolder getFolder()
Returns the current folder. This will be the folder passed on the constructor unless the user has used one of the dialog boxes to navigate to a new folder.

Returns:
The current folder for the chooser.

getDocument

public RepositoryDocument getDocument()
Returns the selected document.

Returns:
Returns the document selected by the user from the last active dialog box. If the user did not select a document (CANCEL_OPTION) this method will return null.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the next didplayed dialog. This method must be called prior to calling showOpenDialog() or showSaveDialog() to have effect.

Parameters:
title - The new title for the open/save dialog.

setApproveButtonText

public void setApproveButtonText(java.lang.String text)
Set the text that appears in the button used to approve the open or save dialog. By default this will be a locale specific version of 'Retrieve' for the open dialog and 'Store' for the save dialog.

Parameters:
text - The text string to appear in the approve button.

setCancelButtonText

public void setCancelButtonText(java.lang.String text)
Sets the text that will appear in the cancel button of the open and save dialogs. By default this will be a locale specific version of 'Cancel'.

Parameters:
text - The string to appear in the Cancel button.

isUpdatable

public boolean isUpdatable()
Returns a value indicating of the open and save dialogs are permitted to update information on the repository. The features affected by this are:
          Ability to delete repository objects.
          Ability to update object description and notes.
          Ability to create new repository folders.
 
By default this value is true.

Returns:
true if the open/save dialogs may be used to update the repository.

setUpdatable

public void setUpdatable(boolean updatable)
Enables or disables the ability of the open/save dialogs to perform updates on the repository. The following features are affected by this setting:
          Ability to delete repository objects.
          Ability to update object description and notes.
          Ability to create new repository folders.
 
By default this value is true.

Parameters:
updatable - If true repository updates are permitted.

setChoosableFileType

public void setChoosableFileType(int fileType)
This method adds a file type to the combo box that displays file type filters on the store as, and retrieve dialogs.

Parameters:
fileType - (int) should be an int representing a repository file type. Users should pass a static value from the Repository class, e.g. Repository.DOC_TYPE_ALL Repository.DOC_TYPE_MFL Repository.DOC_TYPE_DTD Repository.DOC_TYPE_XSD Repository.DOC_TYPE_XSLT Repository.DOC_TYPE_CLASS This method checks the value and will not add duplicates. Nor will it add a value which is not defined as a static in the Repository class.

setChoosableFileType

public void setChoosableFileType(java.util.Vector fileTypes)
This method adds a group of file types to the combo box that displays file type filters on the store as, and retrieve dialogs.

Parameters:
fileTypes - is a Vector that should contain ints representing a repository file type. Users should add static values from the Repository class, e.g., Repository.DOC_TYPE_DTD to the Vector. This method checks the value and will not add duplicates. Nor will it add a value which is not defined as a static in the Repository class. Futhermore, this method flushes the current list of choices, and adds only the choices in the fileTypes Vector.

WebLogic Integration

WebLogic Integration (WLI)