Class PostDialog

java.lang.Object
org.purl.sword.client.PostDialog
All Implemented Interfaces:
ActionListener, EventListener, ChangeListener

public class PostDialog extends Object implements ActionListener, ChangeListener
Dialog for users to enter details of post destinations.
Author:
Neil Taylor
  • Field Details

  • Constructor Details

    • PostDialog

      public PostDialog(JFrame parentFrame)
      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

      protected final JPanel createControls()
      Create the controls for the main panel.
      Returns:
      The panel.
    • createDestinationsPanel

      protected JPanel 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

      public void actionPerformed(ActionEvent evt)
      Handle the button click to select a file to upload.
      Specified by:
      actionPerformed in interface ActionListener
    • showDestinationDialog

      public PostDestination showDestinationDialog(PostDestination destination)
      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

      public PostDestination[] getDestinations()
      Get the list of Post Destinations.
      Returns:
      The destinations.
    • getFile

      public String getFile()
      Get the file details.
      Returns:
      The value.
    • getFileType

      public String getFileType()
      Get the filetype value.
      Returns:
      The value.
    • getOnBehalfOf

      public String getOnBehalfOf()
      Get the onBehalfOf value.
      Returns:
      The value.
    • getFormatNamespace

      public String 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

      public String 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

      public void stateChanged(ChangeEvent evt)
      Detect a state change event for the checkbox.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      evt - The event.
    • addUserIds

      public void addUserIds(String[] users)
      Add a list of user ids.
      Parameters:
      users - The user ids.
    • addDepositUrls

      public void addDepositUrls(String[] deposits)
      Add a list of deposit URLs.
      Parameters:
      deposits - The URLs.
    • addOnBehalfOf

      public void addOnBehalfOf(String[] users)
      Add a list of onBehalfOf names.
      Parameters:
      users - The names.
    • addFormatNamespaces

      public void addFormatNamespaces(String[] namespaces)
      Add the list of formatNamespace strings.
      Parameters:
      namespaces - list of strings.
    • addFileTypes

      public void addFileTypes(String[] types)
      Add a list of file types.
      Parameters:
      types - The file types.
    • addFiles

      public void addFiles(String[] files)
      Add a list of file names.
      Parameters:
      files - The list of files.
    • setDepositLocation

      public void setDepositLocation(String location)
      Set the deposit location.
      Parameters:
      location - The location.