Package net.java.sip.communicator.service.notification

Examples of net.java.sip.communicator.service.notification.NotificationAction


            = notifications.get(eventType);
       
        if(notification == null)
            return;

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

        notification.removeAction(actionType);
View Full Code Here


            for (String actionPropName : actions)
            {
                String actionType = configService.getString(actionPropName);

                NotificationAction action = null;

                if(actionType.equals(ACTION_SOUND))
                {
                    String soundFileDescriptor
                        = configService.getString(
                            actionPropName + ".soundFileDescriptor");

                    String loopInterval
                        = configService.getString(
                            actionPropName + ".loopInterval");

                    action = new SoundNotificationAction(
                        soundFileDescriptor,
                        Integer.parseInt(loopInterval));
                }
                else if(actionType.equals(ACTION_POPUP_MESSAGE))
                {
                    String defaultMessage
                        = configService.getString(
                            actionPropName + ".defaultMessage");

                    action = new PopupMessageNotificationAction(defaultMessage);
                }
                else if(actionType.equals(ACTION_LOG_MESSAGE))
                {
                    String logType
                        = configService.getString(
                            actionPropName + ".logType");

                    action = new LogMessageNotificationAction(logType);
                }
                else if(actionType.equals(ACTION_COMMAND))
                {
                    String commandDescriptor
                        = configService.getString(
                            actionPropName + ".commandDescriptor");

                    action = new CommandNotificationAction(commandDescriptor);
                }

                action.setEnabled(isEnabled(actionPropName + ".enabled"));

                // Load the data in the notifications table.
                Notification notification = notifications.get(eventType);
                if(notification == null)
                {
View Full Code Here

        String eventType,
        NotificationAction action)
    {
        if(isDefault(eventType, action.getActionType()))
        {
            NotificationAction h =
                getEventNotificationAction(eventType,
                    action.getActionType());

            boolean isNew = false;
            if(h == null)
            {
                isNew = true;
                h = action;
            }

            this.saveNotificationeventType,
                                    action,
                                    h.isEnabled(),
                                    true);

            Notification notification = null;

            if(notifications.containsKey(eventType))
View Full Code Here

            logger.debug("Registering default event " + eventType + "/" +
            actionType + "/" + actionDescriptor + "/" + defaultMessage);

        if(isDefault(eventType, actionType))
        {
            NotificationAction action =
                getEventNotificationAction(eventType, actionType);
            boolean isNew = false;

            if(action == null)
            {
                isNew = true;

                if (actionType.equals(ACTION_SOUND))
                {
                    action = new SoundNotificationAction(actionDescriptor, -1);
                }
                else if (actionType.equals(ACTION_LOG_MESSAGE))
                {
                    action = new LogMessageNotificationAction(
                        LogMessageNotificationAction.INFO_LOG_TYPE);
                }
                else if (actionType.equals(ACTION_POPUP_MESSAGE))
                {
                    action = new PopupMessageNotificationAction(defaultMessage);
                }
                else if (actionType.equals(ACTION_COMMAND))
                {
                    action = new CommandNotificationAction(actionDescriptor);
                }
            }

            this.saveNotificationeventType,
                                    action,
                                    action.isEnabled(),
                                    true);

            Notification notification = null;

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

            notification.addAction(action);

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

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

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

        NotificationAction action = null;
        if (actionType.equals(ACTION_SOUND))
        {
            action = new SoundNotificationAction(actionDescriptor, -1);
        }
        else if (actionType.equals(ACTION_LOG_MESSAGE))
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.service.notification.NotificationAction

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.