Class UnsavedData

java.lang.Object
org.gvsig.andami.plugins.status.UnsavedData
All Implemented Interfaces:
IUnsavedData

public abstract class UnsavedData extends Object implements IUnsavedData
Abstract class implementing IUnsavedData. is a convenience class used to allow easier modifications of IUnsaveData interface.
Author:
Cesar Martinez Izquierdo invalid input: '<'cesar.martinez@iver.es>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new UnsavedData object which will be associated to the provided extension.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    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.
    abstract String
    Gets the resource name of this unsaved data.
    abstract boolean
    Save the existing changes for this resource (for example, save the layer to disk or to the database, etc).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UnsavedData

      public UnsavedData(IExtension extension)
      Creates a new UnsavedData object which will be associated to the provided extension.
      Parameters:
      extension -
  • Method Details

    • getDescription

      public abstract String getDescription()
      Description copied from interface: IUnsavedData

      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
      Specified by:
      getDescription in interface IUnsavedData
      Returns:
      A description for this unsaved data, probably containing the type of data and the kind of modification.
    • getExtension

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

      public String getIcon()
      Description copied from interface: IUnsavedData
      Gets an icon suitable to represent this type of data.
      Specified by:
      getIcon in interface IUnsavedData
      Returns:
      An icon representing this type of data, or null if no icon is available
    • getResourceName

      public abstract String getResourceName()
      Description copied from interface: IUnsavedData
      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).
      Specified by:
      getResourceName in interface IUnsavedData
      Returns:
      The resource name of this unsaved data
    • saveData

      public abstract boolean saveData()
      Description copied from interface: IUnsavedData

      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().

      Specified by:
      saveData in interface IUnsavedData
      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).