001: /*
002: * AbstractDockedTabActionPanel.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.LayoutManager;
025: import org.executequery.GUIUtilities;
026: import org.executequery.base.DockedTabView;
027: import org.underworldlabs.swing.ActionPanel;
028:
029: /* ----------------------------------------------------------
030: * CVS NOTE: Changes to the CVS repository prior to the
031: * release of version 3.0.0beta1 has meant a
032: * resetting of CVS revision numbers.
033: * ----------------------------------------------------------
034: */
035:
036: /**
037: * Abstract tab action panel.
038: *
039: * @author Takis Diakoumis
040: * @version $Revision: 1.6 $
041: * @date $Date: 2006/06/12 11:20:35 $
042: */
043: public abstract class AbstractDockedTabActionPanel extends ActionPanel
044: implements DockedTabView {
045:
046: /** Creates a new instance of AbstractDockedTabActionPanel */
047: public AbstractDockedTabActionPanel() {
048: super ();
049: }
050:
051: public AbstractDockedTabActionPanel(boolean isDoubleBuffered) {
052: super (isDoubleBuffered);
053: }
054:
055: public AbstractDockedTabActionPanel(LayoutManager layout) {
056: super (layout);
057: }
058:
059: public AbstractDockedTabActionPanel(LayoutManager layout,
060: boolean isDoubleBuffered) {
061: super (layout, isDoubleBuffered);
062: }
063:
064: /**
065: * Indicates that a [long-running] process has begun or ended
066: * as specified. This will trigger the glass pane on or off
067: * and set the cursor appropriately.
068: *
069: * @param inProcess - true | false
070: */
071: public void setInProcess(final boolean inProcess) {
072: GUIUtilities.setGlassPaneVisible(inProcess);
073: if (inProcess) {
074: GUIUtilities.showWaitCursor();
075: } else {
076: GUIUtilities.showNormalCursor();
077: }
078: }
079:
080: /**
081: * Toggles the visibility of the glass pane on the
082: * enclosing frame as specified.
083: *
084: * @param visible - true | false
085: */
086: public void setGlassPaneVisible(boolean visible) {
087: GUIUtilities.setGlassPaneVisible(visible);
088: }
089:
090: // ----------------------------------------
091: // DockedTabView Implementation
092: // ----------------------------------------
093:
094: public int getUserPreferencePosition() {
095: return GUIUtilities
096: .getDockedComponentPosition(getPropertyKey());
097: }
098:
099: public abstract String getPropertyKey();
100:
101: public abstract String getMenuItemKey();
102:
103: /**
104: * Indicates the panel is being removed from the pane
105: */
106: public boolean tabViewClosing() {
107: return true;
108: }
109:
110: /**
111: * Indicates the panel is being selected in the pane
112: */
113: public boolean tabViewSelected() {
114: return true;
115: }
116:
117: /**
118: * Indicates the panel is being selected in the pane
119: */
120: public boolean tabViewDeselected() {
121: return true;
122: }
123:
124: }
|