Main Page
    Cookbook/Overview     ImageMeister     the jcprops file     Licensing
    Binary Installation & Configuration [ Win · Mac · Nix · OSX ]     Changes
    Public API
    Source Code Main Page
        Java [ Common · Win · Mac · Nix ]     Native Code [ Common · Win · Mac · Nix ]     Manifest
        Native Code Overviews [ Common · Win · Mac · Nix · Strings ]     Macros [ General · Native Macros ]
        Walkthroughs [ Java only · Java and native ]     Building [ Win · Mac · Nix · OSX ]     Distribution Issues

All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.jconfig.mac.AppFileOSX
java.lang.Object
   |
   +----com.jconfig.mac.DiskFileMRJ
           |
           +----com.jconfig.mac.AppFileOSX

  Summary

class  AppFileOSX
     extends com.jconfig.mac.DiskFileMRJ
     implements com.jconfig.AppFile, 
                com.jconfig.AppCommandWatcher
{
          // Fields 10
     private boolean bAlreadyRequestedFileTypes;
     private static final String copyrightString;
     private int creatorCode;
     private FileType[] fileTypes;
     private Vector instances;
     private static final int kNumCommands;
     private int minimumPartition;
     private int preferredPartition;
     private int sizeFlags;
     private AppCommand[] theCommands;

          // Constructors 1
     AppFileOSX(int, int, byte[], int) throws FileNotFoundException, DiskFileException;

          // Methods 15
     public void dumpInfo(PrintStream, String);
     public String executableTypeToString(int);
     public AppCommand[] getAllCommands();
     private String[] getArgsFromCommand(AppCommand);
     public AppCommand getCommand(String);
     public int getExecutableType();
     public FileType[] getFileTypes(int);
     public IconBundle getIconBundle(FileType);
     public AppProcess[] getInstances();
     public int getMinimumPartition();
     public int getSizeFlags();
     public int getSuggestedPartition();
     public AppProcess performCommand(AppCommand, int);
     public boolean watchPost(Object, AppCommand, int);
     public boolean watchPre(Object, AppCommand, int);
}

Represents a Mac application as stored on disk (not a running process.)

Author:
Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.




  Fields

· copyrightString

Summary  |  Top

   private static final String copyrightString


· creatorCode

Summary  |  Top
   private int creatorCode

The creator code of this app.


· sizeFlags

Summary  |  Top
   private int sizeFlags

The SIZE flags of this app. This value is read once, and then cached.


· minimumPartition

Summary  |  Top
   private int minimumPartition

The minimum partition of this app. This value is read once, and then cached.


· preferredPartition

Summary  |  Top
   private int preferredPartition

The preferred partition of this app. This value is read once, and then cached.


· fileTypes

Summary  |  Top
   private FileType[] fileTypes

The file types openable with this app. For instance, 'TEXT' is associated with SimpleText.


· instances

Summary  |  Top
   private Vector instances

Stores the processes created from this application.


· theCommands

Summary  |  Top
   private AppCommand[] theCommands

The commands that can be sent to this app.


· bAlreadyRequestedFileTypes

Summary  |  Top
   private boolean bAlreadyRequestedFileTypes

The file types of this app are lazily-created and then cached using this boolean.


· kNumCommands

Summary  |  Top
   private static final int kNumCommands


  Constructors

· AppFileOSX

Summary  |  Top

   AppFileOSX(int vRef, 
              int parID, 
              byte[] pName, 
              int category)  throws FileNotFoundException, DiskFileException

Create from an FSSpec The app must have type either 'APPL' or 'APPE'. The app is created with three default commands: open app, open doc, and print doc. The SIZE flags and partition values are read and cached. The file types openable by this app are not read here; they will only be read if the getFileTypes() method is called.

Parameter Description
vRef the vRefNum of the app's file
parID the parID of the app's file
pName the name of the app's file, as a Pascal string



  Methods

· getIconBundle

Summary  |  Top
   public IconBundle getIconBundle(FileType fileType) 

Returns the icons associated with the given file types. For instance, photoshop has different icons for PICT and JPEG files.

Implements:
getIconBundle in interface AppFile


· getFileTypes

Summary  |  Top
   public FileType[] getFileTypes(int maxToReturn) 

Returns the file types openable by this app, creating them if this method has not been previously called. These file types will be cached for future calls to this method.

Implements:
getFileTypes in interface AppFile


· getCommand

Summary  |  Top
   public AppCommand getCommand(String commandName) 

Search through our commands, and return a match if found.

Implements:
getCommand in interface AppFile


· getAllCommands

Summary  |  Top
   public AppCommand[] getAllCommands() 

Returns our three built-in commands.

Implements:
getAllCommands in interface AppFile


· performCommand

Summary  |  Top
   public AppProcess performCommand(AppCommand command, 
                                    int flags) 

If the command is one of our built-in types, launch the app using the command's arguments, if any. If the app launched OK, create an AppProcessMRJ using the PSN of the process. The process will be added to our list of processes created from this app.

Implements:
performCommand in interface AppFile


· getInstances

Summary  |  Top
   public AppProcess[] getInstances() 

Return an array containing the processes created from this app. Some of these processes may no longer be running.

Implements:
getInstances in interface AppFile


· getArgsFromCommand

Summary  |  Top
   private String[] getArgsFromCommand(AppCommand command) 

Returns an array of Strings created from the arguments to 'command'



· watchPre

Summary  |  Top
   public boolean watchPre(Object target, 
                           AppCommand command, 
                           int flags) 

Part of the AppCommandWatcher interface. Always returns false.

Implements:
watchPre in interface AppCommandWatcher


· watchPost

Summary  |  Top
   public boolean watchPost(Object target, 
                            AppCommand command, 
                            int flags) 

Part of the AppCommandWatcher interface. If the command is 'quit', removes the process from the list of processes.

Implements:
watchPost in interface AppCommandWatcher


· getExecutableType

Summary  |  Top
   public int getExecutableType() 

Currently, always returns AF_PEF.

Implements:
getExecutableType in interface AppFile


· getSizeFlags

Summary  |  Top
   public int getSizeFlags() 

Returns the cached size flags.

Implements:
getSizeFlags in interface AppFile


· getMinimumPartition

Summary  |  Top
   public int getMinimumPartition() 

Returns the cached minimum partition.

Implements:
getMinimumPartition in interface AppFile


· getSuggestedPartition

Summary  |  Top
   public int getSuggestedPartition() 

Returns the cached suggested partition.

Implements:
getSuggestedPartition in interface AppFile


· executableTypeToString

Summary  |  Top
   public String executableTypeToString(int f) 

Convenience method which converts the return value of getExecutableType() into a string representation.

Implements:
executableTypeToString in interface AppFile


· dumpInfo

Summary  |  Top
   public void dumpInfo(PrintStream ps, 
                        String indent) 
Overrides:
dumpInfo in class DiskFileMRJ


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7