aboutsummaryrefslogtreecommitdiffstats
path: root/src/contrib
diff options
context:
space:
mode:
authorRainer Klute <klute@apache.org>2006-03-03 16:57:55 +0000
committerRainer Klute <klute@apache.org>2006-03-03 16:57:55 +0000
commit73a9af683f7c986421d12e07e680111d94a609c4 (patch)
treeb315b5320a537d72619cae55c393357f4737b5c0 /src/contrib
parenta36d020021bb41eade6d653005ef42f60a0a609a (diff)
downloadpoi-73a9af683f7c986421d12e07e680111d94a609c4.tar.gz
poi-73a9af683f7c986421d12e07e680111d94a609c4.zip
* Writing support added to the SummaryInformation and DocumentSummaryInformation classes. These classes now have methods for setting and removing properties. Coherent extensions are:
** Documentation section about writing standard properties added to the HPSF HOW-TO. ** Example application added showing how to modify the document summary information. ** Testcases added for testing modifying summary information and document summary information. ** PropertySetFactory extended to create SummaryInformation and DocumentSummaryInformation instances. * Added MutablePropertySet.write(DirectoryEntry, String) to ease writing a property set to a POI filesystem document. * Improved codepage handling. * Bug fixed: Integral values were read and written as unsigned instead of signed. * Reworked the mapping between variant types and Java types: Variant.VT_I4 is mapped to Integer now and Variant.VT_I8 to Long. This might cause incompatibilities if you are doing low-level HPSF programming. * Changed SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID from a byte[] to a byte[][] in order to contain the format ID of the first and the second section. This is an incompatible change! * Added PropertySet.getFirstSection(). This method is similar to getSingleSection() won't choke if the property set has more than one section. * Support for low-level reading and writing of Variant.VT_I8 type properties added. * Unnecessary casts removed. * Poibrowser's display format changed slightly. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@382887 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/contrib')
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java2
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptor.java3
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java19
3 files changed, 16 insertions, 8 deletions
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
index 0c998c3235..ffd45af237 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
@@ -128,7 +128,7 @@ public class POIBrowser extends JFrame
new PropertySetDescriptorRenderer());
treeUI.setCellRenderer(etcr);
setSize(600, 450);
- setTitle("POI Browser 0.08");
+ setTitle("POI Browser 0.09");
setVisible(true);
}
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptor.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptor.java
index 9e6500c1b7..bd7f584363 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptor.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptor.java
@@ -25,7 +25,6 @@ import org.apache.poi.hpsf.MarkUnsupportedException;
import org.apache.poi.hpsf.NoPropertySetStreamException;
import org.apache.poi.hpsf.PropertySet;
import org.apache.poi.hpsf.PropertySetFactory;
-import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
@@ -70,7 +69,7 @@ public class PropertySetDescriptor extends DocumentDescriptor
final POIFSDocumentPath path,
final DocumentInputStream stream,
final int nrOfBytesToDump)
- throws UnexpectedPropertySetTypeException, NoPropertySetStreamException,
+ throws NoPropertySetStreamException,
MarkUnsupportedException, UnsupportedEncodingException,
IOException
{
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
index 3b17803b0d..8aac2a1519 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
@@ -127,6 +127,9 @@ public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
/**
* <p>Returns a string representation of a {@link Section}.</p>
+ * @param s the section
+ * @param name the section's name
+ * @return a string representation of the {@link Section}
*/
protected String toString(final Section s, final String name)
{
@@ -141,12 +144,18 @@ public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
for (int i = 0; i < properties.length; i++)
{
final Property p = properties[i];
+ final long id = p.getID();
+ final long type = p.getType();
final Object value = p.getValue();
- b.append("\n" + name + " ");
- b.append("PID_");
- b.append(p.getID());
- b.append(' ');
- b.append(s.getPIDString(p.getID()) + ": ");
+ b.append('\n');
+ b.append(name);
+ b.append(", Name: ");
+ b.append(id);
+ b.append(" (");
+ b.append(s.getPIDString(id));
+ b.append("), Type: ");
+ b.append(type);
+ b.append(", Value: ");
if (value instanceof byte[])
{
byte[] b2 = (byte[]) value;