Class SelectivePlasticListModel

  extended by javax.swing.AbstractListModel
      extended by
All Implemented Interfaces:
Serializable, EventListener, ComboBoxModel, ListDataListener, ListModel

public class SelectivePlasticListModel
extends AbstractListModel
implements ListDataListener, ComboBoxModel

Implements a ListModel based on an existing ListModel which is taken to contain (PLASTIC) ApplicationItem objects. The purpose of this class is to give you the subset of the applications which support a given PLASTIC message ID. Applications which support all messages are included.

For convenience, this class implements ComboBoxModel as well, but you don't need to use the selection if you don't want.

22 Apr 2006
Mark Taylor
See Also:
Serialized Form

Field Summary
static String ALL_LISTENERS
Fields inherited from class javax.swing.AbstractListModel
Constructor Summary
SelectivePlasticListModel(ListModel base, URI messageId, boolean includeAll, excludeApp)
          Constructs a new list model specifying whether certain particular options are included.
Method Summary
 void contentsChanged(ListDataEvent evt)
 Object getElementAt(int i)
 Object getSelectedItem()
 int getSize()
 void intervalAdded(ListDataEvent evt)
 void intervalRemoved(ListDataEvent evt)
 void setSelectedItem(Object item)
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener

Field Detail


public static final String ALL_LISTENERS
See Also:
Constant Field Values
Constructor Detail


public SelectivePlasticListModel(ListModel base,
                                 URI messageId,
                                 boolean includeAll,
Constructs a new list model specifying whether certain particular options are included.

base - base list model; should contain ApplicationItems
messageId - PLASTIC message id to be supported by all the apps in this list
includeAll - true iff the list should include an "All Listeners" option
excludeApp - plastic listener manager whose ID will be excluded from the list (typically represents the sender application)
Method Detail


public int getSize()
Specified by:
getSize in interface ListModel


public Object getElementAt(int i)
Specified by:
getElementAt in interface ListModel


public void setSelectedItem(Object item)
Specified by:
setSelectedItem in interface ComboBoxModel


public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel


public void contentsChanged(ListDataEvent evt)
Specified by:
contentsChanged in interface ListDataListener


public void intervalAdded(ListDataEvent evt)
Specified by:
intervalAdded in interface ListDataListener


public void intervalRemoved(ListDataEvent evt)
Specified by:
intervalRemoved in interface ListDataListener

Copyright © 2003-2019 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.