Class ProjectExtension

java.lang.Object
org.gvsig.andami.plugins.Extension
org.gvsig.app.extension.ProjectExtension
All Implemented Interfaces:
org.gvsig.andami.plugins.IExtension, org.gvsig.andami.plugins.IExtensionExecuteWithArgs, org.gvsig.andami.plugins.IExtensionQueryByAction, org.gvsig.andami.plugins.status.IExtensionStatus

public class ProjectExtension extends org.gvsig.andami.plugins.Extension implements org.gvsig.andami.plugins.status.IExtensionStatus
Extension que proporciona controles para crear proyectos nuevos, abrirlos y guardarlos. Además los tipos de tabla que soporta el proyecto son añadidos en esta clase.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Implements the IUnsavedData interface to show unsaved projects in the Unsavad Data dialog.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static String
    Use UTF-8 for encoding, as it can represent characters from any language.

    Fields inherited from class org.gvsig.andami.plugins.Extension

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addListener(org.gvsig.utils.save.AfterSavingListener l)
    Adds the specified after saving listener to receive "after saving file events" from this component.
    void
    addListener(org.gvsig.utils.save.BeforeSavingListener l)
    Adds the specified before saving listener to receive "before saving file events" from this component.
    void
    execute(String command)
     
    void
    execute(String actionCommand, Object[] args)
     
    protected void
    fireAfterSavingFileEvent(org.gvsig.utils.save.SaveEvent evt)
    Reports a after saving file event.
    protected void
    fireBeforeSavingFileEvent(org.gvsig.utils.save.SaveEvent evt)
    Reports a before saving file event.
    org.gvsig.utils.save.AfterSavingListener[]
    Returns an array of all the after saving listeners registered on this component.
    org.gvsig.utils.save.BeforeSavingListener[]
    Returns an array of all the before saving listeners registered on this component.
    static String
     
    Devuelve el proyecto.
     
    org.gvsig.andami.ui.mdiManager.IWindow
     
    org.gvsig.utils.swing.threads.IMonitorableTask[]
     
    org.gvsig.andami.plugins.status.IExtensionStatus
     
    org.gvsig.andami.plugins.status.IUnsavedData[]
     
    boolean
     
    boolean
     
    void
     
    boolean
     
    boolean
     
    void
     
    Lee del XML el proyecto.

    Reads the XML of the project.
    It returns a project object holding all needed info that is not linked to the Project Dialog.
     
    void
    removeListener(org.gvsig.utils.save.AfterSavingListener l)
    Removes the specified after saving listener so that it no longer receives save file events from this component.
    void
    removeListener(org.gvsig.utils.save.BeforeSavingListener l)
    Removes the specified before saving listener so that it no longer receives save file events from this component.
    static void
     
    void
    Sets the project
    void
    Muestra la ventana con el gestor de proyectos.
    void
    showProjectWindow(org.gvsig.andami.ui.mdiManager.WindowInfo wi)
    Muestra la ventana con el gestor de proyectos, con las propiedades de ventana especificadas.
    boolean
    Escribe el proyecto en XML.
    boolean
    writeProject(File file, Project p, boolean askConfirmation)
    Escribe el proyecto en disco.

    Methods inherited from class org.gvsig.andami.plugins.Extension

    canQueryByAction, getPlugin, getStatus, getText, isEnabled, isVisible, setPlugin, terminate

    Methods inherited from class java.lang.Object

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

    • PROJECT_FILE_CHOOSER_ID

      public static final String PROJECT_FILE_CHOOSER_ID
      See Also:
    • PROJECTENCODING

      public static String PROJECTENCODING
      Use UTF-8 for encoding, as it can represent characters from any language. Another sensible option would be encoding = System.getProperty("file.encoding"); but this would need some extra testing.
  • Constructor Details

    • ProjectExtension

      public ProjectExtension()
  • Method Details

    • initialize

      public void initialize()
      Specified by:
      initialize in interface org.gvsig.andami.plugins.IExtension
    • getProjectFrame

      public ProjectWindow getProjectFrame()
    • showProjectWindow

      public void showProjectWindow()
      Muestra la ventana con el gestor de proyectos.
    • showProjectWindow

      public void showProjectWindow(org.gvsig.andami.ui.mdiManager.WindowInfo wi)
      Muestra la ventana con el gestor de proyectos, con las propiedades de ventana especificadas.
      Parameters:
      wi -
    • execute

      public void execute(String command)
      Specified by:
      execute in interface org.gvsig.andami.plugins.IExtension
    • execute

      public void execute(String actionCommand, Object[] args)
      Specified by:
      execute in interface org.gvsig.andami.plugins.IExtensionExecuteWithArgs
      Overrides:
      execute in class org.gvsig.andami.plugins.Extension
    • postInitialize

      public void postInitialize()
      Specified by:
      postInitialize in interface org.gvsig.andami.plugins.IExtension
      Overrides:
      postInitialize in class org.gvsig.andami.plugins.Extension
    • writeProject

      public boolean writeProject(File file, Project p)
      Escribe el proyecto en XML.
      Parameters:
      file - Fichero.
      p - Proyecto.
      Returns:
    • writeProject

      public boolean writeProject(File file, Project p, boolean askConfirmation)
      Escribe el proyecto en disco. Pero permite decidir si se pide confirmación para sobreescribir
      Parameters:
      file - Fichero.
      p - Proyecto.
      askConfirmation - boolean
      Returns:
    • readProject

      public Project readProject(String path)
    • readProject

      public Project readProject(File file)
      Lee del XML el proyecto.

      Reads the XML of the project.
      It returns a project object holding all needed info that is not linked to the Project Dialog.
      In case you want the project to be linked to the window you must set this object to the extension:
      Example:
      ...
      . ..
      Project p = ProjectExtension.readProject(projectFile);
      ProjectExtension.setProject(p); ...
      . ..
      Parameters:
      file - Fichero.
      Returns:
      Project
    • getProject

      public Project getProject()
      Devuelve el proyecto.
      Returns:
      Proyecto.
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.gvsig.andami.plugins.IExtension
      See Also:
      • IExtension.isEnabled()
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface org.gvsig.andami.plugins.IExtension
      See Also:
      • IExtension.isVisible()
    • setProject

      public void setProject(Project p)
      Sets the project
      Parameters:
      p -
    • getPath

      public static String getPath()
    • setPath

      public static void setPath(String path)
    • getProjectWindow

      public org.gvsig.andami.ui.mdiManager.IWindow getProjectWindow()
    • getStatus

      public org.gvsig.andami.plugins.status.IExtensionStatus getStatus()
      Specified by:
      getStatus in interface org.gvsig.andami.plugins.IExtension
      Overrides:
      getStatus in class org.gvsig.andami.plugins.Extension
    • hasUnsavedData

      public boolean hasUnsavedData()
      Specified by:
      hasUnsavedData in interface org.gvsig.andami.plugins.status.IExtensionStatus
    • getUnsavedData

      public org.gvsig.andami.plugins.status.IUnsavedData[] getUnsavedData()
      Specified by:
      getUnsavedData in interface org.gvsig.andami.plugins.status.IExtensionStatus
    • getRunningProcesses

      public org.gvsig.utils.swing.threads.IMonitorableTask[] getRunningProcesses()
      Specified by:
      getRunningProcesses in interface org.gvsig.andami.plugins.status.IExtensionStatus
    • hasRunningProcesses

      public boolean hasRunningProcesses()
      Specified by:
      hasRunningProcesses in interface org.gvsig.andami.plugins.status.IExtensionStatus
    • addListener

      public void addListener(org.gvsig.utils.save.BeforeSavingListener l)
      Adds the specified before saving listener to receive "before saving file events" from this component. If l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the before saving listener.
      See Also:
    • addListener

      public void addListener(org.gvsig.utils.save.AfterSavingListener l)
      Adds the specified after saving listener to receive "after saving file events" from this component. If l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the after saving listener.
      See Also:
    • getBeforeSavingListeners

      public org.gvsig.utils.save.BeforeSavingListener[] getBeforeSavingListeners()
      Returns an array of all the before saving listeners registered on this component.
      Returns:
      all of this component's BeforeSavingListeners or an empty array if no key listeners are currently registered
      See Also:
      • invalid reference
        #addBeforeSavingListener(BeforeSavingListener)
      • invalid reference
        #removeBeforeSavingListener(BeforeSavingListener)
    • getAfterSavingListeners

      public org.gvsig.utils.save.AfterSavingListener[] getAfterSavingListeners()
      Returns an array of all the after saving listeners registered on this component.
      Returns:
      all of this component's AfterSavingListeners or an empty array if no key listeners are currently registered
      See Also:
      • invalid reference
        #addAfterSavingListener(AfterSavingListener)
      • invalid reference
        #removeAfterSavingListener
    • removeListener

      public void removeListener(org.gvsig.utils.save.BeforeSavingListener l)
      Removes the specified before saving listener so that it no longer receives save file events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the before saving listener
      See Also:
    • removeListener

      public void removeListener(org.gvsig.utils.save.AfterSavingListener l)
      Removes the specified after saving listener so that it no longer receives save file events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the after saving listener
      See Also:
    • fireBeforeSavingFileEvent

      protected void fireBeforeSavingFileEvent(org.gvsig.utils.save.SaveEvent evt)
      Reports a before saving file event.
      Parameters:
      evt - the before saving file event
    • fireAfterSavingFileEvent

      protected void fireAfterSavingFileEvent(org.gvsig.utils.save.SaveEvent evt)
      Reports a after saving file event.
      Parameters:
      evt - the after saving file event