Package org.purl.sword.client
Class PostDialog
java.lang.Object
org.purl.sword.client.PostDialog
- All Implemented Interfaces:
ActionListener
,EventListener
,ChangeListener
Dialog for users to enter details of post destinations.
- Author:
- Neil Taylor
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
label for the add command.protected static final String
label for the browse command.protected static final String
label for the clear command.protected static final String
label for the delete command.protected static final String
label for the edit command. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Handle the button click to select a file to upload.void
addDepositUrls
(String[] deposits) Add a list of deposit URLs.void
Add a list of file names.void
addFileTypes
(String[] types) Add a list of file types.void
addFormatNamespaces
(String[] namespaces) Add the list of formatNamespace strings.void
addOnBehalfOf
(String[] users) Add a list of onBehalfOf names.void
addUserIds
(String[] users) Add a list of user ids.boolean
Determine if the MD5 hash should be corrupted.boolean
Determine if the POST request should be corrupted.protected final JPanel
Create the controls for the main panel.protected JPanel
Create the destinations panel.Get the list of Post Destinations.getFile()
Get the file details.Get the filetype value.Get the format namespace value.Get the onBehalfOf value.Get the post location.void
setDepositLocation
(String location) Set the deposit location.int
show()
Show the dialog with ok and cancel options.showDestinationDialog
(PostDestination destination) Show the destination dialog.void
stateChanged
(ChangeEvent evt) Detect a state change event for the checkbox.boolean
useMd5()
Determine if the MD5 checkbox is selected.boolean
useNoOp()
Determine if the noOp checkbox is selected.boolean
Determine if the verbose checkbox is selected.
-
Field Details
-
BROWSE
label for the browse command.- See Also:
-
ADD
label for the add command.- See Also:
-
EDIT
label for the edit command.- See Also:
-
DELETE
label for the delete command.- See Also:
-
CLEAR
label for the clear command.- See Also:
-
-
Constructor Details
-
PostDialog
- Parameters:
parentFrame
- the parent of this dialog.
-
-
Method Details
-
show
public int show()Show the dialog with ok and cancel options.- Returns:
- The return value from displaying JOptionPane. Either JOptionPane.OK_OPTION or JOptionPane.CANCEL_OPTION.
-
createControls
Create the controls for the main panel.- Returns:
- The panel.
-
createDestinationsPanel
Create the destinations panel. This contains a list and four buttons to operate on values in the list.- Returns:
- The panel containing the controls.
-
actionPerformed
Handle the button click to select a file to upload.- Specified by:
actionPerformed
in interfaceActionListener
-
showDestinationDialog
Show the destination dialog. This is used to enter the URL, username, password and onBehalfOf name for a destination.- Parameters:
destination
- The post destination. If this is not null, the values in the object are used to set the current values in the dialog controls.- Returns:
- The post destination value.
-
getDestinations
Get the list of Post Destinations.- Returns:
- The destinations.
-
getFile
Get the file details.- Returns:
- The value.
-
getFileType
Get the filetype value.- Returns:
- The value.
-
getOnBehalfOf
Get the onBehalfOf value.- Returns:
- The value.
-
getFormatNamespace
Get the format namespace value.- Returns:
- The value.
-
useMd5
public boolean useMd5()Determine if the MD5 checkbox is selected.- Returns:
- True if the MD5 checkbox is selected.
-
useNoOp
public boolean useNoOp()Determine if the noOp checkbox is selected.- Returns:
- True if the checkbox is selected.
-
useVerbose
public boolean useVerbose()Determine if the verbose checkbox is selected.- Returns:
- True if the checkbox is selected.
-
getPostLocation
Get the post location.- Returns:
- The post location.
-
corruptMD5
public boolean corruptMD5()Determine if the MD5 hash should be corrupted.- Returns:
- True if the corrupt MD5 checkbox is selected. The MD5 checkbox must also be selected.
-
corruptRequest
public boolean corruptRequest()Determine if the POST request should be corrupted.- Returns:
- True if the corrupt request checkbox is selected.
-
stateChanged
Detect a state change event for the checkbox.- Specified by:
stateChanged
in interfaceChangeListener
- Parameters:
evt
- The event.
-
addUserIds
Add a list of user ids.- Parameters:
users
- The user ids.
-
addDepositUrls
Add a list of deposit URLs.- Parameters:
deposits
- The URLs.
-
addOnBehalfOf
Add a list of onBehalfOf names.- Parameters:
users
- The names.
-
addFormatNamespaces
Add the list of formatNamespace strings.- Parameters:
namespaces
- list of strings.
-
addFileTypes
Add a list of file types.- Parameters:
types
- The file types.
-
addFiles
Add a list of file names.- Parameters:
files
- The list of files.
-
setDepositLocation
Set the deposit location.- Parameters:
location
- The location.
-