001: /*
002: * Copyright (c) 2000, Jacob Smullyan.
003: *
004: * This is part of SkunkDAV, a WebDAV client. See http://skunkdav.sourceforge.net/
005: * for the latest version.
006: *
007: * SkunkDAV is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License as published
009: * by the Free Software Foundation; either version 2, or (at your option)
010: * any later version.
011: *
012: * SkunkDAV is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * General Public License for more details.
016: *
017: * You should have received a copy of the GNU General Public License
018: * along with SkunkDAV; see the file COPYING. If not, write to the Free
019: * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
020: * 02111-1307, USA.
021: */
022:
023: package org.skunk.dav.client.gui;
024:
025: import java.awt.Component;
026: import java.beans.PropertyVetoException;
027: import java.util.Iterator;
028: import javax.swing.JComponent;
029:
030: public interface View {
031: /**
032: * add the buffer to the application container widget
033: */
034: void dock(Buffer buffer);
035:
036: /*
037: * remove the component from the application container widget
038: */
039: void undock(Buffer buffer);
040:
041: /**
042: * @return list of current docked components
043: */
044: Iterator getDockedBuffers();
045:
046: /**
047: * ensure that the specified docked component is visible and has focus
048: */
049: void focus(Buffer buffer);
050:
051: /*
052: I want to support emacs-mode and mdi-mode multiple visible buffers, but the
053: methods below do not seem satisfactory. Visibility and focus are not orthogonal,
054: which gives rise to complications.
055:
056: Buffers can be:
057: null / not null
058: / undocked / docked
059: / not visible / visible
060: / not focussed / focussed
061: (In fact, a buffer which is undocked is either a new buffer which is about to be docked, or a closed buffer which is
062: about to be destroyed. But invisible and unfocussed buffers will predominate.)
063: */
064:
065: /**
066: * attempt to set for the given buffer the given visibility.
067: * depending on the dock mode, certain settings of this property
068: * may be vetoed (e.g., in emacs-mode, at least one buffer must
069: * be visible at all times, so setting the only visible buffer
070: * invisible would not be permitted.) A change of visibility
071: * may entail a change to the focusedBuffer property, but it may
072: * not change the visibility of another buffer. (Hence, for
073: * single-buffer dock modes (like TABBED_PANE_MODE, if restricted to one frame)
074: * the setVisible method should throw an UnsupportedOperationException.)
075: * Preconditions: the buffer must be docked and non-null.
076: *
077: */
078: void setVisible(Buffer buffer, boolean visible)
079: throws UnsupportedOperationException, PropertyVetoException;
080:
081: /**
082: * @return whether the given buffer is visible
083: */
084: boolean isVisible(Buffer buffer);
085:
086: /**
087: * @return the buffer that has focus, or null if there are no buffers
088: */
089: Buffer getFocussedBuffer();
090:
091: /**
092: * @return theAppContext object that holds this View
093: */
094: AppContext getAppContext();
095:
096: /**
097: * dispose of the View
098: */
099: void dispose();
100:
101: /**
102: * show a status message
103: */
104: void showStatus(String message);
105:
106: /**
107: * add a component to the status bar
108: */
109: void dockStatus(JComponent statusComponent);
110:
111: /**
112: * remove a component from the status bar
113: */
114: void undockStatus(JComponent statusComponent);
115:
116: /**
117: * get the component corresponding to this view
118: */
119: Component getComponent();
120: }
121: /* $Log: View.java,v $
122: /* Revision 1.6 2000/12/19 22:36:05 smulloni
123: /* adjustments to preamble.
124: /*
125: /* Revision 1.5 2000/12/04 23:51:16 smulloni
126: /* added ImageViewer; fixed word in SimpleTextEditor
127: /*
128: /* Revision 1.4 2000/12/03 23:53:26 smulloni
129: /* added license and copyright preamble to java files.
130: /*
131: /* Revision 1.3 2000/11/29 23:16:05 smullyan
132: /* adding first rough cut of search capability to the text editor. View
133: /* is being updated to allow components to be docked into the status bar.
134: /*
135: /* Revision 1.2 2000/11/28 00:01:39 smullyan
136: /* added a status bar/minibuffer, with a location field showing the current line and
137: /* column number (for the SimpleTextEditor and kin only).
138: /*
139: /* Revision 1.1 2000/11/16 20:45:18 smullyan
140: /* the start of editor integration.
141: /* */
|