home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / afc11 / JNotepad / src / IFeature.java < prev    next >
Encoding:
Java Source  |  2000-05-04  |  1.8 KB  |  53 lines

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4.  
  5. /**
  6.  *    Top level class for feature interfaces. Features descend from
  7.  *    this interface but must be instantiated one or more levels down.
  8.  *    <p>
  9.  *    Features are plugin classes which modify the environment somehow. They
  10.  *    operate by attaching event listeners to objects in the JNotepad environment.
  11.  *    By intercepting events from these objects and interacting with them, 
  12.  *    one can extend JNotepad quickly and easily and without touching JNotepad's
  13.  *    source code. One doesn't even need to recompile. 
  14.  *    <p>
  15.  *    There are currently two types of IFeatures:
  16.  *    <ul>
  17.  *    <li><a href="ITextFeature.html">ITextFeature</a> - features that operate on edit controls
  18.  *    <li><a href="IComponentFeature.html">IComponentFeature</a> - features that operate on UIComponents
  19.  *    </ul><p>
  20.  *    Several features in JNotepad are implemented using IFeature:
  21.  *    <ul>
  22.  *    <li><a href="AcceleratorFeature.html">AcceleratorFeature</a>
  23.  *    <li><a href="BraceMatchFeature.html">BraceMatchFeature</a>
  24.  *    <li><a href="DirtyFlagFeature.html">DirtyFlagFeature</a>
  25.  *    <li><a href="JNoteUIStatus.html">AcceleratorFeature</a>
  26.  *    <li><a href="AcceleratorFeature.html">AcceleratorFeature</a>
  27.  *    </ul>
  28.  *    @version    1.0, 7/21/97
  29.  */
  30.  
  31. public interface IFeature 
  32. {
  33.     /**
  34.      *    Called when the feature is to be registered on an object. The object it
  35.      *    is to register itself with is passed in the class-specific init() method.
  36.      *    This usually involves setting listeners on the object.
  37.      */
  38.     public void register();
  39.  
  40.     /**
  41.      *    Called when the feature needs to unregister itself. 
  42.      *    This usually involves removing listeners from the object.
  43.      */
  44.     public void unregister();
  45.  
  46.     /**
  47.      *    Called when a feature has been disabled. Resets the state of the feature.
  48.      */
  49.     public void reset();
  50.     
  51. }
  52.  
  53.