Package com.jidesoft.swing
Class SidePaneGroup
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<SidePaneItem>,Collection<SidePaneItem>,List<SidePaneItem>,RandomAccess,SequencedCollection<SidePaneItem>
A data structure used by
SidePane to represent a group of SidePaneItem.
Each group usually has one SidePaneItem selected.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EventListenerListA list of event listeners for this component.Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified listener to receive side pane events from this side pane group.booleanChecks if the component exists in this group.protected voidfireSidePaneEvent(SidePaneItem sidePaneItem, int id) Fires a side pane event.Get longest title in this group.intGets the selected index.Gets the selected item.getSidePaneItem(Component comp) Checks if the component exists in this group.Returns an array of all theSidePaneListeners added to thisSidePaneGroupwithaddSidePaneListener.booleanremoveComponent(Component comp) Removes the component from this group.voidRemoves the specified side pane listener so that it no longer receives side pane events from this side pane group.voidsetSelectedIndex(int index) Sets the selected index.voidsetSelectedItem(SidePaneItem selectedItem) Sets the selected item.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
listenerList
A list of event listeners for this component.
-
-
Constructor Details
-
SidePaneGroup
public SidePaneGroup()Default constructor.
-
-
Method Details
-
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
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
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
Removes the component from this group.- Parameters:
comp- component to be removed- Returns:
trueif the component is removed
-
exists
Checks if the component exists in this group.- Parameters:
comp- component to be checked- Returns:
trueif the component exists
-
getSidePaneItem
Checks if the component exists in this group.- Parameters:
comp- component to be checked- Returns:
trueif the component exists
-
addSidePaneListener
Adds the specified listener to receive side pane events from this side pane group.- Parameters:
l- the side pane listener
-
removeSidePaneListener
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
Returns an array of all theSidePaneListeners added to thisSidePaneGroupwithaddSidePaneListener.- Returns:
- all of the
SidePaneListeners added or an empty array if no listeners have been added - See Also:
-
fireSidePaneEvent
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.
-