home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / SourceFileListener.java < prev    next >
Text File  |  1998-10-25  |  3KB  |  70 lines

  1. /*
  2.  * Copyright 1998 Symantec Corporation, All Rights Reserved.
  3.  */
  4.  
  5. package com.symantec.itools.vcafe.openapi;
  6.  
  7.  
  8. /**
  9.  * The listener interface for receiving notification when a change has occurred to
  10.  * a <code>SourceFile</code>.
  11.  * To be notified of changes, a plug-in implements this interface then calls
  12.  * <code>SourceFile.addSourceFileListener</code> to place itself on the notification list.
  13.  * When the <code>SourceFile</code> changes, the appropriate method of this interface is called.
  14.  * To be notified of changes to <i>any</i> <code>SourceFile</code>, use <code>VisualCafe.addSourceFileListener</code>. 
  15.  * If you are only interested in a subset of the notification methods, you can extend the
  16.  * <code>SourceFileAdapter</code> class rather than implement all the methods yourself.
  17.  *
  18.  * @see SourceFile#addSourceFileListener
  19.  * @see SourceFile#removeSourceFileListener
  20.  * @see VisualCafe#addSourceFileListener
  21.  * @see VisualCafe#removeSourceFileListener
  22.  * @see SourceFileAdapter
  23.  *
  24.  * @author Symantec Internet Tools Division
  25.  * @version 1.0
  26.  * @since VCafe 3.0
  27.  */
  28. public interface SourceFileListener
  29. {
  30.     /**
  31.      * This method is called when the file's contents have been reverted.
  32.      * @param sourceFile the file whose contents have been reverted.
  33.      */
  34.     public void sourceFileReverted(SourceFile sourceFile);
  35.  
  36.     /**
  37.      * This method is called when the file is about to be saved to disk.
  38.      * @param sourceFile the file that is about to be saved.
  39.      */
  40.     public void aboutToSaveSourceFile(SourceFile sourceFile);
  41.  
  42.     /**
  43.      * This method is called when the file is done being saved to the disk.
  44.      * @param sourceFile the file that was just saved.
  45.      */
  46.     public void doneSavingSourceFile(SourceFile sourceFile);
  47.  
  48.  
  49.         /** Indicates the file was modified by the user. */
  50.         public final int CHANGED_BY_USER = 0;
  51.         /** Indicates the file was modified by the parser. */
  52.         public final int CHANGED_SYMBOLICALLY = 1;
  53.  
  54.     /**
  55.      * This method is called when the file was modified since being loaded from disk.
  56.      * Note that this method is <b>not</b> called for every keystroke, just the initial change.
  57.      * @param sourceFile the file that has been modified.
  58.      * @param reason how the file was modified.  Can be one of:<ul type=circle>
  59.      * <li>CHANGED_BY_USER - the file was modified by the user.
  60.      * <li>CHANGED_SYMBOLICALLY - the file was modified by the parser.
  61.      * </ul>
  62.      */
  63.     public void sourceFileChanged(SourceFile sourceFile, int reason);
  64.  
  65.     /**
  66.      * This method is called when a change to the file is Undone.
  67.      */
  68.     public void sourceFileChangeUndone(SourceFile sourceFile);
  69. }
  70.