Package net.rim.blackberry.api.messagelist

Examples of net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry


    /**
     * @see ScriptableFunctionBase#execute(Object, Object[])
     */
    public Object execute( Object thiz, Object[] args ) {
        ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
        ApplicationIndicator indicator = reg.getApplicationIndicator();
        if( indicator != null ) {
            indicator.setVisible( false );
        }
        return UNDEFINED;
    }
View Full Code Here


    /**
     * @see ScriptableFunctionBase#execute(Object, Object[])
     */
    public Object execute( Object thiz, Object[] args ) {
        ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();

        EncodedImage image = EncodedImage.getEncodedImageResource( (String) args[ 0 ] );
        if( image == null ) {
            throw new IllegalArgumentException( "Icon was not found." );
        }
        try {
            ApplicationIcon icon = new ApplicationIcon( image );

            if( reg.getApplicationIndicator() != null ) {
                reg.unregister();
            }

            ApplicationIndicator indicator;
            if( args.length > 1 ) {
                // Set icon and value
                indicator = reg.register( icon, false, false );
                indicator.set( icon, ( (Integer) args[ 1 ] ).intValue() );
            } else {
                // Set icon only
                indicator = reg.register( icon, true, false );
                indicator.setIcon( icon );
            }
            indicator.setVisible( true );

        } catch( IllegalArgumentException e ) {
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry

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.