Class SupportTicketDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class SupportTicketDialog
extends JDialog
Dialog to send a ticket to support. It appends each item from the supplier to the email and inserts a show button for the user to review the contents.
See Also:
Serialized Form
  • Constructor Details

    • SupportTicketDialog

      public SupportTicketDialog​(JPanel optionalDialog, Supplier<Map<String,​String>> descriptionSupplier, String[] tags, String supportMessagePath, com.fishlib.io.logger.Logger log)
      Create and display the support ticket dialog.
      Parameters:
      optionalDialog - An optional panel to add to the display.
      descriptionSupplier - A supplier of content for the email.
      tags - Any tags to be attached to the ZenDesk ticket.
      supportMessagePath - The support path.
      log - A logger to record things with.
      ImplNote:
      This constructor will visualize the dialog (block)
    • SupportTicketDialog

      public SupportTicketDialog​(JPanel optionalDialog, Supplier<Map<String,​String>> descriptionSupplier, Supplier<List<File>> filesToAttach, String[] tags, String supportMessagePath, com.fishlib.io.logger.Logger log)
      Create and display the support ticket dialog.
      Parameters:
      optionalDialog - An optional panel to add to the display.
      descriptionSupplier - A supplier of content for the email.
      filesToAttach - A supplier of files to be attached to the ZenDesk ticket.
      tags - Any tags to be attached to the ZenDesk ticket.
      supportMessagePath - The support path.
      log - A logger to record things with.
      ImplNote:
      This constructor will visualize the dialog (block)
  • Method Details

    • dispose

      public void dispose()
      Dispose of this dialog.
      Overrides:
      dispose in class Window
    • createTempFile

      public static File createTempFile​(String name, String content) throws IOException
      Creates a temporary file which will be when the JVM closes.
      Parameters:
      name - file name
      content - file content
      Returns:
      created file
      Throws:
      IOException - error creating file
    • finished

      public static void finished​(JDialog emailDialog, JDialog dialog, String errorMessage, String zendeskSupportMessagePath, int ticketId, boolean userNameChanged, boolean userEmailChanged, com.fishlib.io.logger.Logger log)
      Action to take once post request is processed.
      Parameters:
      emailDialog - SupportTicketDialog dialog
      dialog - progress dialog to close once called
      errorMessage - error message to display to the user, if it exists
      zendeskSupportMessagePath - optional path to a customer's support message. Displays upon success
      ticketId - ticket number in Zendesk
      userNameChanged - whether the user's username changed
      userEmailChanged - whether the user's email changed
      log - log