home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / un2maiq4 / pjjava / src / pj / awt / tabbar.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  3.4 KB  |  132 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.     Written by the Personal Journal developers of Dow Jones & Company, Inc.
  4.  
  5.     Dow Jones makes no representations or warranties about 
  6.     the suitability of this software, either express or 
  7.     implied, including but not limited to the implied warranties 
  8.     of merchantability, fitness for a particular purpose, 
  9.     or non-infringement.  Dow Jones will not be liable for 
  10.     any damages suffered by a user as a result of using, 
  11.     modifying or distributing this software or its derivatives.
  12.  
  13.  
  14.     TabBar.java
  15.  
  16.         A navigational accessory of a notebook.
  17.  
  18.  
  19.     Authors:
  20.  
  21.         rphall          Rick Hall
  22.  
  23.  
  24.     Version Ident:
  25.  
  26.         $Header$
  27.  
  28.  
  29.     History:
  30.  
  31.         10-dec-1995 rphall     Initial Creation
  32.  
  33.  
  34. ---------------------------------------------------------------------------*/
  35.  
  36. package pj.awt;
  37.  
  38. import pj.awt.TabSpec;
  39.  
  40. import collections.ImplementationError;
  41. import java.lang.String;
  42.  
  43. /**
  44.  * A TabBar is a navigational accessory of a Notebook.  A TabBar is composed
  45.  * of set of tab components that cooperate as a group so that when one is
  46.  * selected, others are deselected.
  47.  * <P>
  48.  * When implemented, tab components should have two visual presentations:
  49.  * enabled vs. disabled and selected vs. deselected.  Java provides default
  50.  * visuals for enabled vs. disabled components.  Java does not provide
  51.  * default visuals for selection.  The main requirement on selection visuals
  52.  * is that only one tab at a time should appear selected. One
  53.  * implementation of selection would be to bold text and darken borders of a
  54.  * selected tab.
  55.  *
  56.  * @see TabSpec
  57.  * @see Notebook
  58.  * @version 0.00 03-Jan-96
  59.  * @author Rick Hall
  60. */
  61. public interface TabBar
  62.     {
  63.  
  64.     // --- Public operations
  65.  
  66.     /**
  67.      * Append a tab and conditionally select it.
  68.      *
  69.      * @param tab The tab to add.
  70.      * @param selected True to make the new tab the selected tab,
  71.      * false otherwise.
  72.      * @exception ImplementationError thrown if tab violates some
  73.      * implementation-dependent precondition
  74.     */
  75.     public void appendTab(TabSpec tab, boolean selected)
  76.         throws ImplementationError;
  77.  
  78.     /**
  79.      * Append a tab but do not select it.
  80.      * @param tab The tab to append.
  81.      * @exception ImplementationError thrown if tab violates some
  82.      * implementation-dependent precondition
  83.     */
  84.     public void appendTab(TabSpec tab)
  85.         throws ImplementationError;
  86.  
  87.     /**
  88.      * Enable a tab.
  89.      *
  90.      * @param name  The name of the tab to enable.
  91.     */
  92.     public void enableTab(String name);
  93.  
  94.     /**
  95.      * Enable all tabs.
  96.     */
  97.     public void enableTabs();
  98.  
  99.     /**
  100.      * Disable a tab.
  101.      *
  102.      * @param name  The name of the tab to disable.
  103.     */
  104.     public void disableTab(String name);
  105.  
  106.     /**
  107.      * Disable all tabs.
  108.     */
  109.     public void disableTabs();
  110.  
  111.     /**
  112.      * @return A specification for the currently selected tab.  If no
  113.      * tab is selected, returns null.
  114.     */
  115.     public TabSpec currentTabSpec();
  116.  
  117.     /**
  118.      * Make a tab appear selected.
  119.      *
  120.      * @param name The name of the tab that should appear selected.
  121.     
  122.     public void selectTab(String name);
  123.  
  124.     /**
  125.      * Make a tab appear deselected.
  126.      *
  127.      * @param name The name of the tab that should appear deselected.
  128.     */
  129.     public void deselectTab(String name);
  130.  
  131.     } // TabBar
  132.