Skip navigation links
Jitsi: the OpenSource Java VoIP and Instant Messaging client.
net.java.sip.communicator.plugin.desktoputil.presence

Class AbstractStatusMessageMenu

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CUSTOM_STATUS_MESSAGES_UPDATED_PROP
      Property used to fire property change that the custom status messages have changed, a new one has been added or they are cleared.
      static java.lang.String STATUS_MESSAGE_UPDATED_PROP
      Property used to fire property change that the status message has changed.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractStatusMessageMenu(boolean swing)
      Creates an instance of AbstractStatusMessageMenu.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      void actionPerformed(java.awt.event.ActionEvent e)
      Action is performed on any of the items.
      void actionPerformed(java.lang.Object menuItem)
      Performs action on the selected menuItem.
      void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      Add a PropertyChangeListener to the listener list.
      void clearSelectedItems()
      Clears all items that they are not selected and its name is not bold.
      void dispose()
      Clears resources.
      protected void fireStatusMessageUpdated(java.lang.String oldMessage, java.lang.String newMessage)
      Fires that the status message has changed.
      java.lang.String getCurrentMessage() 
      abstract java.lang.String getCurrentStatusMessage()
      Returns the currently set status message.
      abstract java.lang.Object getDescriptor()
      Returns the descriptor common for this status message menu instance.
      java.lang.Object getMenu()
      Returns the menu used for status messages.
      protected javax.swing.Icon getMenuIcon()
      The icon to use for this menu.
      (package private) java.lang.Object getNewMessageItem()
      Returns the button for new messages.
      void itemStateChanged(java.awt.event.ItemEvent e)
      Action on any of the CheckboxItem.
      void propertyChange(java.beans.PropertyChangeEvent evt)
      Listens for changes in the custom status messages and update.
      abstract void publishStatusMessage(java.lang.String message, java.lang.Object menuItem, boolean saveIfNewMessage)
      Publishes the new message in separate thread.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Remove a PropertyChangeListener from the listener list.
      protected void setCurrentMessage(java.lang.String message, java.lang.Object menuItem, boolean saveNewMessage)
      Changes current message text in its item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STATUS_MESSAGE_UPDATED_PROP

        public static final java.lang.String STATUS_MESSAGE_UPDATED_PROP
        Property used to fire property change that the status message has changed.
        See Also:
        Constant Field Values
      • CUSTOM_STATUS_MESSAGES_UPDATED_PROP

        public static final java.lang.String CUSTOM_STATUS_MESSAGES_UPDATED_PROP
        Property used to fire property change that the custom status messages have changed, a new one has been added or they are cleared.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractStatusMessageMenu

        public AbstractStatusMessageMenu(boolean swing)
        Creates an instance of AbstractStatusMessageMenu.
        Parameters:
        swing - should we use swing or awt
    • Method Detail

      • getMenu

        public java.lang.Object getMenu()
        Returns the menu used for status messages. When AbstractStatusMessageMenu created with swing==true this returns javax.swing.JMenu and if it is false it returns java.awt.Menu.
        Returns:
        the menu.
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent e)
        Action is performed on any of the items.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - the event
      • getCurrentStatusMessage

        public abstract java.lang.String getCurrentStatusMessage()
        Returns the currently set status message.
        Returns:
        the currently set status message.
      • actionPerformed

        public void actionPerformed(java.lang.Object menuItem)
        Performs action on the selected menuItem.
        Parameters:
        menuItem - the selected menu item.
      • itemStateChanged

        public void itemStateChanged(java.awt.event.ItemEvent e)
        Action on any of the CheckboxItem.
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
        Parameters:
        e - the event.
      • publishStatusMessage

        public abstract void publishStatusMessage(java.lang.String message,
                                                  java.lang.Object menuItem,
                                                  boolean saveIfNewMessage)
        Publishes the new message in separate thread. If successfully ended the message item is created and added to te list of current status messages and if needed the message is saved.
        Parameters:
        message - the message to save
        menuItem - the item which was clicked to set this status
        saveIfNewMessage - whether to save the status on the custom statuses list.
      • getNewMessageItem

        java.lang.Object getNewMessageItem()
        Returns the button for new messages.
        Returns:
        the button for new messages.
      • setCurrentMessage

        protected void setCurrentMessage(java.lang.String message,
                                         java.lang.Object menuItem,
                                         boolean saveNewMessage)
        Changes current message text in its item.
        Parameters:
        message -
        menuItem - the menu item that was clicked
        saveNewMessage - whether to save the newly created message
      • clearSelectedItems

        public void clearSelectedItems()
        Clears all items that they are not selected and its name is not bold.
      • getCurrentMessage

        public java.lang.String getCurrentMessage()
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Add a PropertyChangeListener to the listener list. The listener is registered for all properties.
        Parameters:
        listener - The PropertyChangeChangeListener to be added
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Remove a PropertyChangeListener from the listener list. This removes a ConfigurationChangeListener that was registered for all properties.
        Parameters:
        listener - The PropertyChangeListener to be removed
      • getDescriptor

        public abstract java.lang.Object getDescriptor()
        Returns the descriptor common for this status message menu instance.
        Returns:
        the descriptor common for this status message menu instance.
      • fireStatusMessageUpdated

        protected void fireStatusMessageUpdated(java.lang.String oldMessage,
                                                java.lang.String newMessage)
        Fires that the status message has changed.
        Parameters:
        oldMessage - the old message
        newMessage - the new message
      • propertyChange

        public void propertyChange(java.beans.PropertyChangeEvent evt)
        Listens for changes in the custom status messages and update. Compares what is saved in the configuration and update according to that.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Parameters:
        evt -
      • dispose

        public void dispose()
        Clears resources.
      • getMenuIcon

        protected javax.swing.Icon getMenuIcon()
        The icon to use for this menu.
        Returns:
Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.