JIDE 3.5.15

com.jidesoft.swing
Class SidePaneGroup

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<SidePaneItem>
              extended by com.jidesoft.swing.SidePaneGroup
All Implemented Interfaces:
Serializable, Cloneable, Iterable<SidePaneItem>, Collection<SidePaneItem>, List<SidePaneItem>, RandomAccess

public class SidePaneGroup
extends ArrayList<SidePaneItem>

A data structure used by SidePane to represent a group of SidePaneItem.

Each group usually has one SidePaneItem selected.

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
          A list of event listeners for this component.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SidePaneGroup()
          Default constructor.
 
Method Summary
 void addSidePaneListener(SidePaneListener l)
          Adds the specified listener to receive side pane events from this side pane group.
 boolean exists(Component comp)
          Checks if the component exists in this group.
protected  void fireSidePaneEvent(SidePaneItem sidePaneItem, int id)
          Fires a side pane event.
 String getLongestTitle()
          Get longest title in this group.
 int getSelectedIndex()
          Gets the selected index.
 SidePaneItem getSelectedItem()
          Gets the selected item.
 SidePaneItem getSidePaneItem(Component comp)
          Checks if the component exists in this group.
 SidePaneListener[] getSidePaneListeners()
          Returns an array of all the SidePaneListeners added to this SidePaneGroup with addSidePaneListener.
 boolean removeComponent(Component comp)
          Removes the component from this group.
 void removeSidePaneListener(SidePaneListener l)
          Removes the specified side pane listener so that it no longer receives side pane events from this side pane group.
 void setSelectedIndex(int index)
          Sets the selected index.
 void setSelectedItem(SidePaneItem selectedItem)
          Sets the selected item.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

listenerList

protected EventListenerList listenerList
A list of event listeners for this component.

Constructor Detail

SidePaneGroup

public SidePaneGroup()
Default constructor.

Method Detail

getSelectedItem

public SidePaneItem getSelectedItem()
Gets the selected item. If there is no one is selected, return the first one. If there is no items at all, return null.

Returns:
the selected item

setSelectedItem

public void setSelectedItem(SidePaneItem selectedItem)
Sets the selected item.

Parameters:
selectedItem - the item to be selected

getSelectedIndex

public int getSelectedIndex()
Gets the selected index.

Returns:
the index of the selected item

setSelectedIndex

public void setSelectedIndex(int index)
Sets the selected index.

Parameters:
index - the index of the item to be selected

getLongestTitle

public String getLongestTitle()
Get longest title in this group. This is just a handy method which shouldn't really need to be here.

Returns:
the longest title

removeComponent

public boolean removeComponent(Component comp)
Removes the component from this group.

Parameters:
comp - component to be removed
Returns:
true if the component is removed

exists

public boolean exists(Component comp)
Checks if the component exists in this group.

Parameters:
comp - component to be checked
Returns:
true if the component exists

getSidePaneItem

public SidePaneItem getSidePaneItem(Component comp)
Checks if the component exists in this group.

Parameters:
comp - component to be checked
Returns:
true if the component exists

addSidePaneListener

public void addSidePaneListener(SidePaneListener l)
Adds the specified listener to receive side pane events from this side pane group.

Parameters:
l - the side pane listener

removeSidePaneListener

public void removeSidePaneListener(SidePaneListener l)
Removes the specified side pane listener so that it no longer receives side pane events from this side pane group.

Parameters:
l - the dockable frame listener

getSidePaneListeners

public SidePaneListener[] getSidePaneListeners()
Returns an array of all the SidePaneListeners added to this SidePaneGroup with addSidePaneListener.

Returns:
all of the SidePaneListeners added or an empty array if no listeners have been added
See Also:
addSidePaneListener(com.jidesoft.swing.event.SidePaneListener)

fireSidePaneEvent

protected void fireSidePaneEvent(SidePaneItem sidePaneItem,
                                 int id)
Fires a side pane event.

Parameters:
sidePaneItem - the event source
id - the type of the event being fired; one of the following: If the event type is not one of the above, nothing happens.

JIDE 3.5.15