Package org.gvsig.app.extension
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 ClassesModifier and TypeClassDescriptionclassImplements the IUnsavedData interface to show unsaved projects in the Unsavad Data dialog. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic StringUse 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(org.gvsig.utils.save.AfterSavingListener l) Adds the specified after saving listener to receive "after saving file events" from this component.voidaddListener(org.gvsig.utils.save.BeforeSavingListener l) Adds the specified before saving listener to receive "before saving file events" from this component.voidvoidprotected voidfireAfterSavingFileEvent(org.gvsig.utils.save.SaveEvent evt) Reports a after saving file event.protected voidfireBeforeSavingFileEvent(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 StringgetPath()Devuelve el proyecto.org.gvsig.andami.ui.mdiManager.IWindoworg.gvsig.utils.swing.threads.IMonitorableTask[]org.gvsig.andami.plugins.status.IExtensionStatusorg.gvsig.andami.plugins.status.IUnsavedData[]booleanbooleanvoidbooleanbooleanvoidreadProject(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.readProject(String path) voidremoveListener(org.gvsig.utils.save.AfterSavingListener l) Removes the specified after saving listener so that it no longer receives save file events from this component.voidremoveListener(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 voidvoidSets the projectvoidMuestra la ventana con el gestor de proyectos.voidshowProjectWindow(org.gvsig.andami.ui.mdiManager.WindowInfo wi) Muestra la ventana con el gestor de proyectos, con las propiedades de ventana especificadas.booleanwriteProject(File file, Project p) Escribe el proyecto en XML.booleanwriteProject(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
-
Field Details
-
PROJECT_FILE_CHOOSER_ID
- See Also:
-
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:
initializein interfaceorg.gvsig.andami.plugins.IExtension
-
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
- Specified by:
executein interfaceorg.gvsig.andami.plugins.IExtension
-
execute
- Specified by:
executein interfaceorg.gvsig.andami.plugins.IExtensionExecuteWithArgs- Overrides:
executein classorg.gvsig.andami.plugins.Extension
-
postInitialize
public void postInitialize()- Specified by:
postInitializein interfaceorg.gvsig.andami.plugins.IExtension- Overrides:
postInitializein classorg.gvsig.andami.plugins.Extension
-
writeProject
Escribe el proyecto en XML.- Parameters:
file- Fichero.p- Proyecto.- Returns:
-
writeProject
Escribe el proyecto en disco. Pero permite decidir si se pide confirmación para sobreescribir- Parameters:
file- Fichero.p- Proyecto.askConfirmation- boolean- Returns:
-
readProject
-
readProject
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
Devuelve el proyecto.- Returns:
- Proyecto.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.gvsig.andami.plugins.IExtension- See Also:
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein interfaceorg.gvsig.andami.plugins.IExtension- See Also:
-
setProject
Sets the project- Parameters:
p-
-
getPath
-
setPath
-
getProjectWindow
public org.gvsig.andami.ui.mdiManager.IWindow getProjectWindow() -
getStatus
public org.gvsig.andami.plugins.status.IExtensionStatus getStatus()- Specified by:
getStatusin interfaceorg.gvsig.andami.plugins.IExtension- Overrides:
getStatusin classorg.gvsig.andami.plugins.Extension
-
hasUnsavedData
public boolean hasUnsavedData()- Specified by:
hasUnsavedDatain interfaceorg.gvsig.andami.plugins.status.IExtensionStatus
-
getUnsavedData
public org.gvsig.andami.plugins.status.IUnsavedData[] getUnsavedData()- Specified by:
getUnsavedDatain interfaceorg.gvsig.andami.plugins.status.IExtensionStatus
-
getRunningProcesses
public org.gvsig.utils.swing.threads.IMonitorableTask[] getRunningProcesses()- Specified by:
getRunningProcessesin interfaceorg.gvsig.andami.plugins.status.IExtensionStatus
-
hasRunningProcesses
public boolean hasRunningProcesses()- Specified by:
hasRunningProcessesin interfaceorg.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:
-
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:
-
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 listenerlisnull, 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 listenerlisnull, 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
-