Interface IUnsavedData

All Known Implementing Classes:
UnsavedData

public interface IUnsavedData

This interface represents some unsaved data, associated to one extension. There are methods to get the associated extension, to get info about these data, to get the type of the data and a suitable icon for this type, and a method to save the data.

It is used during the Andami termination process, to construct the dialog of unsaved data, although it can be used at any time.

Normally, it should not be directly implemented, use the convenience UnsavedData class.

Author:
Cesar Martinez Izquierdo invalid input: '<'cesar.martinez@iver.es>
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a description of this unsaved data.
    Each IUnsavedData object is associated with one extension, which is in charge of this data.
    Gets an icon suitable to represent this type of data.
    Gets the resource name of this unsaved data.
    boolean
    Save the existing changes for this resource (for example, save the layer to disk or to the database, etc).
  • Method Details

    • getResourceName

      String getResourceName()
      Gets the resource name of this unsaved data. Normally, this will be a file path, but it may be different for certain type of unsaved data (for example, database connections).
      Returns:
      The resource name of this unsaved data
    • getDescription

      String getDescription()

      Gets a description of this unsaved data. This would be combined with the resource name to show a coherent information to the user.

      Examples of descriptions:

      • Modified SHP Layer
      • Modified gvSIG project
      Returns:
      A description for this unsaved data, probably containing the type of data and the kind of modification.
    • saveData

      boolean saveData()

      Save the existing changes for this resource (for example, save the layer to disk or to the database, etc). The resource should not be closed at this point (files, database connections, etc should no be closed), as they may be still needed by other extensions. Resources should be closed at IExtension.terminate().

      Returns:
      true if the data was correctly saved, false if it was not saved (there are many reasons for this: there was an error, the user cancelled the process, etc).
    • getExtension

      IExtension getExtension()
      Each IUnsavedData object is associated with one extension, which is in charge of this data. This method gets the extension associated with this object.
      Returns:
      The extension associated with this IUnsavedData object.
    • getIcon

      String getIcon()
      Gets an icon suitable to represent this type of data.
      Returns:
      An icon representing this type of data, or null if no icon is available