Class ExternalApps


  • public class ExternalApps
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BIBTEX  
      static java.lang.String DVIPS  
      static java.lang.String DVIVIEWER  
      static java.lang.String LATEX  
      static java.lang.String MAKEINDEX  
      static java.lang.String MK4HT  
      static java.lang.String PDFLATEX  
      static java.lang.String PDFVIEWER  
      static java.lang.String POSTSCRIPTVIEWER  
      static java.lang.String XELATEX  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalApps​(com.sun.star.uno.XComponentContext xContext)
      Construct a new ExternalApps object, with empty definitions
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int execute​(java.lang.String sAppName, java.lang.String sFileName, java.io.File workDir, java.util.Map<java.lang.String,​java.lang.String> env, boolean bWaitFor)
      Execute an external application
      int execute​(java.lang.String sAppName, java.lang.String sCommand, java.lang.String sFileName, java.io.File workDir, java.util.Map<java.lang.String,​java.lang.String> env, boolean bWaitFor)
      Execute an external application
      java.lang.String[] getApplication​(java.lang.String sAppName)
      Get the definition for an external application
      void load()
      Load the external applications from the registry
      void save()
      Save the external applications to the registry
      void setApplication​(java.lang.String sAppName, java.lang.String sExecutable, java.lang.String sOptions)
      Define an external application
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExternalApps

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

      • setApplication

        public void setApplication​(java.lang.String sAppName,
                                   java.lang.String sExecutable,
                                   java.lang.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 java.lang.String[] getApplication​(java.lang.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​(java.lang.String sAppName,
                           java.lang.String sFileName,
                           java.io.File workDir,
                           java.util.Map<java.lang.String,​java.lang.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​(java.lang.String sAppName,
                           java.lang.String sCommand,
                           java.lang.String sFileName,
                           java.io.File workDir,
                           java.util.Map<java.lang.String,​java.lang.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