Class ExternalApps

java.lang.Object
org.openoffice.da.comp.writer4latex.ExternalApps

public class ExternalApps extends Object
This class manages and executes external applications used by Writer4LaTeX. These include TeX and friends as well as viewers for the various backend formats. The registry is used for persistent storage of the settings.
  • Field Details

  • Constructor Details

    • ExternalApps

      public ExternalApps(com.sun.star.uno.XComponentContext xContext)
      Construct a new ExternalApps object, with empty definitions
  • Method Details

    • setApplication

      public void setApplication(String sAppName, String sExecutable, String sOptions)
      Define an external application
      Parameters:
      sAppName - the name of the application to define
      sExecutable - the system dependent path to the executable file
      sOptions - the options to the external application; %s will be replaced by the filename on execution
    • getApplication

      public String[] getApplication(String sAppName)
      Get the definition for an external application
      Parameters:
      sAppName - the name of the application to get
      Returns:
      a String array containing the system dependent path to the executable file as entry 0, and the parameters as entry 1 returns null if the application is unknown
    • execute

      public int execute(String sAppName, String sFileName, File workDir, Map<String,String> env, boolean bWaitFor)
      Execute an external application
      Parameters:
      sAppName - the name of the application to execute
      sFileName - the file name to use
      workDir - the working directory to use
      env - map of environment variables to set (or null if no variables needs to be set)
      bWaitFor - true if the method should wait for the execution to finish
      Returns:
      error code
    • execute

      public int execute(String sAppName, String sCommand, String sFileName, File workDir, Map<String,String> env, boolean bWaitFor)
      Execute an external application
      Parameters:
      sAppName - the name of the application to execute
      sCommand - subcommand/option to pass to the command
      sFileName - the file name to use
      workDir - the working directory to use
      env - map of environment variables to set (or null if no variables needs to be set)
      bWaitFor - true if the method should wait for the execution to finish
      Returns:
      error code
    • load

      public void load()
      Load the external applications from the registry
    • save

      public void save()
      Save the external applications to the registry