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

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4. //
  5. //
  6. // IActionFeature
  7. //
  8. // Implements action-based features. Implements the action listener
  9. // interface so it can register a listener with the text object
  10. // it is providing features for. It intercepts actions and modifies
  11. // the text object accordingly.
  12. // 7/21/97 TJS
  13. import com.ms.ui.event.*;
  14.  
  15. public abstract class MovementFeature implements ITextFeature, IUIKeyListener
  16. {        
  17.     protected ITextOperationTargetExt textTarget;    
  18.     
  19.     public MovementFeature()
  20.     {
  21.     }
  22.     
  23.     public void init(ITextOperationTargetExt tTarget)
  24.     {
  25.         textTarget = tTarget;
  26.     }
  27.     
  28.     public void register()
  29.     {
  30.         textTarget.addKeyListener(this);
  31.         //textTarget.addMouseListener(this);
  32.     }
  33.     
  34.     public void unregister()
  35.     {
  36.         textTarget.removeKeyListener(this);
  37.         //textTarget.removeMouseListener(this);
  38.     }
  39.     
  40.     // reset() and all IUIKeyListener and IUIMouseListener functions are to be
  41.     // implemented in a derived class
  42. }
  43.  
  44.