poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1711707 - in /poi/trunk/src: java/org/apache/poi/sl/usermodel/TextParagraph.java ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
Date Sat, 31 Oct 2015 23:10:43 GMT
Author: kiwiwings
Date: Sat Oct 31 23:10:43 2015
New Revision: 1711707

URL: http://svn.apache.org/viewvc?rev=1711707&view=rev
Log:
Add method for setting bullet styles

Modified:
    poi/trunk/src/java/org/apache/poi/sl/usermodel/TextParagraph.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java

Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/TextParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/TextParagraph.java?rev=1711707&r1=1711706&r2=1711707&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/usermodel/TextParagraph.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/usermodel/TextParagraph.java Sat Oct 31 23:10:43
2015
@@ -332,6 +332,15 @@ public interface TextParagraph<
      * @return the bullet style of the paragraph, if {@code null} then no bullets are used

      */
     BulletStyle getBulletStyle();
+
+    /**
+     * Sets the bullet styles. If no styles are given, the bullets are omitted.
+     * Possible attributes are integer/double (bullet size), Color (bullet color),
+     * character (bullet character), string (bullet font), AutoNumberingScheme
+     *
+     * @param styles
+     */
+    void setBulletStyle(Object... styles);
     
     /**
      * @return the default size for a tab character within this paragraph in points, null
if unset

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java?rev=1711707&r1=1711706&r2=1711707&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java Sat Oct
31 23:10:43 2015
@@ -985,4 +985,26 @@ public class XSLFTextParagraph implement
 
         };
     }
+
+    @Override
+    public void setBulletStyle(Object... styles) {
+        if (styles.length == 0) {
+            setBullet(false);
+        } else {
+            setBullet(true);
+            for (Object ostyle : styles) {
+                if (ostyle instanceof Number) {
+                    setBulletFontSize(((Number)ostyle).doubleValue());
+                } else if (ostyle instanceof Color) {
+                    setBulletFontColor((Color)ostyle);
+                } else if (ostyle instanceof Character) {
+                    setBulletCharacter(ostyle.toString());
+                } else if (ostyle instanceof String) {
+                    setBulletFont((String)ostyle);
+                } else if (ostyle instanceof AutoNumberingScheme) {
+                    setBulletAutoNumber((AutoNumberingScheme)ostyle, 0);
+                }
+            }
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message