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

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4. import com.ms.ui.*;
  5. import com.ms.ui.event.*;
  6.  
  7. /**
  8.  *    Extends IFeature and IUIActionListener to provide a way for
  9.  *    an object to attach itself to IUIComponents, intercept their action 
  10.  *    events, interpret them, and send the results of what the user actually
  11.  *    wants to do to another class. This has several benefits:
  12.  *    <ul>
  13.  *    <li>puts the user option control flow all in one class
  14.  *    <li>prevents duplication if you have two classes which implement the
  15.  *                same user commands (i.e. a toolbar and a menubar)
  16.  *    <li>much easier to use - deal with command names rather than objects
  17.  *                or ID numbers
  18.  *    <li>easily extendable...subclass this class or use the otherCommand()
  19.  *                method in your target object to implement nifty commands.
  20.  *    <li><a href="#ICommandFeedback">ICommandFeedback</a> supports
  21.  *                changing the state of user interface controls (i.e. disabling
  22.  *                and enabling all buttons that do a certain command).
  23.  *    </ul>
  24.  *    @version    1.0, 8/6/97
  25.  */
  26.  
  27. public interface IComponentFeature extends IFeature, IUIActionListener
  28. {
  29.     /**
  30.      *    Initializes the IComponentFeature object with a text target
  31.      *    (an object which handles text-related commands, such as cut or paste) and a
  32.      *    file target (an object which handles file-related commands). Part of the IFeature interface.
  33.      *
  34.      *    @param    tTarget    Object to handle text commands
  35.      *    @param    fTarget    Object to handle file commands
  36.      */
  37.     public void init(ITextOperationTarget tTarget, IFileOperationTarget fTarget);
  38.  
  39.     /**
  40.      *    Adds a component to the list of components which are monitored for user
  41.      *    commands. Whenever a user selects a command in one of these components, 
  42.      *    the class that implements this interface intercepts it and handles it.
  43.      *
  44.      *    @param    comp    Component which generates user commands
  45.      */
  46.     public void addTalker(IUIComponent comp);    
  47. }
  48.