Package org.openoffice.da.comp.writer2latex

# Class ExternalApps

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

public class ExternalApps extends Object
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
Modifier and Type
Field
Description
`static final String`
`BIBTEX`
`static final short`
`BUILD`
`static final String`
`DVIPS`
`static final String`
`DVIVIEWER`
`static final short`
`EXPORT`
`static final String`
`LATEX`
`static final String`
`MAKEINDEX`
`static final String`
`MK4HT`
`static final String`
`PDFLATEX`
`static final String`
`PDFVIEWER`
`static final String`
`POSTSCRIPTVIEWER`
`static final short`
`PREVIEW`
`static final String`
`XELATEX`

## Constructor Summary

Constructors
Constructor
Description
`ExternalApps(com.sun.star.uno.XComponentContext xContext)`
Construct a new ExternalApps object with empty content

## Method Summary

Modifier and Type
Method
Description
`int`
`execute(String sAppName, String sFileName, File workDir, Map<String,String> env, boolean bWaitFor)`
Execute an external application
`int`
`execute(String sAppName, String sCommand, String sFileName, File workDir, Map<String,String> env, boolean bWaitFor)`
Execute an external application
`String[]`
`getApplication(String sAppName)`
Get the definition for an external application
`short`
`getProcessingLevel()`
Get the desired processing level (0: export only, 1: export and build, 2: export, build and preview)
`static String`
`getUIAppName(String sName)`
Return the localized name for an external app to use in the UI (only the viewers has a separate UI name)
`boolean`
`getUseDefaultApplication(String sAppName)`
Get the setting to use the system's default application
`boolean`
`isViewer(String sAppName)`
`void`
`load()`
Load the external applications from the registry
`void`
`save()`
Save the external applications to the registry
`void`
`setApplication(String sAppName, String sExecutable, String sOptions)`
Define an external application
`void`
`setProcessingLevel(short nLevel)`
Set the desired processing level (0: export only, 1: export and build, 2: export, build and preview)
`void`
`setUseDefaultApplication(String sAppName, boolean bUseDefault)`
Define to use the system's default for an external application.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### EXPORT

public static final short EXPORT

See Also:
  - Constant Field Values

### BUILD

public static final short BUILD

See Also:
  - Constant Field Values

### PREVIEW

public static final short PREVIEW

See Also:
  - Constant Field Values

### LATEX

public static final String LATEX

See Also:
  - Constant Field Values

### PDFLATEX

public static final String PDFLATEX

See Also:
  - Constant Field Values

### XELATEX

public static final String XELATEX

See Also:
  - Constant Field Values

### BIBTEX

public static final String BIBTEX

See Also:
  - Constant Field Values

### MAKEINDEX

public static final String MAKEINDEX

See Also:
  - Constant Field Values

### MK4HT

public static final String MK4HT

See Also:
  - Constant Field Values

### DVIPS

public static final String DVIPS

See Also:
  - Constant Field Values

### DVIVIEWER

public static final String DVIVIEWER

See Also:
  - Constant Field Values

### POSTSCRIPTVIEWER

public static final String POSTSCRIPTVIEWER

See Also:
  - Constant Field Values

### PDFVIEWER

public static final String PDFVIEWER

See Also:
  - Constant Field Values

## Constructor Details

### ExternalApps

public ExternalApps(com.sun.star.uno.XComponentContext xContext)
Construct a new ExternalApps object with empty content

## Method Details

### getUIAppName

public static String getUIAppName(String sName)
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

public boolean isViewer(String sAppName)

### 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

### setUseDefaultApplication

public void setUseDefaultApplication(String sAppName, boolean bUseDefault)
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 application
  `bUseDefault` - flag defining whether or not to use the default

### getUseDefaultApplication

public boolean getUseDefaultApplication(String sAppName)
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 use
  `workDir` - the working directory to use
  `env` - 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 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