TEMERITY

us.temerity.pipeline
Class BaseAppleScriptEditor

java.lang.Object
  extended by us.temerity.pipeline.Named
      extended by us.temerity.pipeline.PluginID
          extended by us.temerity.pipeline.BasePlugin
              extended by us.temerity.pipeline.BaseEditor
                  extended by us.temerity.pipeline.BaseAppleScriptEditor
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PluginID>, Glueable
Direct Known Subclasses:
AcrobatEditor, AcrobatEditor, AcrobatEditor, EmacsEditor, EmacsEditor, GimpEditor, GimpEditor, GimpEditor, GimpEditor, IllustratorEditor, IllustratorEditor, IllustratorEditor, InDesignEditor, InDesignEditor, InDesignEditor, MayaEditor, PhotoshopEditor, PhotoshopEditor, PhotoshopEditor, PreviewEditor, PreviewEditor, PreviewEditor, PreviewEditor, QuickTimeEditor, QuickTimeEditor, TextEditEditor, TextEditEditor, TextEditEditor, TextEditEditor

public class BaseAppleScriptEditor
extends BaseEditor

A convenient super class for writing Pipeline Editor plugins which communicate with Mac OS X applications using Apple Script.

An Apple Script is generate on the fly which directs the application to open each of the files contained in the file sequence passed to the launch method. If the application is not already running it will be started.

The generated script has the following format:

tell application "program" open file "path-to-file" ... end tell

See the Apple Script Documentation for details.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class us.temerity.pipeline.BasePlugin
pDescription
 
Fields inherited from class us.temerity.pipeline.PluginID
pVendor, pVersionID
 
Fields inherited from class us.temerity.pipeline.Named
pName
 
Constructor Summary
protected BaseAppleScriptEditor()
          This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.
protected BaseAppleScriptEditor(String name, VersionID vid, String vendor, String desc, String program)
          Construct with the given name, version and description.
 
Method Summary
 SubProcessLight launch(FileSeq fseq, Map<String,String> env, File dir)
          Deprecated. Unlike the prep method, the convention is for this method to also execute the generated SubProcessLight instance. New subclasses should implement the prep method instead to allow the caller a chance to execute the process as another user. Namely, as the owner of the files being edited. The owner of the files is passes as an additional argument to prep called (author) which must be passed on as a constructor argument of the generated SubProcessLight instance.
 SubProcessLight prep(String author, FileSeq fseq, Map<String,String> env, File dir)
          Construct a SubProcessLight instance which when executed will launch an editor program to view the given file sequence as arguments.
 
Methods inherited from class us.temerity.pipeline.BaseEditor
cleanupLater, clone, createTemp, equals, getPluginType, getProgram, hasPrepMethod, ignoreExitCode, makeWorkingDirs, setProgram
 
Methods inherited from class us.temerity.pipeline.BasePlugin
addSupport, compareTo, getDescription, getFullMessage, getPluginID, getResource, getResources, getResourceSize, getSupports, isUnderDevelopment, removeSupport, setSupports, supports, toString, underDevelopment
 
Methods inherited from class us.temerity.pipeline.PluginID
fromGlue, getVendor, getVersionID, toGlue
 
Methods inherited from class us.temerity.pipeline.Named
getName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseAppleScriptEditor

protected BaseAppleScriptEditor()
This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.


BaseAppleScriptEditor

protected BaseAppleScriptEditor(String name,
                                VersionID vid,
                                String vendor,
                                String desc,
                                String program)
Construct with the given name, version and description.

Parameters:
name - The short name of the editor.
vid - The editor plugin revision number.
vendor - The name of the plugin vendor.
desc - A short description of the editor.
program - A name of the editor executable.
Method Detail

prep

public SubProcessLight prep(String author,
                            FileSeq fseq,
                            Map<String,String> env,
                            File dir)
                     throws PipelineException
Construct a SubProcessLight instance which when executed will launch an editor program to view the given file sequence as arguments.

The default implementation executes the editor program obtained with getProgram method under the given environment. Subclasses should override this method if more specialized behavior or different command line arguments are needed in order to launch the editor for the given file sequence.

Overrides:
prep in class BaseEditor
Parameters:
author - The name of the user owning the files.
fseq - The file sequence to edit.
env - The environment under which the editor is run.
dir - The working directory where the editor is run.
Returns:
The controlling SubProcessLight instance.
Throws:
PipelineException - If unable to launch the editor.
See Also:
SubProcessLight

launch

@Deprecated
public SubProcessLight launch(FileSeq fseq,
                                         Map<String,String> env,
                                         File dir)
                       throws PipelineException
Deprecated. Unlike the prep method, the convention is for this method to also execute the generated SubProcessLight instance. New subclasses should implement the prep method instead to allow the caller a chance to execute the process as another user. Namely, as the owner of the files being edited. The owner of the files is passes as an additional argument to prep called (author) which must be passed on as a constructor argument of the generated SubProcessLight instance.

Launch the editor program (obtained with getProgram) under the given environmant with all of the files which comprise the given file sequence as arguments. The environment env consists of a table of environmental variable name/value pairs. Typically, this environment is corresponds to a Toolset.

Subclasses should override this method if more specialized behavior or different command line arguments are needed in order to launch the editor for the given file sequence.

Overrides:
launch in class BaseEditor
Parameters:
fseq - The file sequence to edit.
env - The environment under which the editor is run.
dir - The working directory where the editor is run.
Returns:
The controlling SubProcessLight instance.
Throws:
PipelineException - If unable to launch the editor.
See Also:
SubProcessLight

TEMERITY