diff --git a/scripting/java/build.xml b/scripting/java/build.xml
index 63d037b09d03..9a4499bc467e 100755
--- a/scripting/java/build.xml
+++ b/scripting/java/build.xml
@@ -3,9 +3,9 @@
#
# $RCSfile: build.xml,v $
#
-# $Revision: 1.11 $
+# $Revision: 1.12 $
#
-# last change: $Author: toconnor $ $Date: 2003-01-21 15:45:59 $
+# last change: $Author: toconnor $ $Date: 2003-01-30 16:22:15 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -93,6 +93,12 @@
+
+
+
+
+
@@ -125,11 +131,12 @@
-
+
+
@@ -194,6 +201,7 @@
+
diff --git a/scripting/java/org/openoffice/idesupport/OfficeDocument.java b/scripting/java/org/openoffice/idesupport/OfficeDocument.java
index 6764aed988ff..c7caa81fc64a 100644
--- a/scripting/java/org/openoffice/idesupport/OfficeDocument.java
+++ b/scripting/java/org/openoffice/idesupport/OfficeDocument.java
@@ -2,9 +2,9 @@
*
* $RCSfile: OfficeDocument.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:30 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,10 +77,8 @@ public class OfficeDocument
ParcelZipper.PARCEL_PREFIX_DIR;
public static final String[] OFFICE_EXTENSIONS = {".sxc" , ".sxw"};
- public static final String ARCHIVE_TAG = "[PARCEL_FILE]";
public static final String OFFICE_PRODUCT_NAME = "OpenOffice.org";
- private static ParcelZipper zipper = ParcelZipper.getParcelZipper();
private File file = null;
public OfficeDocument(File file) throws IllegalArgumentException
@@ -116,10 +114,8 @@ public class OfficeDocument
String tmp = ze.getName();
int end = tmp.lastIndexOf("/");
tmp = tmp.substring(0, end);
- int start = tmp.lastIndexOf("/") + 1;
- String parcelName = ARCHIVE_TAG +
- ze.getName().substring(start, end);
+ String parcelName = ze.getName().substring(0, end);
parcels.add(parcelName);
}
}
@@ -143,15 +139,10 @@ public class OfficeDocument
return parcels.elements();
}
- public String getParcelEntryFromName(String parcelName) {
- return parcelName.substring(ARCHIVE_TAG.length()) + "/";
- }
-
public boolean removeParcel(String parcelName) {
try {
- ParcelZipper.getParcelZipper().removeParcel(
- file, getParcelEntryFromName(parcelName));
+ ParcelZipper.getParcelZipper().removeParcel(file, parcelName);
}
catch (IOException ioe) {
ioe.printStackTrace();
diff --git a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
index 40e3a3893d12..fff981842dcd 100644
--- a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
+++ b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
@@ -2,9 +2,9 @@
*
* $RCSfile: SVersionRCFile.java,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:30 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,6 +97,7 @@ public class SVersionRCFile {
private static final HashMap files = new HashMap(3);
private File sverionrc = null;
+ private String defaultversion = null;
private long lastModified = 0;
public SVersionRCFile() {
@@ -150,6 +151,14 @@ public class SVersionRCFile {
return buf.toString();
}
+ public String getDefaultVersion() throws IOException {
+ if (defaultversion == null) {
+ getVersions();
+ }
+
+ return defaultversion;
+ }
+
public Hashtable getVersions() throws IOException {
BufferedReader br;
@@ -183,8 +192,11 @@ public class SVersionRCFile {
String name = tokens.nextToken();
String path = tokens.nextToken();
OfficeInstallation oi = new OfficeInstallation(name, path);
- if (oi.supportsFramework())
+ if (oi.supportsFramework()) {
versions.put(name, oi.getPath());
+ if (defaultversion == null)
+ defaultversion = oi.getPath();
+ }
}
return versions;
}
diff --git a/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java b/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
index ba6881ad4fee..d77f1be365a1 100644
--- a/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
+++ b/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ConfigurePanel.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:31 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,7 +62,7 @@
package org.openoffice.idesupport.ui;
import java.io.File;
-import java.io.FileNotFoundException;
+import java.io.IOException;
import java.util.Vector;
import java.util.Enumeration;
@@ -107,7 +107,7 @@ public class ConfigurePanel extends JPanel {
}
public ConfigurePanel(String basedir, Vector classpath)
- throws FileNotFoundException {
+ throws IOException {
this.basedir = new File(basedir);
this.classpath = classpath;
@@ -134,7 +134,7 @@ public class ConfigurePanel extends JPanel {
}
public void reload(String basedir, Vector classpath)
- throws FileNotFoundException {
+ throws IOException {
if (basedir != null)
this.basedir = new File(basedir);
diff --git a/scripting/java/org/openoffice/idesupport/xml/Manifest.java b/scripting/java/org/openoffice/idesupport/xml/Manifest.java
index 86f2b335cf0c..c442e55476f1 100644
--- a/scripting/java/org/openoffice/idesupport/xml/Manifest.java
+++ b/scripting/java/org/openoffice/idesupport/xml/Manifest.java
@@ -2,9 +2,9 @@
*
* $RCSfile: Manifest.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:31 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,7 +85,7 @@ public class Manifest {
private Document document = null;
private boolean baseElementsExist = false;
- public Manifest(InputStream inputStream) {
+ public Manifest(InputStream inputStream) throws IOException {
document = XMLParserFactory.getParser().parse(inputStream);
}
diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
index 594ce3a5b15f..e2546617c808 100644
--- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
+++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ParcelZipper.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:32 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -327,8 +327,11 @@ public class ParcelZipper
ZipOutputStream outStream;
Manifest manifest;
+ String language = getParcelLanguage(parcel);
+
if (isDocumentOverwriteNeeded(parcel, targetDocument)) {
- String parcelName = getParcelDirFromParcelZip(parcel.getName());
+ String parcelName = language + "/" +
+ getParcelDirFromParcelZip(parcel.getName());
removeParcel(targetDocument, parcelName);
}
@@ -336,7 +339,6 @@ public class ParcelZipper
File tmpfile = new File(targetDocument.getAbsolutePath() + ".tmp");
manifest = addParcelToManifest(targetDocument, parcel);
- String language = getParcelLanguage(parcel);
documentStream =
new ZipInputStream(new FileInputStream(targetDocument));
@@ -425,7 +427,8 @@ public class ParcelZipper
ZipOutputStream outStream;
Manifest manifest = null;
- parcelName = PARCEL_PREFIX_DIR + parcelName;
+ if (!parcelName.startsWith(PARCEL_PREFIX_DIR))
+ parcelName = PARCEL_PREFIX_DIR + parcelName;
manifest = removeParcelFromManifest(document, parcelName);
// first write contents of document to tmpfile
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
index a91500cc1709..742e96017090 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ParcelFolderSupport.java,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: toconnor $ $Date: 2003-01-28 20:52:33 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,8 +169,8 @@ public class ParcelFolderSupport implements ParcelFolderCookie
else
configuror.reload(contents.getAbsolutePath(), classpath);
}
- catch (FileNotFoundException fnfe) {
- ErrorManager.getDefault().notify(fnfe);
+ catch (IOException ioe) {
+ ErrorManager.getDefault().notify(ioe);
}
DialogDescriptor descriptor = new DialogDescriptor(configuror,
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java
index 2746d021ec31..53ca831a8c60 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java
@@ -2,9 +2,9 @@
*
* $RCSfile: OfficeDocumentChildren.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:37 $
+ * last change: $Author: toconnor $ $Date: 2003-01-30 16:22:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,7 +73,8 @@ import org.openide.util.HelpCtx;
import org.openoffice.netbeans.modules.office.actions.OfficeDocumentCookie;
-public class OfficeDocumentChildren extends Children.Keys implements ChangeListener {
+public class OfficeDocumentChildren extends Children.Keys
+ implements ChangeListener {
private OfficeDocumentCookie document = null;
@@ -135,7 +136,7 @@ public class OfficeDocumentChildren extends Children.Keys implements ChangeListe
setIconBase("/org/openoffice/netbeans/modules/office/resources/OfficeIcon");
setName(name);
- setDisplayName(name.substring(name.lastIndexOf(".") + 1));
+ setDisplayName(name.substring(name.lastIndexOf("/") + 1));
setShortDescription(name);
}