Class SwingDocumentLoadHandler

java.lang.Object
lu.kbra.modelizer_next.document.SwingDocumentLoadHandler
All Implemented Interfaces:
DocumentLoadHandler

public final class SwingDocumentLoadHandler extends Object implements DocumentLoadHandler
Document load handler that reports failures through Swing UI components.
  • Constructor Details

    • SwingDocumentLoadHandler

      public SwingDocumentLoadHandler(Component parent)
      Creates a Swing document load handler instance.
      Parameters:
      parent - parent component used for dialog ownership
  • Method Details

    • confirmLegacyImport

      public boolean confirmLegacyImport(File file)
      Confirms whether the legacy import should continue.
      Specified by:
      confirmLegacyImport in interface DocumentLoadHandler
      Parameters:
      file - file to read or write
      Returns:
      true when the condition is met; otherwise false
    • confirmNewerVersion

      public boolean confirmNewerVersion(String fileVersion, String appVersion)
      Confirms whether the newer version should continue.
      Specified by:
      confirmNewerVersion in interface DocumentLoadHandler
      Parameters:
      fileVersion - text value for file version
      appVersion - text value for application version
      Returns:
      true when the condition is met; otherwise false
    • error

      public void error(String message, Exception ex)
      Reports the error.
      Specified by:
      error in interface DocumentLoadHandler
      Parameters:
      message - message shown to the caller or user
      ex - exception that caused the failure