public class ProjectExtension extends Extension implements IExtensionStatus
Modifier and Type | Class and Description |
---|---|
class |
ProjectExtension.UnsavedProject
Implements the IUnsavedData interface to show unsaved projects in the
Unsavad Data dialog.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROJECT_FILE_CHOOSER_ID |
static java.lang.String |
PROJECTENCODING
Deprecated.
see PersistentManager
|
Constructor and Description |
---|
ProjectExtension() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(AfterSavingListener l)
Adds the specified after saving listener to receive "after saving file
events" from this component.
|
void |
addListener(BeforeSavingListener l)
Adds the specified before saving listener to receive "before saving file
events" from this component.
|
void |
execute(java.lang.String command)
This method is executed when the user clicks on any of the
controls associated with this extension (menus, tools, etc).
|
void |
execute(java.lang.String actionCommand,
java.lang.Object[] args) |
protected void |
fireAfterSavingFileEvent(SaveEvent evt)
Reports a after saving file event.
|
protected void |
fireBeforeSavingFileEvent(SaveEvent evt)
Reports a before saving file event.
|
AfterSavingListener[] |
getAfterSavingListeners()
Returns an array of all the after saving listeners registered on this
component.
|
BeforeSavingListener[] |
getBeforeSavingListeners()
Returns an array of all the before saving listeners registered on this
component.
|
static java.lang.String |
getPath() |
Project |
getProject()
Devuelve el proyecto.
|
ProjectWindow |
getProjectFrame() |
IWindow |
getProjectWindow() |
IMonitorableTask[] |
getRunningProcesses()
Gets an array of the traceable background tasks associated with this
extension.
|
IExtensionStatus |
getStatus()
Gets the status of the extension, which may be queried to check
if the extension has some unsaved data or some associated background
tasks.
|
IUnsavedData[] |
getUnsavedData()
Gets an array of the UnsavedData objects, which contain information about
the unsaved data and allows to save it.
|
boolean |
hasRunningProcesses()
This method is used to check if the extension has some associated
background process which is currently running.
|
boolean |
hasUnsavedData()
This method is used to check if the extension has some unsaved data.
|
void |
initialize()
Extension's initialization code should be here.
|
boolean |
isEnabled()
This method is invoked by Andami to check whether the extension
(and its associated controls) is enabled or disabled.
|
boolean |
isVisible()
This method is invoked by Andami to check whether the extension
(and its associated controls) is visible or hidden.
|
void |
postInitialize()
Extension's post-initialization code should be here.
|
Project |
readProject(java.io.File file)
Lee del XML el proyecto.
|
Project |
readProject(java.lang.String path) |
void |
removeListener(AfterSavingListener l)
Removes the specified after saving listener so that it no longer receives
save file events from this component.
|
void |
removeListener(BeforeSavingListener l)
Removes the specified before saving listener so that it no longer
receives save file events from this component.
|
static void |
setPath(java.lang.String path) |
void |
setProject(Project p)
Sets the project
|
void |
showProjectWindow()
Muestra la ventana con el gestor de proyectos.
|
void |
showProjectWindow(WindowInfo wi)
Muestra la ventana con el gestor de proyectos, con las propiedades de
ventana especificadas.
|
boolean |
writeProject(java.io.File file,
Project p)
Escribe el proyecto en XML.
|
boolean |
writeProject(java.io.File file,
Project p,
boolean askConfirmation)
Escribe el proyecto en disco.
|
public static final java.lang.String PROJECT_FILE_CHOOSER_ID
public static java.lang.String PROJECTENCODING
public void initialize()
IExtension
initialize
in interface IExtension
public ProjectWindow getProjectFrame()
public void showProjectWindow()
public void showProjectWindow(WindowInfo wi)
wi
- public void execute(java.lang.String command)
IExtension
execute
in interface IExtension
command
- An String specifying the action to
execute. This is useful when there are different
controls associated with the same extension.public void execute(java.lang.String actionCommand, java.lang.Object[] args)
execute
in interface IExtensionExecuteWithArgs
execute
in class Extension
public void postInitialize()
IExtension
initialize()
has been called for ALL the extensions.postInitialize
in interface IExtension
postInitialize
in class Extension
public boolean writeProject(java.io.File file, Project p)
file
- Fichero.p
- Proyecto.public boolean writeProject(java.io.File file, Project p, boolean askConfirmation)
file
- Fichero.p
- Proyecto.askConfirmation
- booleanpublic Project readProject(java.lang.String path)
public Project readProject(java.io.File file)
file
- Fichero.public Project getProject()
public boolean isEnabled()
IExtension
isEnabled
in interface IExtension
IExtension.isEnabled()
public boolean isVisible()
IExtension
isVisible
in interface IExtension
IExtension.isVisible()
public void setProject(Project p)
p
- public static java.lang.String getPath()
public static void setPath(java.lang.String path)
public IWindow getProjectWindow()
public IExtensionStatus getStatus()
IExtension
getStatus
in interface IExtension
getStatus
in class Extension
IExtensionStatus
public boolean hasUnsavedData()
IExtensionStatus
hasUnsavedData
in interface IExtensionStatus
public IUnsavedData[] getUnsavedData()
IExtensionStatus
Gets an array of the UnsavedData objects, which contain information about the unsaved data and allows to save it.
getUnsavedData
in interface IExtensionStatus
public IMonitorableTask[] getRunningProcesses()
IExtensionStatus
Gets an array of the traceable background tasks associated with this extension. These tasks may be tracked, canceled, etc.
getRunningProcesses
in interface IExtensionStatus
public boolean hasRunningProcesses()
IExtensionStatus
hasRunningProcesses
in interface IExtensionStatus
public void addListener(BeforeSavingListener l)
l
- the before saving listener.SaveEvent
,
BeforeSavingListener
,
removeListener(BeforeSavingListener)
,
getBeforeSavingListeners()
public void addListener(AfterSavingListener l)
l
- the after saving listener.SaveEvent
,
AfterSavingListener
,
removeListener(AfterSavingListener)
,
getAfterSavingListeners()
public BeforeSavingListener[] getBeforeSavingListeners()
BeforeSavingListener
s or an
empty array if no key listeners are currently registered#addBeforeSavingListener(BeforeSavingListener)
,
#removeBeforeSavingListener(BeforeSavingListener)
public AfterSavingListener[] getAfterSavingListeners()
AfterSavingListener
s or an
empty array if no key listeners are currently registered#addAfterSavingListener(AfterSavingListener)
,
#removeAfterSavingListener
public void removeListener(BeforeSavingListener l)
l
is null
, no exception is thrown and no action
is performed.l
- the before saving listenerSaveEvent
,
BeforeSavingListener
,
addListener(BeforeSavingListener)
,
getBeforeSavingListeners()
public void removeListener(AfterSavingListener l)
l
is
null
, no exception is thrown and no action is performed.l
- the after saving listenerSaveEvent
,
AfterSavingListener
,
addListener(AfterSavingListener)
,
getAfterSavingListeners()
protected void fireBeforeSavingFileEvent(SaveEvent evt)
evt
- the before saving file eventprotected void fireAfterSavingFileEvent(SaveEvent evt)
evt
- the after saving file event