Class ExternalApps
java.lang.Object
org.openoffice.da.comp.writer2latex.ExternalApps
This class manages and executes external applications used by the Writer2LaTeX toolbar.
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 -
Constructor Summary
ConstructorsConstructorDescriptionExternalApps(com.sun.star.uno.XComponentContext xContext) Construct a new ExternalApps object with empty content -
Method Summary
Modifier and TypeMethodDescriptionintExecute an external applicationintexecute(String sAppName, String sCommand, String sFileName, File workDir, Map<String, String> env, boolean bWaitFor) Execute an external applicationString[]getApplication(String sAppName) Get the definition for an external applicationshortGet the desired processing level (0: export only, 1: export and build, 2: export, build and preview)static StringgetUIAppName(String sName) Return the localized name for an external app to use in the UI (only the viewers has a separate UI name)booleangetUseDefaultApplication(String sAppName) Get the setting to use the system's default applicationbooleanvoidload()Load the external applications from the registryvoidsave()Save the external applications to the registryvoidsetApplication(String sAppName, String sExecutable, String sOptions) Define an external applicationvoidsetProcessingLevel(short nLevel) Set the desired processing level (0: export only, 1: export and build, 2: export, build and preview)voidsetUseDefaultApplication(String sAppName, boolean bUseDefault) Define to use the system's default for an external application.
-
Field Details
-
EXPORT
public static final short EXPORT- See Also:
-
BUILD
public static final short BUILD- See Also:
-
PREVIEW
public static final short PREVIEW- See Also:
-
LATEX
- See Also:
-
PDFLATEX
- See Also:
-
XELATEX
- See Also:
-
BIBTEX
- See Also:
-
MAKEINDEX
- See Also:
-
MK4HT
- See Also:
-
DVIPS
- See Also:
-
DVIVIEWER
- See Also:
-
POSTSCRIPTVIEWER
- See Also:
-
PDFVIEWER
- See Also:
-
-
Constructor Details
-
ExternalApps
public ExternalApps(com.sun.star.uno.XComponentContext xContext) Construct a new ExternalApps object with empty content
-
-
Method Details
-
getUIAppName
Return the localized name for an external app to use in the UI (only the viewers has a separate UI name)- Parameters:
sName- the app name- Returns:
- the UI name
-
setProcessingLevel
public void setProcessingLevel(short nLevel) Set the desired processing level (0: export only, 1: export and build, 2: export, build and preview)- Parameters:
nLevel- the desired level
-
getProcessingLevel
public short getProcessingLevel()Get the desired processing level (0: export only, 1: export and build, 2: export, build and preview)- Returns:
- the level
-
isViewer
-
setApplication
Define an external application- Parameters:
sAppName- the name of the application to definesExecutable- the system dependent path to the executable filesOptions- the options to the external application; %s will be replaced by the filename on execution
-
getApplication
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
-
setUseDefaultApplication
Define to use the system's default for an external application. This is only possible if the application is a viewer, otherwise setting the value to true will be ignored- Parameters:
sAppName- the name of the applicationbUseDefault- flag defining whether or not to use the default
-
getUseDefaultApplication
Get the setting to use the system's default application- Parameters:
sAppName- the name of the application- Returns:
- true if the system's default should be used, false if not or 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 (ignored for default apps)sFileName- the file name to useworkDir- the working directory to useenv- map of environment variables to set (or null if no variables needs to be set, ignored for default apps)bWaitFor- true if the method should wait for the execution to finish (ignored for default apps)- 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 executesCommand- subcommand/option to pass to the commandsFileName- the file name to useworkDir- the working directory to useenv- 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
-