svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.framework / org.gvsig.andami / src / main / java / org / gvsig / andami / preferences / IPreference.java @ 42872
History | View | Annotate | Download (3.51 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.preferences; |
25 |
|
26 |
import javax.swing.ImageIcon; |
27 |
import javax.swing.JPanel; |
28 |
|
29 |
import org.gvsig.tools.extensionpoint.ExtensionBuilder; |
30 |
/**
|
31 |
* Interface that any entry in the application's preferences dialog must implement.
|
32 |
* In addition to this interface, an abstract class is supplied to ease the addition
|
33 |
* of new pages
|
34 |
* @see org.gvsig.andami.preferences.AbstractPreferencePage
|
35 |
*
|
36 |
* @author jaume dominguez faus - jaume.dominguez@iver.es
|
37 |
*
|
38 |
*/
|
39 |
public interface IPreference extends ExtensionBuilder { |
40 |
|
41 |
public static final String ACCESS_PREFERENCES_PAGE_AUTHORIZATION = "property-page-access"; |
42 |
|
43 |
/**
|
44 |
* Returns an identifier for this preferences page that is used to reference
|
45 |
* it inside the Map.
|
46 |
* @return String, you'd typically use any kind of <code>this.getClass().getName();</code>
|
47 |
*/
|
48 |
String getID();
|
49 |
|
50 |
/**
|
51 |
* Returns an string containing the title of the preferences page. This string
|
52 |
* will be shown whether in the tree entry or in the page header.
|
53 |
* @return String, the title of the page
|
54 |
*/
|
55 |
String getTitle();
|
56 |
|
57 |
/**
|
58 |
* The page must be contained in a JPanel and whatever to be shown will be returned
|
59 |
* by this function.<br>
|
60 |
* <p>
|
61 |
* The content is added, removed and repainted automatically upon the events received from
|
62 |
* the mouse. So, you only have to care about the content and the functionality to make it
|
63 |
* <br>
|
64 |
* </p>
|
65 |
* having sense.
|
66 |
* @return JPanel holding the contents to be shown in the page.
|
67 |
*/
|
68 |
JPanel getPanel();
|
69 |
|
70 |
/**
|
71 |
* Returns the ID of the parent of this layer. If this method returns null, which means
|
72 |
* that this preferences page has no parent, this is new entry in the preferences
|
73 |
* tree, otherwise this preferences page will be hanging on the page with the ID
|
74 |
* returned by this.
|
75 |
* @return
|
76 |
*/
|
77 |
String getParentID();
|
78 |
|
79 |
/**
|
80 |
* Initializes the components of this preferences page to the last settings.
|
81 |
*/
|
82 |
void initializeValues();
|
83 |
|
84 |
/**
|
85 |
* Saves the new settings
|
86 |
* @return <b>true</b> if the values were correctly stored, <b>false</b> otherwise.
|
87 |
* @throws StoreException
|
88 |
*/
|
89 |
void saveValues() throws StoreException; |
90 |
|
91 |
/**
|
92 |
* Restores the default values of this preferences page's settings. Values are not
|
93 |
* saved until saveValues() is executed
|
94 |
*/
|
95 |
void initializeDefaults();
|
96 |
|
97 |
/**
|
98 |
* Returns the image that will be shown in the header of this preferences page
|
99 |
* @return
|
100 |
*/
|
101 |
ImageIcon getIcon();
|
102 |
|
103 |
/**
|
104 |
* Tells if this preference page has changed any value
|
105 |
* (used for storing values when necessary)
|
106 |
* @return <b>True</b> if any value has changed, <b>false</b> otherwise.
|
107 |
*/
|
108 |
boolean isValueChanged();
|
109 |
|
110 |
} |
111 |
|
112 |
|