Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.StyleRecord


    /**
     * Sets the name of the user defined style.
     * Will complain if you try this on a built in style.
     */
    public void setUserStyleName(String styleName) {
      StyleRecord sr = workbook.getStyleRecord(index);
      if(sr == null) {
        sr = workbook.createStyleRecord(index);
      }
      if(sr.getType() == StyleRecord.STYLE_BUILT_IN) {
        throw new IllegalArgumentException("Unable to set user specified style names for built in styles!");
      }
      sr.setName(styleName);
    }
View Full Code Here


     * Gets the name of the user defined style.
     * Returns null for built in styles, and
     *  styles where no name has been defined
     */
    public String getUserStyleName() {
      StyleRecord sr = _workbook.getStyleRecord(_index);
      if(sr == null) {
        return null;
      }
      if(sr.isBuiltin()) {
        return null;
      }
      return sr.getName();
    }
View Full Code Here

    /**
     * Sets the name of the user defined style.
     * Will complain if you try this on a built in style.
     */
    public void setUserStyleName(String styleName) {
      StyleRecord sr = _workbook.getStyleRecord(_index);
      if(sr == null) {
        sr = _workbook.createStyleRecord(_index);
      }
      // All Style records start as "builtin", but generally
      //  only 20 and below really need to be
      if(sr.isBuiltin() && _index <= 20) {
        throw new IllegalArgumentException("Unable to set user specified style names for built in styles!");
      }
      sr.setName(styleName);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.StyleRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.