View.java :  » Net » SkunkDAV » org » skunk » dav » client » gui » Java Open Source

Java Open Source » Net » SkunkDAV 
SkunkDAV » org » skunk » dav » client » gui » View.java
/*
 *  Copyright (c) 2000, Jacob Smullyan.
 *
 *  This is part of SkunkDAV, a WebDAV client.  See http://skunkdav.sourceforge.net/ 
 *  for the latest version.
 * 
 *  SkunkDAV is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License as published
 *  by the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 * 
 *  SkunkDAV  is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with SkunkDAV; see the file COPYING.  If not, write to the Free
 *  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 *  02111-1307, USA.
*/

package org.skunk.dav.client.gui;

import java.awt.Component;
import java.beans.PropertyVetoException;
import java.util.Iterator;
import javax.swing.JComponent;

public interface View
{
    /**
     *  add the buffer to the application container widget
     */
    void dock(Buffer buffer);
    
    /*
     *  remove the component from the application container widget
     */
    void undock(Buffer buffer); 

    /**
     *  @return list of current docked components
     */
    Iterator getDockedBuffers();

    /**
     *  ensure that the specified docked component is visible and has focus
     */ 
    void focus(Buffer buffer);  

    /*
      I want to support emacs-mode and mdi-mode multiple visible buffers, but the 
      methods below do not seem satisfactory. Visibility and focus are not orthogonal,
      which gives rise to complications.  

      Buffers can be:
      null / not null
           / undocked   /  docked
                  /  not visible  / visible
                                        / not focussed  / focussed
      (In fact, a buffer which is undocked is either a new buffer which is about to be docked, or a closed buffer which is
      about to be destroyed.  But invisible and unfocussed buffers will predominate.)
    */

     /**
      * attempt to set for the given buffer the given visibility.
      * depending on the dock mode, certain settings of this property
      * may be vetoed (e.g., in emacs-mode, at least one buffer must
      * be visible at all times, so setting the only visible buffer
      * invisible would not be permitted.)  A change of visibility
      * may entail a change to the focusedBuffer property, but it may
      * not change the visibility of another buffer.  (Hence, for
      * single-buffer dock modes (like TABBED_PANE_MODE, if restricted to one frame)
      * the setVisible method should throw an UnsupportedOperationException.)
      * Preconditions: the buffer must be docked and non-null.
      * 
      */
     void setVisible(Buffer buffer, boolean visible) throws UnsupportedOperationException, PropertyVetoException;

    /**      
     * @return whether the given buffer is visible
     */
    boolean isVisible(Buffer buffer);

    /**
     * @return  the buffer that has focus, or null if there are no buffers
     */
    Buffer getFocussedBuffer();

    /**
     * @return theAppContext object that holds this View
     */
    AppContext getAppContext();

    /**
     * dispose of the View
     */
    void dispose();

    /**
     * show a status message
     */
    void showStatus(String message);

    /**
     * add a component to the status bar
     */
    void dockStatus(JComponent statusComponent);

    /**
     * remove a component from the status bar
     */
    void undockStatus(JComponent statusComponent);

    /**
     * get the component corresponding to this view
     */
    Component getComponent();
}
/* $Log: View.java,v $
/* Revision 1.6  2000/12/19 22:36:05  smulloni
/* adjustments to preamble.
/*
/* Revision 1.5  2000/12/04 23:51:16  smulloni
/* added ImageViewer; fixed word in SimpleTextEditor
/*
/* Revision 1.4  2000/12/03 23:53:26  smulloni
/* added license and copyright preamble to java files.
/*
/* Revision 1.3  2000/11/29 23:16:05  smullyan
/* adding first rough cut of search capability to the text editor.  View
/* is being updated to allow components to be docked into the status bar.
/*
/* Revision 1.2  2000/11/28 00:01:39  smullyan
/* added a status bar/minibuffer, with a location field showing the current line and
/* column number (for the SimpleTextEditor and kin only).
/*
/* Revision 1.1  2000/11/16 20:45:18  smullyan
/* the start of editor integration.
/* */
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.