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

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4.  
  5. import com.ms.ui.UIComponent;
  6. import com.ms.fx.FxColor;
  7.  
  8. /**
  9.  *    Interface for allowing user interface controls to receive feedback
  10.  *    (i.e. enabling and disabling items). 
  11.  *    This gives one a flexible and easy to use
  12.  *    architecture for setting the state of components that generate user 
  13.  *    commands. This works well when one uses this to enable and disable commands in all
  14.  *    controls in the entire system. For example, this system
  15.  *    is great for disabling the save button in a toolbar and the corresponding
  16.  *    save option in a menu with one simple method call. See CommandFeature for
  17.  *    an example of how this is done.
  18.  *
  19.  *    @version    1.0, 8/11/97
  20.  *
  21.  *    @see        IComponentFeature
  22.  *    @see        CommandFeature
  23.  *    @see        JNoteMenubar
  24.  *    @see        JNoteToolbar
  25.  */
  26.  
  27. public interface ICommandFeedback 
  28. {
  29.     public static final int COLORCHANGE_FOREGROUND = 0;
  30.     public static final int COLORCHANGE_BACKGROUND = 1;
  31.     
  32.     /**
  33.      *    Called to enable or disable a command. 
  34.      *
  35.      *    @param    command    Name of command to enable or disable
  36.      *    @param    on    State to change to. False if command is to be disabled, true if
  37.      *                it is to be enabled.
  38.      */
  39.     public void enableCommand(String command, boolean on);
  40.  
  41.     /**
  42.      *    Called to check or uncheck a command. This item must be a UICheckButton
  43.      *    or this call will have no effect. 
  44.      *
  45.      *    @param    command    Name of command to check or uncheck
  46.      *    @param    on    State to change to. True if button is to be checked, false
  47.      *                    is button is to be unchecked.
  48.      */
  49.     public void setChecked(String command, boolean on);
  50.  
  51.     /**
  52.      *    Returns whether a command is enabled. Returns true if it is, false if it
  53.      *    is disabled.
  54.      *
  55.      *    @param    command    Name of command to query
  56.      */
  57.     public boolean isEnabled(String command);
  58.     
  59.     /**
  60.      *    Adds a file to the Most Recently Used (MRU) file list. 
  61.      *
  62.      *    @param    filename Name of file to add
  63.      */
  64.     public void addToMRUList(String filename);
  65.  
  66.     public void notifyColorChange(Object comp,FxColor col,int i);
  67.  
  68. }
  69.  
  70.