Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.framework / org.gvsig.andami / src / main / java / org / gvsig / andami / plugins / status / IExtensionStatus.java @ 40596

History | View | Annotate | Download (3.18 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.andami.plugins.status;
25

    
26
import org.gvsig.andami.plugins.IExtension;
27
import org.gvsig.utils.swing.threads.IMonitorableTask;
28

    
29

    
30
/**
31
 * <p>This interface provides a framework to query the status of
32
 * extensions. By default, the interface provides methods to check
33
 * if the extension has some unsaved data (and save them), and methods
34
 * to check if the extension has some associated background tasks.
35
 * However, additional aspects can be included in the status by extending
36
 * this interface.</p>
37
 * 
38
 * <p>Each extension will have an associated IExtensionStatus object, which
39
 * can be used at any time to check the status. This is specially useful
40
 * during the Andami termination process, to check if there are unfinished
41
 * tasks which should be attended before exiting.</p>
42
 * 
43
 * @see IUnsavedData
44
 * @see UnsavedData
45
 * @see IExtension
46
 * @author Cesar Martinez Izquierdo <cesar.martinez@iver.es>
47
 *
48
 */
49
public interface IExtensionStatus {        
50
    /**
51
     * This method is used to check if the extension has some unsaved data.
52
     * For example, if the project has been modified, or there is a layer in
53
     * edition mode.
54
     * 
55
     * @return true if the extension has some unsaved data, false otherwise.
56
     */
57
    public boolean hasUnsavedData();
58
    
59
    /**
60
     * <p>Gets an array of the UnsavedData objects, which contain information about
61
     * the unsaved data and allows to save it.</p>
62
     * 
63
     * @return An array of the associated unsaved data, or null in case the extension
64
     * has not unsaved data.
65
     */
66
    public IUnsavedData[] getUnsavedData();
67
    
68
    /**
69
     * This method is used to check if the extension has some associated
70
     * background process which is currently running.
71
     * 
72
     * @return true if the extension has some associated background process,
73
     * false otherwise.
74
     */
75
    public boolean hasRunningProcesses();
76
    
77
    
78
    /**
79
     * <p>Gets an array of the traceable background tasks associated with this
80
     * extension. These tasks may be tracked, canceled, etc.</p>
81
     * 
82
     * @return An array of the associated background tasks, or null in case there is
83
     * no associated background tasks.
84
     */
85
    public IMonitorableTask[] getRunningProcesses();
86
    
87
        //public IStatusGUI getGUI();
88
}