home *** CD-ROM | disk | FTP | other *** search
- /*
- import com.symantec.itools.vcafe.macro.VisualCafeCommand;
-
- // Visual Cafe Application Event Macros
- //
- // appStart() - Executed when VCafe is launched.
- // appExit() - Executed when VCafe is exited.
- // backupFile() - Executed if backupFile is set active under the
- // menu item Tools | Environment Options |Backup
- //
-
- public class Application
- {
- public Application() {}
-
- // All macros need public void run() to be loaded and executed by the macro system.
- public void run()
- {
- }
-
-
- // appStart() gets executed when VCafe is first loaded.
- public void appStart()
- {
- System.out.println("Application.appStart() --- Executed.");
- }
-
-
- //appExit() gets executed when VCafe exits.
- public void appExit()
- {
- String sOutFileName = "c:/temp/VCafe_appExitTest.txt";
-
- System.out.println("Application.appExit() --- Going to exit, C-Ya! ...");
- java.util.Date dTime = new java.util.Date();
- java.io.File fOut;
- java.io.FileWriter fwOut;
- java.io.PrintWriter pwOut = null;
-
- try
- {
- fOut = new java.io.File(sOutFileName);
- fwOut = new java.io.FileWriter(fOut);
- pwOut = new java.io.PrintWriter(fwOut);
- pwOut.println("Test for Visual Cafe appExit() method.");
- pwOut.println("This file can be deleted.");
- pwOut.println(dTime.toString());
- }
- catch(java.io.IOException ioe)
- {
- ioe.printStackTrace();
- }
- finally
- {
- if(pwOut != null) pwOut.close();
- }
- }
-
- // If Tools -> Environment Options -> Backup ->
- // "Backup files on Save" -> "Invoke bakcupFile() macro method is selected,
- // this method will execute when a backup event occurs.
- public void backupFile(String sDir, String sFile)
- {
- System.out.println("Application.backupFile() --- Executed.");
- System.out.println(" Directory: "+sDir);
- System.out.println(" File: "+sFile);
- }
- }
- */