Package net.rim.blackberry.api.messagelist

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


    /**
     * @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


            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 ) {
            // According to the Java API, IllegalArgumentException will only
            // occur when the icon is too big.
            throw new IllegalArgumentException( "Icon is too big." );
View Full Code Here

     * @param value
     *            The amount by which the indicator must change
     */
    public static void changeIndicator(final int value) {
        // Update indicator
        final ApplicationIndicator indicator =
                ApplicationIndicatorRegistry.getInstance()
                        .getApplicationIndicator();
        if (indicator == null) {
            return;
        }

        indicator.setValue(indicator.getValue() + value);

        // Check if there are any new messages and show indicator accordingly
        if (indicator.getValue() <= 0) {
            indicator.setVisible(false);
        } else {
            indicator.setVisible(true);
        }
    }
View Full Code Here

        // Check if user opened the Message list and marked messages as not
        // 'new'
        if (action == ApplicationMessageFolderListener.MESSAGES_MARKED_OLD) {
            // User opened the message list and viewed messages, remove the
            // 'notification' state from the indicator.
            final ApplicationIndicator indicator =
                    ApplicationIndicatorRegistry.getInstance()
                            .getApplicationIndicator();
            if (indicator != null) {
                indicator.setNotificationState(false);
            }

            // No further processing
            return;
        }
View Full Code Here

TOP

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

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.