cst.util
Class DisplayableList

java.lang.Object
  extended by cst.util.DisplayableList

public class DisplayableList
extends java.lang.Object

manages a list which can display any item which implements the DisplayableList interface. DisplayableListcst.common.businessLayer classes could be rendered in a list. I didn't think it was a good idea to rely on JList's use of the toString() method of the Object.


 Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software 
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License. 
 

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
DisplayableList(javax.swing.JList list)
           
DisplayableList(javax.swing.JList list, java.util.ArrayList<Displayable> displayableItems)
           
 
Method Summary
 void addDisplayableItem(Displayable displayableItem)
           
 void addDisplayNames(java.util.ArrayList<Displayable> displayableItems)
           
 void addSelectionListener(javax.swing.event.ListSelectionListener listSelectionListener)
           
 void clear()
           
 void deleteSelectedItems()
           
 Displayable getSelectedItem()
           
 java.util.ArrayList<Displayable> getSelectedItems()
           
 boolean isListEmpty()
           
 boolean isSelectionEmpty()
           
 void setSelectedIndex(int index)
           
 void sort()
           
 void updateUI()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayableList

public DisplayableList(javax.swing.JList list)

DisplayableList

public DisplayableList(javax.swing.JList list,
                       java.util.ArrayList<Displayable> displayableItems)
Method Detail

isSelectionEmpty

public boolean isSelectionEmpty()

isListEmpty

public boolean isListEmpty()

getSelectedItem

public Displayable getSelectedItem()

getSelectedItems

public java.util.ArrayList<Displayable> getSelectedItems()

addSelectionListener

public void addSelectionListener(javax.swing.event.ListSelectionListener listSelectionListener)

setSelectedIndex

public void setSelectedIndex(int index)

addDisplayNames

public void addDisplayNames(java.util.ArrayList<Displayable> displayableItems)

addDisplayableItem

public void addDisplayableItem(Displayable displayableItem)

updateUI

public void updateUI()

sort

public void sort()

deleteSelectedItems

public void deleteSelectedItems()

clear

public void clear()