Package com.jidesoft.swing
Class SidePaneGroup
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<SidePaneItem>
-
- com.jidesoft.swing.SidePaneGroup
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<SidePaneItem>
,java.util.Collection<SidePaneItem>
,java.util.List<SidePaneItem>
,java.util.RandomAccess
public class SidePaneGroup extends java.util.ArrayList<SidePaneItem>
A data structure used bySidePane
to represent a group ofSidePaneItem
. Each group usually has oneSidePaneItem
selected.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.event.EventListenerList
listenerList
A list of event listeners for this component.
-
Constructor Summary
Constructors Constructor Description SidePaneGroup()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSidePaneListener(SidePaneListener l)
Adds the specified listener to receive side pane events from this side pane group.boolean
exists(java.awt.Component comp)
Checks if the component exists in this group.protected void
fireSidePaneEvent(SidePaneItem sidePaneItem, int id)
Fires a side pane event.java.lang.String
getLongestTitle()
Get longest title in this group.int
getSelectedIndex()
Gets the selected index.SidePaneItem
getSelectedItem()
Gets the selected item.SidePaneItem
getSidePaneItem(java.awt.Component comp)
Checks if the component exists in this group.SidePaneListener[]
getSidePaneListeners()
Returns an array of all theSidePaneListener
s added to thisSidePaneGroup
withaddSidePaneListener
.boolean
removeComponent(java.awt.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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
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 java.lang.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(java.awt.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(java.awt.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(java.awt.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 theSidePaneListener
s added to thisSidePaneGroup
withaddSidePaneListener
.- Returns:
- all of the
SidePaneListener
s 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 sourceid
- the type of the event being fired; one of the following: If the event type is not one of the above, nothing happens.
-
-