01: /*
02: * PropertiesBrowserGeneral.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.gui.prefs;
23:
24: import java.util.ArrayList;
25: import org.underworldlabs.util.SystemProperties;
26:
27: /* ----------------------------------------------------------
28: * CVS NOTE: Changes to the CVS repository prior to the
29: * release of version 3.0.0beta1 has meant a
30: * resetting of CVS revision numbers.
31: * ----------------------------------------------------------
32: */
33:
34: /**
35: *
36: * @author Takis Diakoumis
37: * @version $Revision: 1.4 $
38: * @date $Date: 2006/05/14 06:56:52 $
39: */
40: public class PropertiesBrowserGeneral extends PropertiesBase {
41:
42: private SimplePreferencesPanel preferencesPanel;
43:
44: public PropertiesBrowserGeneral() {
45: try {
46: jbInit();
47: } catch (Exception e) {
48: e.printStackTrace();
49: }
50: }
51:
52: private void jbInit() {
53: String[] values = { "100", "500", "1000", "5000", "10000",
54: "50000", "100000", "All Records" };
55:
56: ArrayList list = new ArrayList();
57:
58: list.add(new UserPreference(UserPreference.CATEGORY_TYPE, null,
59: "General", null));
60:
61: String key = "browser.max.records";
62: list.add(new UserPreference(UserPreference.INTEGER_TYPE, key,
63: "Maximum records returned", SystemProperties
64: .getProperty("user", key), values));
65:
66: UserPreference[] preferences = (UserPreference[]) list
67: .toArray(new UserPreference[list.size()]);
68: preferencesPanel = new SimplePreferencesPanel(preferences);
69: addContent(preferencesPanel);
70:
71: }
72:
73: public void restoreDefaults() {
74: preferencesPanel.restoreDefaults();
75: }
76:
77: public void save() {
78: preferencesPanel.savePreferences();
79: }
80:
81: }
|