//~ Methods
protected void doRun()
{
PerlEditor editor = getEditor();
IFileEditorInput editorInput = (IFileEditorInput) editor.getEditorInput();
String filePath = editorInput.getFile().getLocation().makeAbsolute().toString();
// Display directory dialog
DirectoryDialog directoryDialog =
new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.SAVE);
directoryDialog.setText("Select Output Directory");
directoryDialog.setMessage("HTML Export...");
directoryDialog.setFilterPath(lastSelectedDir);
String outputDir = directoryDialog.open();
if (outputDir == null) return;
lastSelectedDir = outputDir;
// Export options
List cmdList = new ArrayList();
cmdList.add("-html");
cmdList.add("-opath");
cmdList.add(outputDir);
// Add additional options
IPreferenceStore store = PerlEditorPlugin.getDefault().getPreferenceStore();
StringTokenizer st =
new StringTokenizer(store.getString(
SourceFormatterPreferences.HTML_EXPORT_OPTIONS));
while (st.hasMoreTokens())
{
cmdList.add(st.nextToken());
}
// last thing has to be the input file name
cmdList.add(filePath);
try
{
SourceFormatter.format(
editor.getViewer().getDocument().get(),
cmdList,
getLog());
}
catch (CoreException e)
{