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

  1. //
  2. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  3. //
  4.  
  5. import com.ms.ui.event.UIActionEvent;
  6.  
  7. /**
  8.  *    Contains methods that support common file operations. Implement this interface
  9.  *    if you'd like to receive notification that the user wants to
  10.  *    do file-related stuff. This notification is usually sent from a toolbar or a menu.
  11.  *    <p>
  12.  *    An object which implements this interface can use a
  13.  *    <a href="CommandFeature.html">CommandFeature</a> object to handle commands
  14.  *    and have it call the right methods in this interface when necessary.
  15.  *    This keeps command processing all in one place, where it can be easily
  16.  *    reused and extended.
  17.  *    <p>
  18.  *    Several JNotepad classes support this interface:
  19.  *    <ul>
  20.  *    <li><a href="FileControl.html">FileControl</a>
  21.  *    <li><a href="DiskFileControl.html">DiskFileControl</a>
  22.  *    <li><a href="ClipboardControl.html">ClipboardControl</a>
  23.  *    <li><a href="FeatureTabFileViewer.html">FeatureTabFileViewer</a>
  24.  *    <li><a href="TabFileViewer.html">TabFileViewer</a>
  25.  *    </ul>
  26.  *
  27.  *    @version    1.0, 7/14/97
  28.  */
  29.  
  30. public interface IFileOperationTarget
  31. {
  32.     /**
  33.      *    Called when the user wants to create a new file.
  34.      */
  35.     public void newFile();
  36.     
  37.     /**
  38.      *    Called when the user wants to open a new file.
  39.      */
  40.     public boolean openFile();
  41.  
  42.     /**
  43.      *    Called when the user wants to save a file.
  44.      */
  45.     public boolean saveFile();
  46.  
  47.     /**
  48.      *    Called when the user wants to save a file under a new name.
  49.      */
  50.     public boolean saveFileAs();
  51.  
  52.     /**
  53.      *    Called when the user wants to close a file.    
  54.      */
  55.     public boolean closeFile();
  56.  
  57.     /**
  58.      *    Called when the user wants to print a file.
  59.      */
  60.     public void printFile();
  61.  
  62.     /**
  63.      *    Called when the user wants to perform a search and/or replace.
  64.      *
  65.      *    @param    isFind    true if the user wants to search for text, false if the 
  66.      *                        user wants to replace text
  67.      */
  68.     public void searchReplace(boolean isFind);    
  69.  
  70.     /**
  71.      *    Called when the user selects a command which is not a standard file
  72.      *    commands (i.e. one which does not have a matching method in this interface).
  73.      *
  74.      *    @param    command    Name of command which has been run
  75.      *    @param    evt    Event object associated with this command
  76.      *
  77.      *    @returns true if the command has been handled, and false if it has not.          
  78.      */
  79.     public boolean otherCommand(String command, UIActionEvent evt);
  80. }
  81.  
  82.