Protégé-OWL 3.3.1

edu.stanford.smi.protegex.owl.ui.resourceselection
Class ResourceFilterListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by edu.stanford.smi.protegex.owl.ui.resourceselection.ResourceFilterListModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel

public class ResourceFilterListModel
extends AbstractListModel
implements ComboBoxModel

A ListModel for JComboBoxes and JLists that allows to select a frame by typing its prefix characters. The ListModel will contain exactly those frames that match the current prefix.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
ResourceFilterListModel(Collection frames)
           
 
Method Summary
 void addChar(char ch)
           
 void backspace()
           
protected  int findFirstMatchingFrame()
          Finds the first Frame that matches the suffix
 Object getElementAt(int index)
           
 int getPrefixLength()
           
 Object getSelectedItem()
           
 int getSize()
           
 void setSelectedItem(Object anItem)
           
 
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
 

Constructor Detail

ResourceFilterListModel

public ResourceFilterListModel(Collection frames)
Method Detail

addChar

public void addChar(char ch)

backspace

public void backspace()

findFirstMatchingFrame

protected int findFirstMatchingFrame()
Finds the first Frame that matches the suffix

Returns:
the index of the first frame

getElementAt

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

getPrefixLength

public int getPrefixLength()

getSelectedItem

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

getSize

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

setSelectedItem

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

Protégé-OWL 3.3.1

Submit a bug report or feature request
Copyright (c) 1998-2007 Stanford University.