001: /*
002: * SystemPropertiesDockedTab.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: package org.executequery.gui;
023:
024: import java.awt.BorderLayout;
025: import javax.swing.JTabbedPane;
026: import org.underworldlabs.swing.HeapMemoryPanel;
027:
028: /* ----------------------------------------------------------
029: * CVS NOTE: Changes to the CVS repository prior to the
030: * release of version 3.0.0beta1 has meant a
031: * resetting of CVS revision numbers.
032: * ----------------------------------------------------------
033: */
034:
035: /**
036: * System properties docked component.
037: *
038: * @author Takis Diakoumis
039: * @version $Revision: 1.4 $
040: * @date $Date: 2006/05/14 06:56:52 $
041: */
042: public class SystemPropertiesDockedTab extends
043: AbstractDockedTabActionPanel {
044:
045: public static final String TITLE = "System Properties";
046:
047: /** the system properties panel */
048: private SystemPropertiesPanel propertiesPanel;
049:
050: /** the heap resources panel */
051: private HeapMemoryPanel resourcesPanel;
052:
053: /** Creates a new instance of SystemPropertiesDockedTab */
054: public SystemPropertiesDockedTab() {
055: super (new BorderLayout());
056: init();
057: }
058:
059: private void init() {
060: propertiesPanel = new SystemPropertiesPanel();
061: resourcesPanel = new HeapMemoryPanel();
062:
063: JTabbedPane tabs = new JTabbedPane();
064: tabs.add("System", propertiesPanel);
065: tabs.add("Resources", resourcesPanel);
066:
067: add(tabs, BorderLayout.CENTER);
068: }
069:
070: /**
071: * Override to clean up the mem thread.
072: */
073: public boolean tabViewClosing() {
074: resourcesPanel.stopTimer();
075: return true;
076: }
077:
078: /**
079: * Override to make sure the timer has started.
080: */
081: public boolean tabViewSelected() {
082: resourcesPanel.startTimer();
083: return true;
084: }
085:
086: // ----------------------------------------
087: // DockedTabView Implementation
088: // ----------------------------------------
089:
090: public static final String MENU_ITEM_KEY = "viewSystemProperties";
091:
092: public static final String PROPERTY_KEY = "system.display.systemprops";
093:
094: /**
095: * Returns the display title for this view.
096: *
097: * @return the title displayed for this view
098: */
099: public String getTitle() {
100: return TITLE;
101: }
102:
103: /**
104: * Returns the name defining the property name for this docked tab view.
105: *
106: * @return the key
107: */
108: public String getPropertyKey() {
109: return PROPERTY_KEY;
110: }
111:
112: /**
113: * Returns the name defining the menu cache property
114: * for this docked tab view.
115: *
116: * @return the preferences key
117: */
118: public String getMenuItemKey() {
119: return MENU_ITEM_KEY;
120: }
121:
122: }
|