001    package com.sptci.echo2.style;
002    
003    import nextapp.echo2.app.Border;
004    import nextapp.echo2.app.Color;
005    import nextapp.echo2.app.Insets;
006    
007    /**
008     * A general style class for buttons.  This simulates normal HTML buttons.
009     * This style does not include any <code>LayoutData</code> and may be used
010     * to embed button in any container.
011     *
012     * <p>Copyright 2006 Sans Pareil Technologies, Inc.</p>
013     * @author Rakesh Vidyadharan 2006-11-06
014     * @version $Id: Button.java 3334 2007-06-08 16:25:49Z rakesh $
015     */
016    public class Button extends General
017    {
018      /**
019       * Initialise the style properties.  Over-ridden to add style properties 
020       * for border, insets, line wrap etc.
021       */
022      @Override
023      protected void init()
024      {
025        super.init();
026        Color color = new Color( 0xffffff );
027        setProperty( nextapp.echo2.app.Button.PROPERTY_BACKGROUND, new Color( 0xf0f0f0 ) );
028        setProperty( nextapp.echo2.app.Button.PROPERTY_BORDER, 
029            new Border( 1, color, Border.STYLE_OUTSET ) );
030        setProperty( nextapp.echo2.app.Button.PROPERTY_INSETS, 
031            new Insets( Extent.getInstance( 0, Extent.PX ),
032                Extent.getInstance( 0, Extent.PX ) ) );
033        setProperty( nextapp.echo2.app.Button.PROPERTY_LINE_WRAP, false );
034        setProperty( nextapp.echo2.app.Button.PROPERTY_PRESSED_ENABLED, true );
035        setProperty( nextapp.echo2.app.Button.PROPERTY_PRESSED_BORDER, 
036            new Border( 1, color, Border.STYLE_INSET ) );
037      }
038    }