001: /*
002: * PropertiesView.java
003: *
004: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: *
020: */
021:
022: // **************************************************
023: // **************************************************
024: // DO NOT USE - moved to PropertiesAppearance.java
025: // **************************************************
026: // **************************************************
027: // **************************************************
028: // **************************************************
029: // **************************************************
030: package org.executequery.gui.prefs;
031:
032: import org.underworldlabs.util.SystemProperties;
033:
034: // **************************************************
035: // **************************************************
036: // DO NOT USE
037: // **************************************************
038: // **************************************************
039: // **************************************************
040: // **************************************************
041: // **************************************************
042:
043: /* ----------------------------------------------------------
044: * CVS NOTE: Changes to the CVS repository prior to the
045: * release of version 3.0.0beta1 has meant a
046: * resetting of CVS revision numbers.
047: * ----------------------------------------------------------
048: */
049:
050: /** <p>The view properties panel.
051: *
052: * @author Takis Diakoumis
053: * @version $Revision: 1.4 $
054: * @date $Date: 2006/05/14 06:56:52 $
055: */
056: public class PropertiesView extends PropertiesBase {
057:
058: private SimplePreferencesPanel preferencesPanel;
059:
060: /** <p>Constructs a new instance. */
061: public PropertiesView() {
062: try {
063: jbInit();
064: } catch (Exception e) {
065: e.printStackTrace();
066: }
067: }
068:
069: /** <p>Initializes the state of this instance. */
070: private void jbInit() throws Exception {
071:
072: int count = 0;
073: UserPreference[] preferences = new UserPreference[5];
074:
075: String key = "system.display.statusbar";
076: preferences[count++] = new UserPreference(
077: UserPreference.BOOLEAN_TYPE, key, "Status bar",
078: new Boolean(SystemProperties.getProperty("user", key)));
079:
080: key = "system.display.console";
081: preferences[count++] = new UserPreference(
082: UserPreference.BOOLEAN_TYPE, key, "System console",
083: new Boolean(SystemProperties.getProperty("user", key)));
084:
085: key = "system.display.connections";
086: preferences[count++] = new UserPreference(
087: UserPreference.BOOLEAN_TYPE, key, "Connections",
088: new Boolean(SystemProperties.getProperty("user", key)));
089:
090: key = "system.display.drivers";
091: preferences[count++] = new UserPreference(
092: UserPreference.BOOLEAN_TYPE, key, "Drivers",
093: new Boolean(SystemProperties.getProperty("user", key)));
094:
095: key = "system.display.systemprops";
096: preferences[count++] = new UserPreference(
097: UserPreference.BOOLEAN_TYPE, key,
098: "System properties palette", new Boolean(
099: SystemProperties.getProperty("user", key)));
100:
101: preferencesPanel = new SimplePreferencesPanel(preferences);
102: addContent(preferencesPanel);
103:
104: }
105:
106: public void restoreDefaults() {
107: preferencesPanel.savePreferences();
108: }
109:
110: public void save() {
111: preferencesPanel.savePreferences();
112: }
113:
114: }
|