i3mclient.userlist
Class UserList

java.lang.Object
  |
  +--i3mclient.userlist.UserList
All Implemented Interfaces:
EventListener, MessageListener, MouseListener, SelectionListener, ShellListener, StatusListener, org.eclipse.swt.internal.SWTEventListener

public class UserList
extends Object
implements StatusListener, MouseListener, SelectionListener, MessageListener, ShellListener

The logic of the userlist.

Author:
Henning Schaefer
See Also:
UserListPanel

Field Summary
static int BUDDYLISTMODE
          This user list is a buddy list
static int DISCUSSIONMODE
          This user list is a discussion member list
 
Constructor Summary
UserList()
          Constructor for normal buddy list.
UserList(long setDiscussionID)
          Constructor for discussion member list.
 
Method Summary
 boolean addBuddy(BuddyData buddyData)
          Add a buddy to the buddy list.
 void addErrorListener(ErrorListener listener)
          Add a listener for errors.
 void addUserListener(UserListListener listener)
          Add a listener for user changes.
 boolean buddyAllowed(BuddyData buddyData)
          Check if buddy can be added to buddy list.
 int getMode()
          Returns the current mode.
 void init()
          Init rest.
 void messageReceived(MessageData message)
          Called if Polling receives a new message from Server.
 void mouseDoubleClick(MouseEvent event)
           
 void mouseDown(MouseEvent event)
           
 void mouseUp(MouseEvent event)
           
 boolean moveBuddy(BuddyData buddyData)
          Move buddy inside buddy list.
 void removeErrorListener(ErrorListener listener)
          Remove a listener for errors.
 void removeUserListener(UserListListener listener)
          Remove a listener for user changes.
 void renameGroup(String oldName, String newName)
          Rename a group.
 void shellActivated(ShellEvent arg0)
           
 void shellClosed(ShellEvent event)
           
 void shellDeactivated(ShellEvent arg0)
           
 void shellDeiconified(ShellEvent arg0)
           
 void shellIconified(ShellEvent arg0)
           
 void statusChanged(int status)
          Called when status of the user changed.
 void widgetDefaultSelected(SelectionEvent event)
           
 void widgetSelected(SelectionEvent event)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUDDYLISTMODE

public static final int BUDDYLISTMODE
This user list is a buddy list

See Also:
Constant Field Values

DISCUSSIONMODE

public static final int DISCUSSIONMODE
This user list is a discussion member list

See Also:
Constant Field Values
Constructor Detail

UserList

public UserList(long setDiscussionID)
Constructor for discussion member list.

Parameters:
setDiscussionID - The dicussionID of the discussion which belongs to this discussion member list

UserList

public UserList()
Constructor for normal buddy list.

Method Detail

getMode

public int getMode()
Returns the current mode.

Returns:
The mode of this user list (BUDDYLISTMODE or DISCUSSIONMODE)

init

public void init()
Init rest.


addBuddy

public boolean addBuddy(BuddyData buddyData)
Add a buddy to the buddy list.

Parameters:
buddyData - The BuddyData of the buddy which will be added to the buddylist
Returns:
true if added successfull

moveBuddy

public boolean moveBuddy(BuddyData buddyData)
Move buddy inside buddy list.

Parameters:
buddyData - The BuddyData of the buddy which will be moved
Returns:
True if buddy was moved successfull

buddyAllowed

public boolean buddyAllowed(BuddyData buddyData)
Check if buddy can be added to buddy list.

Parameters:
buddyData - The BuddyData of the buddy which will be checked
Returns:
True if buddy is allowed

renameGroup

public void renameGroup(String oldName,
                        String newName)
Rename a group.

Parameters:
oldName - The old name of the group
newName - The new name of the group

addUserListener

public void addUserListener(UserListListener listener)
Add a listener for user changes.

Parameters:
listener - The listener which will be informed about user changes

removeUserListener

public void removeUserListener(UserListListener listener)
Remove a listener for user changes.

Parameters:
listener - The listener which will be no longer informed about user changes

addErrorListener

public void addErrorListener(ErrorListener listener)
Add a listener for errors.

Parameters:
listener - The listener which will be informed about errors

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Remove a listener for errors.

Parameters:
listener - The listener which will be no longer informed about errors

statusChanged

public void statusChanged(int status)
Description copied from interface: StatusListener
Called when status of the user changed.

Specified by:
statusChanged in interface StatusListener
Parameters:
status - The new status of the user.

mouseDoubleClick

public void mouseDoubleClick(MouseEvent event)
Specified by:
mouseDoubleClick in interface MouseListener

mouseDown

public void mouseDown(MouseEvent event)
Specified by:
mouseDown in interface MouseListener

mouseUp

public void mouseUp(MouseEvent event)
Specified by:
mouseUp in interface MouseListener

messageReceived

public void messageReceived(MessageData message)
Description copied from interface: MessageListener
Called if Polling receives a new message from Server.

Specified by:
messageReceived in interface MessageListener
Parameters:
message - The new received message

widgetSelected

public void widgetSelected(SelectionEvent event)
Specified by:
widgetSelected in interface SelectionListener

widgetDefaultSelected

public void widgetDefaultSelected(SelectionEvent event)
Specified by:
widgetDefaultSelected in interface SelectionListener

shellClosed

public void shellClosed(ShellEvent event)
Specified by:
shellClosed in interface ShellListener

shellActivated

public void shellActivated(ShellEvent arg0)
Specified by:
shellActivated in interface ShellListener

shellDeactivated

public void shellDeactivated(ShellEvent arg0)
Specified by:
shellDeactivated in interface ShellListener

shellDeiconified

public void shellDeiconified(ShellEvent arg0)
Specified by:
shellDeiconified in interface ShellListener

shellIconified

public void shellIconified(ShellEvent arg0)
Specified by:
shellIconified in interface ShellListener