Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.util
Class ListenerList


java.lang.Object
  extended by 

org.eclipse.core.runtime.ListenerList
      extended by 
org.eclipse.jface.util.ListenerList

Deprecated. Please use ListenerList instead. Please note that the ListenerList(int) and ListenerList.ListenerList(int) constructors have different semantics. Please read the javadoc carefully. Also note that the equivalent of ListenerList() is actually ListenerList.ListenerList(int) with ListenerList.IDENTITY as the argument.

public class ListenerList
extends ListenerList

This class is used to maintain a list of listeners, and is used in the implementations of several classes within JFace which allow you to register listeners of various kinds. It is a fairly lightweight object, occupying minimal space when no listeners are registered.

Note that the add method checks for and eliminates duplicates based on identity (not equality). Likewise, the remove method compares based on identity.

Use the getListeners method when notifying listeners. Note that no garbage is created if no listeners are registered. The recommended code sequence for notifying all registered listeners of say, FooListener.eventHappened, is:

 Object[] listeners = myListenerList.getListeners();
 for (int i = 0; i < listeners.length; ++i) {
        ((FooListener) listeners[i]).eventHappened(event);
 }
 


Field Summary
 
Fields inherited from class org.eclipse.core.runtime. ListenerList
EQUALITY, IDENTITY
 
Constructor Summary
ListenerList ()
          Deprecated. Creates a listener list with an initial capacity of 1.
ListenerList (int capacity)
          Deprecated. Creates a listener list with the given initial capacity.
 
Method Summary
 
Methods inherited from class org.eclipse.core.runtime. ListenerList
add, clear, getListeners, isEmpty, remove, size
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerList

public ListenerList()
Deprecated. 
Creates a listener list with an initial capacity of 1.


ListenerList

public ListenerList(int capacity)
Deprecated. 
Creates a listener list with the given initial capacity.

Parameters:
capacity - the number of listeners which this list can initially accept without growing its internal representation; must be at least 1

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire