pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1691486 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java
Date Fri, 17 Jul 2015 06:22:59 GMT
Author: msahyoun
Date: Fri Jul 17 06:22:58 2015
New Revision: 1691486

URL: http://svn.apache.org/r1691486
Log:
PDFBOX-2889: support AP generation for combo box

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java?rev=1691486&r1=1691485&r2=1691486&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDComboBox.java
Fri Jul 17 06:22:58 2015
@@ -16,6 +16,9 @@
  */
 package org.apache.pdfbox.pdmodel.interactive.form;
 
+import java.io.IOException;
+import java.util.List;
+
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 
@@ -71,4 +74,21 @@ public final class PDComboBox extends PD
     {
         dictionary.setFlag(COSName.FF, FLAG_EDIT, edit);
     }
+    
+    @Override
+    void constructAppearances() throws IOException
+    {
+        AppearanceGeneratorHelper apHelper;
+        apHelper = new AppearanceGeneratorHelper(this);
+        List<String> values = getValue();
+        
+        if (!values.isEmpty())
+        {
+            apHelper.setAppearanceValue(values.get(0));
+        }
+        else
+        {
+            apHelper.setAppearanceValue("");
+        }
+    }
 }



Mime
View raw message