Examples of EventNotification


Examples of net.java.sip.communicator.impl.notification.EventNotification

     */
    public void registerNotificationForEvent(   String eventType,
                                                String actionType,
                                                NotificationActionHandler handler)
    {
        EventNotification notification = null;

        if(notificationsTable.containsKey(eventType))
            notification = notificationsTable.get(eventType);
        else
        {
            notification = new EventNotification(eventType);
           
            notificationsTable.put(eventType, notification);
           
            this.fireNotificationEventTypeEvent(
                NotificationEventTypeEvent.EVENT_TYPE_ADDED, eventType);
        }

        Object existingAction = notification.addAction(actionType, handler);

        // We fire the appropriate event depending on whether this is an
        // already existing actionType or a new one.
        if (existingAction != null)
        {
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

     * specified event occurs (could be one of the ACTION_XXX fields).
     */
    public void removeEventNotificationActionString eventType,
                                                String actionType)
    {
        EventNotification notification
            = notificationsTable.get(eventType);
       
        if(notification == null)
            return;

        Action action = notification.getAction(actionType);
       
        if(action == null)
            return;

        notification.removeAction(actionType);
       
        saveNotification(
            eventType,
            actionType,
            action.getActionHandler(),
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

     * an event with the specified name has occurred, or null if no actions
     * have been defined for <tt>eventType</tt>.
     */
    public Map<String, NotificationActionHandler> getEventNotifications(String eventType)
    {
        EventNotification notification = notificationsTable.get(eventType);

        if(notification == null)
            return null;

        Hashtable<String, NotificationActionHandler> actions
            = new Hashtable<String, NotificationActionHandler>();

        for (Object value : notification.getActions().values())
        {
            Action action = (Action) value;
            NotificationActionHandler handler = action.getActionHandler();

            actions.put(action.getActionType(), handler);
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

     */
    public NotificationActionHandler getEventNotificationActionHandler(
                                                            String eventType,
                                                            String actionType)
    {
        EventNotification notification
            = notificationsTable.get(eventType);

        if(notification == null)
            return null;

        EventNotification.Action action = notification.getAction(actionType);

        if(action == null)
            return null;

        return action.getActionHandler();
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

        String title,
        String message,
        byte[] icon,
        Object tag)
    {
        EventNotification notification
            = notificationsTable.get(eventType);

        if(notification == null || !notification.isActive())
            return;

        Iterator<Action> actions = notification.getActions().values().iterator();

        while(actions.hasNext())
        {
            Action action = actions.next();
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

                                                            commandDescriptor);
                    handler.setEnabled(isEnabled(actionPropName + ".enabled"));
                }

                // Load the data in the notifications table.
                EventNotification notification
                    = notificationsTable.get(eventType);
                   
                if(notification == null)
                {
                    notification = new EventNotification(eventType);
                    notificationsTable.put(eventType, notification);
                }
                notification.setActive(isEventActive);

                notification.addAction(actionType, handler);
            }
        }
    }
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

     * @param isActive indicates whether to activate or deactivate the actions
     * related to the specified <tt>eventType</tt>.
     */
    public void setActive(String eventType, boolean isActive)
    {
        EventNotification eventNotification
            = notificationsTable.get(eventType);
       
        if(eventNotification == null)
            return;
       
        eventNotification.setActive(isActive);
       
        saveNotification(eventType, null, null, isActive, false);
    }
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

     * <tt>eventType</tt> is not contained in the list of registered event
     * types - returns <code>false</code>.
     */
    public boolean isActive(String eventType)
    {
        EventNotification eventNotification
            = notificationsTable.get(eventType);
       
        if(eventNotification == null)
            return false;
       
        return eventNotification.isActive();
    }
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

                                    actionType,
                                    handler,
                                    h.isEnabled(),
                                    true);

            EventNotification notification = null;

            if(notificationsTable.containsKey(eventType))
                notification = notificationsTable.get(eventType);
            else
            {
                notification = new EventNotification(eventType);

                notificationsTable.put(eventType, notification);
            }

            notification.addAction(actionType, handler);

            // We fire the appropriate event depending on whether this is an
            // already existing actionType or a new one.
            fireNotificationActionTypeEvent(
                isNew ? NotificationActionTypeEvent.ACTION_ADDED
                    : NotificationActionTypeEvent.ACTION_CHANGED, eventType,
                actionType, handler);
        }

        // now store this default events if we want to restore them
        EventNotification notification = null;

        if(defaultNotificationsTable.containsKey(eventType))
            notification = defaultNotificationsTable.get(eventType);
        else
        {
            notification = new EventNotification(eventType);
           
            defaultNotificationsTable.put(eventType, notification);
        }

        notification.addAction(actionType, handler);
    }
View Full Code Here

Examples of net.java.sip.communicator.impl.notification.EventNotification

                                    actionType,
                                    handler,
                                    handler.isEnabled(),
                                    true);

            EventNotification notification = null;

            if(notificationsTable.containsKey(eventType))
                notification = notificationsTable.get(eventType);
            else
            {
                notification = new EventNotification(eventType);

                notificationsTable.put(eventType, notification);
            }
           
            notification.addAction(actionType, handler);
           
            // We fire the appropriate event depending on whether this is an
            // already existing actionType or a new one.
            fireNotificationActionTypeEvent(
                isNew ? NotificationActionTypeEvent.ACTION_ADDED
                    : NotificationActionTypeEvent.ACTION_CHANGED, eventType,
                actionType, handler);
        }
       
        // now store this default events if we want to restore them
        EventNotification notification = null;

        if(defaultNotificationsTable.containsKey(eventType))
            notification = defaultNotificationsTable.get(eventType);
        else
        {
            notification = new EventNotification(eventType);

            defaultNotificationsTable.put(eventType, notification);
        }

        NotificationActionHandler handler = null;
       
        if (actionType.equals(NotificationService.ACTION_SOUND))
        {
            handler = new SoundNotificationHandlerImpl(actionDescriptor, -1);
        }
        else if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE))
        {
            handler = new LogMessageNotificationHandlerImpl(
                    LogMessageNotificationHandler.INFO_LOG_TYPE);
        }
        else if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE))
        {
            handler = new PopupMessageNotificationHandlerImpl(defaultMessage);
        }
        else if (actionType.equals(NotificationService.ACTION_COMMAND))
        {
            handler = new CommandNotificationHandlerImpl(actionDescriptor);
        }
       
        notification.addAction(actionType, handler);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.