001    /*
002     * This file is part of the Echo Point Project.  This project is a
003     * collection of Components that have extended the Echo Web Application
004     * Framework Version 3.
005     *
006     * Version: MPL 1.1
007     *
008     * The contents of this file are subject to the Mozilla Public License Version
009     * 1.1 (the "License"); you may not use this file except in compliance with
010     * the License. You may obtain a copy of the License at
011     * http://www.mozilla.org/MPL/
012     *
013     * Software distributed under the License is distributed on an "AS IS" basis,
014     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015     * for the specific language governing rights and limitations under the
016     * License.
017     */
018    
019    package echopoint.style.echo.extras;
020    
021    import nextapp.echo.app.Border;
022    import static nextapp.echo.app.Border.STYLE_SOLID;
023    import nextapp.echo.app.Border.Side;
024    import nextapp.echo.app.FillImage;
025    import static nextapp.echo.app.FillImage.REPEAT;
026    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_BACKGROUND;
027    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_BACKGROUND_IMAGE;
028    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_BORDER;
029    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_FOREGROUND;
030    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_ROLLOVER_BACKGROUND;
031    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_ROLLOVER_BACKGROUND_IMAGE;
032    import static nextapp.echo.extras.app.AccordionPane.PROPERTY_TAB_ROLLOVER_ENABLED;
033    
034    import echopoint.style.AbstractStyle;
035    import static echopoint.style.echo.extras.ResourceImages.BlueGrey;
036    import static echopoint.style.echo.extras.ResourceImages.BlueGreyHighlight;
037    import static echopoint.util.ColorKit.makeColor;
038    import static echopoint.util.ExtentKit.makeExtent;
039    
040    /**
041     * The default style to apply to {@link nextapp.echo.extras.app.AccordionPane}
042     * components.
043     *
044     * @author Rakesh Vidyadharan 2009-05-26
045     * @version $Id: AccordionPaneStyle.java 255 2009-11-29 12:16:16Z sptrakesh $
046     */
047    public class AccordionPaneStyle extends AbstractStyle
048    {
049      private static final long serialVersionUID = 1L;
050    
051      /** {@inheritDoc} */
052      @Override
053      protected void init()
054      {
055        super.init();
056    
057        set( PROPERTY_TAB_BACKGROUND, makeColor( "#514f58" ) );
058        set( PROPERTY_TAB_BACKGROUND_IMAGE,
059            new FillImage( BlueGrey, makeExtent( "0px" ), makeExtent( "50%" ), REPEAT ) );
060        set( PROPERTY_TAB_FOREGROUND, makeColor( "#ffffff" ) );
061    
062        setBorder();
063        setRollover();
064      }
065    
066      protected void setRollover()
067      {
068        set( PROPERTY_TAB_ROLLOVER_BACKGROUND, makeColor( "#86899a" ) );
069        set( PROPERTY_TAB_ROLLOVER_BACKGROUND_IMAGE,
070            new FillImage( BlueGreyHighlight, makeExtent( "0px" ),
071                makeExtent( "50%" ), REPEAT ) );
072        set( PROPERTY_TAB_ROLLOVER_ENABLED, true );
073      }
074    
075      /** Set the tab border style. */
076      protected void setBorder()
077      {
078        set( PROPERTY_TAB_BORDER, new Border( new Side[]
079            {
080                new Side( 1, makeColor( "#817f88" ), STYLE_SOLID ),
081                new Side( 0, makeColor( "#817f88" ), STYLE_SOLID ),
082                new Side( 1, makeColor( "#312f38" ), STYLE_SOLID ),
083                new Side( 0, makeColor( "#312f38" ), STYLE_SOLID )
084            } ) );
085      }
086    }