Package org.apache.poi.hssf.record

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


     *  records collection
     */
    public StyleRecord createStyleRecord(int xfIndex) {
        // Style records always follow after
        //  the ExtendedFormat records
        StyleRecord newSR = new StyleRecord();
        newSR.setXFIndex(xfIndex);

        // Find the spot
        int addAt = -1;
        for(int i=records.getXfpos(); i<records.size() &&
                addAt == -1; i++) {
View Full Code Here


     * Creates a StyleRecord object
     * @param id        the number of the style record to create (meaning its position in
     *                  a file as MS Excel would create it.
     */
    private static StyleRecord createStyle(int id) {   // we'll need multiple editions
        StyleRecord retval = new StyleRecord();

        switch (id) {

            case 0 :
                retval.setXFIndex(0x010);
                retval.setBuiltinStyle(3);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 1 :
                retval.setXFIndex(0x011);
                retval.setBuiltinStyle(6);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 2 :
                retval.setXFIndex(0x012);
                retval.setBuiltinStyle(4);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 3 :
                retval.setXFIndex(0x013);
                retval.setBuiltinStyle(7);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 4 :
                retval.setXFIndex(0x000);
                retval.setBuiltinStyle(0);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 5 :
                retval.setXFIndex(0x014);
                retval.setBuiltinStyle(5);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;
        }
        return retval;
    }
View Full Code Here

                continue;
            }
            if(!(r instanceof StyleRecord)) {
                return null;
            }
            StyleRecord sr = (StyleRecord)r;
            if(sr.getXFIndex() == xfIndex) {
                return sr;
            }
        }
        return null;
    }
View Full Code Here

                continue;
            }
            if(!(r instanceof StyleRecord)) {
                return null;
            }
            StyleRecord sr = (StyleRecord)r;
            if(sr.getXFIndex() == xfIndex) {
                return sr;
            }
        }
        return null;
    }
View Full Code Here

     *  records collection
     */
    public StyleRecord createStyleRecord(int xfIndex) {
        // Style records always follow after
        //  the ExtendedFormat records
        StyleRecord newSR = new StyleRecord();
        newSR.setXFIndex(xfIndex);
       
        // Find the spot
        int addAt = -1;
        for(int i=records.getXfpos(); i<records.size() &&
                addAt == -1; i++) {
View Full Code Here

     * Creates a StyleRecord object
     * @param id        the number of the style record to create (meaning its position in
     *                  a file as MS Excel would create it.
     */
    private static StyleRecord createStyle(int id) {   // we'll need multiple editions
        StyleRecord retval = new StyleRecord();

        switch (id) {

            case 0 :
                retval.setXFIndex(0x010);
                retval.setBuiltinStyle(3);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 1 :
                retval.setXFIndex(0x011);
                retval.setBuiltinStyle(6);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 2 :
                retval.setXFIndex(0x012);
                retval.setBuiltinStyle(4);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 3 :
                retval.setXFIndex(0x013);
                retval.setBuiltinStyle(7);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 4 :
                retval.setXFIndex(0x000);
                retval.setBuiltinStyle(0);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;

            case 5 :
                retval.setXFIndex(0x014);
                retval.setBuiltinStyle(5);
                retval.setOutlineStyleLevel(( byte ) 0xffffffff);
                break;
        }
        return retval;
    }
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);
      }
      if(sr.isBuiltin()) {
        throw new IllegalArgumentException("Unable to set user specified style names for built in styles!");
      }
      sr.setName(styleName);
    }
View Full Code Here

                continue;
            }
            if(!(r instanceof StyleRecord)) {
                continue;
            }
            StyleRecord sr = (StyleRecord)r;
            if(sr.getXFIndex() == xfIndex) {
                return sr;
            }
        }
        return null;
    }
View Full Code Here

     *  records collection
     */
    public StyleRecord createStyleRecord(int xfIndex) {
        // Style records always follow after
        //  the ExtendedFormat records
        StyleRecord newSR = new StyleRecord();
        newSR.setXFIndex(xfIndex);

        // Find the spot
        int addAt = -1;
        for(int i=records.getXfpos(); i<records.size() &&
                addAt == -1; i++) {
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.