summaryrefslogtreecommitdiff
path: root/scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java')
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java
index 0237872185bf..c77fc63a7cbc 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/OfficeDocumentSupport.java
@@ -44,8 +44,8 @@ import org.openoffice.netbeans.modules.office.loader.OfficeDocumentDataObject;
import org.openoffice.netbeans.modules.office.utils.ZipMounter;
import org.openoffice.netbeans.modules.office.utils.ManifestParser;
-public class OfficeDocumentSupport implements OfficeDocumentCookie, OpenCookie, FileChangeListener
-{
+public class OfficeDocumentSupport implements OfficeDocumentCookie, OpenCookie,
+ FileChangeListener {
protected OfficeDocumentDataObject dataObj;
private boolean isMounted = false;
private OfficeDocument document;
@@ -54,12 +54,13 @@ public class OfficeDocumentSupport implements OfficeDocumentCookie, OpenCookie,
public OfficeDocumentSupport(OfficeDocumentDataObject dataObj) {
this.dataObj = dataObj;
FileObject fo = dataObj.getPrimaryFile();
+
try {
this.document = new OfficeDocument(FileUtil.toFile(fo));
- }
- catch (Exception e) {
+ } catch (Exception e) {
e.printStackTrace();
}
+
fo.addFileChangeListener(this);
}
@@ -69,26 +70,24 @@ public class OfficeDocumentSupport implements OfficeDocumentCookie, OpenCookie,
try {
ZipMounter.getZipMounter().mountZipFile(file);
isMounted = true;
- }
- catch (IOException ioe) {
+ } catch (IOException ioe) {
ErrorManager.getDefault().notify(ioe);
- }
- catch (PropertyVetoException pve) {
+ } catch (PropertyVetoException pve) {
ErrorManager.getDefault().notify(pve);
}
}
- public void open () {
+ public void open() {
File file = FileUtil.toFile(dataObj.getPrimaryFile());
OfficeSettings settings = OfficeSettings.getDefault();
File soffice = new File(settings.getOfficeDirectory().getPath(
- File.separator + "soffice"));
+ File.separator + "soffice"));
try {
- Process p = Runtime.getRuntime ().exec (new String[] {
- soffice.getAbsolutePath(), file.getAbsolutePath ()
- });
+ Process p = Runtime.getRuntime().exec(new String[] {
+ soffice.getAbsolutePath(), file.getAbsolutePath()
+ });
} catch (IOException ioe) {
ErrorManager.getDefault().notify(ioe);
}