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.extras.app.ContextMenu.PROPERTY_ANIMATION_TIME;
026 import static nextapp.echo.extras.app.ContextMenu.PROPERTY_BACKGROUND_IMAGE;
027 import static nextapp.echo.extras.app.ContextMenu.PROPERTY_BORDER;
028 import static nextapp.echo.extras.app.ContextMenu.PROPERTY_DISABLED_BACKGROUND_IMAGE;
029 import static nextapp.echo.extras.app.ContextMenu.PROPERTY_SELECTION_BACKGROUND_IMAGE;
030
031 import echopoint.style.AbstractStyle;
032 import static echopoint.style.echo.extras.ResourceImages.BlueGrey;
033 import static echopoint.style.echo.extras.ResourceImages.LightBlueLine;
034 import static echopoint.util.ColorKit.makeColor;
035
036 /**
037 * The default style to apply to {@link nextapp.echo.extras.app.ContextMenu}
038 * components.
039 *
040 * @author Rakesh Vidyadharan 2009-08-23
041 * @version $Id: ContextMenuStyle.java 255 2009-11-29 12:16:16Z sptrakesh $
042 */
043 public class ContextMenuStyle extends AbstractStyle
044 {
045 private static final long serialVersionUID = 1L;
046
047 @Override
048 protected void init()
049 {
050 super.init();
051
052 set( PROPERTY_ANIMATION_TIME, 350 );
053 set( PROPERTY_BACKGROUND_IMAGE, new FillImage( LightBlueLine ) );
054
055 final Side[] sides = new Side[]
056 {
057 new Side( 1, makeColor( "#dfdfef" ), STYLE_SOLID ),
058 new Side( 1, makeColor( "#dfdfef" ), STYLE_SOLID ),
059 new Side( 1, makeColor( "#7f7f8f" ), STYLE_SOLID ),
060 new Side( 1, makeColor( "#7f7f8f" ), STYLE_SOLID )
061 };
062 set( PROPERTY_BORDER, new Border( sides ) );
063
064 set( PROPERTY_DISABLED_BACKGROUND_IMAGE, new FillImage( BlueGrey ) );
065 set( PROPERTY_SELECTION_BACKGROUND_IMAGE, new FillImage( BlueGrey ) );
066 }
067 }