Class OpenVersionedFileDialog

All Implemented Interfaces:
ActionContextProvider, GTreeSelectionListener, StatusListener, TaskListener, ActionListener, EventListener

public class OpenVersionedFileDialog extends DataTreeDialog
Dialog to open a file that is versioned and allow a version to be opened.
  • Constructor Details

    • OpenVersionedFileDialog

      public OpenVersionedFileDialog(PluginTool tool, String title, DomainFileFilter filter)
      Constructor
      Parameters:
      tool - tool where the file is being opened.
      title - title to use
      filter - filter used to control what is displayed in data tree.
  • Method Details

    • getVersionedDomainObject

      public DomainObject getVersionedDomainObject(Object consumer, boolean readOnly)
      Get the domain object for the selected version.
      Parameters:
      consumer - consumer
      readOnly - true if the domain object should be opened read only, versus immutable
      Returns:
      null if a versioned file was not selected
    • getVersion

      public int getVersion()
      Return the selected version number from the history panel.
      Returns:
      -1 if a version history was not selected
    • buildMainPanel

      protected JPanel buildMainPanel()
      Overrides:
      buildMainPanel in class DataTreeDialog
    • close

      public void close()
      Overrides:
      close in class DataTreeDialog
    • dialogShown

      protected void dialogShown()
      Description copied from class: DialogComponentProvider
      Override this method if you want to do something when the dialog is made visible
      Overrides:
      dialogShown in class DataTreeDialog
    • dialogClosed

      protected void dialogClosed()
      Description copied from class: DialogComponentProvider
      Override this method if you want to do something when the dialog is made invisible
      Overrides:
      dialogClosed in class DialogComponentProvider
    • addTreeListeners

      protected void addTreeListeners()
      Overrides:
      addTreeListeners in class DataTreeDialog
    • getActionContext

      public ActionContext getActionContext(MouseEvent event)
      Description copied from class: DialogComponentProvider
      An optional extension point for subclasses to provider action context for the actions used by this provider.
      Specified by:
      getActionContext in interface ActionContextProvider
      Overrides:
      getActionContext in class DataTreeDialog
      Parameters:
      event - The mouse event used (may be null) to generate a popup menu