Package net.java.sip.communicator.impl.notification

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


                                                            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


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

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

                                    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

                                    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

     */
    public void restoreDefaults()
    {
        for (String eventType : new Vector<String>(notificationsTable.keySet()))
        {
            EventNotification notification = notificationsTable.get(eventType);

            for (String actionType
                    : new Vector<String>(notification.getActions().keySet()))
                removeEventNotificationAction(eventType, actionType);

            removeEventNotification(eventType);
        }

        for (Map.Entry<String, EventNotification> entry
                : defaultNotificationsTable.entrySet())
        {
            String eventType = entry.getKey();
            EventNotification notification = entry.getValue();

            for (String actionType : notification.getActions().keySet())
                registerNotificationForEvent(
                    eventType,
                    actionType,
                    notification.getAction(actionType).getActionHandler());
        }
    }
View Full Code Here

    protected Object handleGetEffect()
    {
        // Effect is mapped to action, not activity
        // We return the first action encountered in the activity
        Action effectAction = null;
        Activity effect = this.metaObject.getEffect();
        if (effect != null)
        {
            Collection nodes = effect.getNodes();
            for (Iterator nodesIt = nodes.iterator(); nodesIt.hasNext() && effectAction == null;)
View Full Code Here

            }

            Iterator actions = transactionRequest.getAllActions().iterator();

            while (actions.hasNext()) {
                Action a = (Action) actions.next();

                switch (a.getType()) {
                case Action.DELETE:
                    elems[3].getType().encode(elems[3], a, output, hints);

                    break;
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.impl.notification.EventNotification$Action

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.