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

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4.  
  5. import com.ms.ui.event.IUIKeyListener;
  6. import com.ms.ui.event.UIActionEvent;
  7. import com.ms.fx.FxFont;
  8.  
  9. /**
  10.  *    Contains methods that support common text operations. Implement this interface
  11.  *    if you'd like to receive notification that the user wants to
  12.  *    do edit control text-related stuff. This notification is usually sent from 
  13.  *    a toolbar or a menu.
  14.  *    <p>
  15.  *    An object which implements this interface can use a
  16.  *    <a href="CommandFeature.html">CommandFeature</a> object to handle commands
  17.  *    and have it call the right methods in this interface when necessary.
  18.  *    This keeps command processing all in one place, where it can be easily
  19.  *    reused and extended.
  20.  *    <p>
  21.  *    Several JNotepad classes support this interface:
  22.  *    <ul>
  23.  *    <li><a href="TabFileViewer">TabFileViewer</a>
  24.  *    <li><a href="FeatureTabFileViewer.html">FeatureTabFileViewer</a>
  25.  *    <li><a href="JNoteUIEdit.html">JNoteUIEdit</a>
  26.  *    </ul>
  27.  *
  28.  *    @version    1.0, 7/15/97
  29.  */
  30.  
  31. public interface ITextOperationTarget
  32. {
  33.     /**
  34.      *    Called when the user wishes to undo the previous action.
  35.      */
  36.     public boolean undo();
  37.  
  38.     /**
  39.      *    Called when the user wishes to redo the previously undone action.
  40.      */
  41.     public boolean redo();
  42.  
  43.     /**
  44.      *    Called when the user wishes to cut text.
  45.      */
  46.     public void cut();
  47.  
  48.     /**
  49.      *    Called when the user wishes to copy text.
  50.      */    
  51.     public void copy();
  52.  
  53.     /**
  54.      *    Called when the user wishes to paste text.
  55.      */    
  56.     public void paste();
  57.  
  58.     /**
  59.      *    Called when the user wishes to delete text.
  60.      */    
  61.     public void delete();
  62.  
  63.     /**
  64.      *    Called when the user wishes to select all text.
  65.      */    
  66.     public void selectAll();
  67.  
  68.  
  69.     /**
  70.      *    Called when the user wishes to change the foreground color.
  71.      */    
  72.     public void changeTextColor();
  73.  
  74.     /**
  75.      *    Called when the user wishes to change the background color.
  76.      */    
  77.     public void changeBackColor();
  78.  
  79.     /**
  80.      *    Called when the user wishes to change the current font.
  81.      */        
  82.     public void changeFont();
  83.  
  84.     /**
  85.      *    Called when the user wishes to change the current font to a given font.
  86.      *
  87.      *    @param    font    Font the user wishes to change to.
  88.      */        
  89.     public void changeFont(FxFont font);
  90.  
  91.     /**
  92.      *    Called when the user wishes to change the horizontal alignment.
  93.      *
  94.      *    @param    h    Horizontal alignment style, defined in the IFxTextConstants interface.
  95.      */        
  96.     public void setHorizAlign(int h);
  97.  
  98.     /**
  99.      *    Causes the ITextOperationTarget to receive the input focus.
  100.      */
  101.     public void requestFocus();
  102.  
  103.     /**
  104.      *    Queries if the ITextOperationTarget may receive the input focus.
  105.      */
  106.     public boolean isKeyable();
  107.  
  108.     /**
  109.      *    Called when the user selects a command which is not a standard text
  110.      *    commands (i.e. one which does not have a matching method in this interface).
  111.      *
  112.      *    @param    command    Name of command which has been run
  113.      *    @param    evt    Event object associated with this command
  114.      *
  115.      *    @returns true if the command has been handled, and false if it has not.     
  116.      */
  117.     public boolean otherCommand(String command, UIActionEvent evt);
  118.  
  119. }
  120.