com.alee.extended.panel
Class WebAccordion

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.alee.laf.panel.WebPanel
                      extended by com.alee.extended.panel.WebAccordion
All Implemented Interfaces:
PartialDecoration, LanguageContainerMethods, SettingsMethods, ShapeProvider, Styleable, SizeMethods<WebPanel>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public class WebAccordion
extends WebPanel
implements javax.swing.SwingConstants, SettingsMethods

Accordion groups separate collapsible panes into a single component. It also has a few useful features like unified styling and selection mode.

Author:
Mikle Garin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  AccordionStyle accordionStyle
          Accordion style.
protected  boolean animate
          Whether animate transition between states or not.
protected  javax.swing.ImageIcon collapseIcon
          Expanded state icon.
protected  javax.swing.ImageIcon expandIcon
          Collapsed state icon.
protected  boolean fillSpace
          Whether accordion must fill all available space with expanded panes or not.
protected  int gap
          Gap between panes for separated accordion style.
protected  WebCollapsiblePane lastExpanded
          Index of last expanded collapsible pane.
protected  java.util.List<AccordionListener> listeners
          Accordion collapsible pane listeners.
protected  boolean multiplySelectionAllowed
          Whether multiply expanded panes are allowed or not.
protected  int orientation
          Accordion orientation.
protected  java.util.List<WebCollapsiblePane> panes
          Accordion collapsible panes.
protected  java.util.List<CollapsiblePaneListener> stateListeners
          Accordion collapsible pane state listeners.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebAccordion()
          Constructs empty accordion with default style.
WebAccordion(AccordionStyle style)
          Constructs empty accordion with the specified style.
 
Method Summary
 void addAccordionListener(AccordionListener listener)
          Adds accordion listener.
 WebCollapsiblePane addPane(java.awt.Component title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified title component and content.
 WebCollapsiblePane addPane(javax.swing.Icon icon, java.lang.String title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified icon, title and content.
 WebCollapsiblePane addPane(int index, java.awt.Component title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified title component and content at the specified index.
 WebCollapsiblePane addPane(int index, javax.swing.Icon icon, java.lang.String title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified icon, title and content at the specified index.
 WebCollapsiblePane addPane(int index, java.lang.String title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified title and content at the specified index.
protected  WebCollapsiblePane addPane(int index, WebCollapsiblePane pane)
          Adds collapsible pane into accordion at the specified index.
 WebCollapsiblePane addPane(java.lang.String title, java.awt.Component content)
          Adds new collapsible pane into accordion with the specified title and content.
protected  void fireSelectionChanged()
          Notifies when collapsible pane starts to expand.
 java.util.List<AccordionListener> getAccordionListeners()
          Returns accordion listeners.
 AccordionStyle getAccordionStyle()
          Returns accordion style.
 java.util.List<WebCollapsiblePane> getActualPanesList()
          Returns actual list of available collapsible panes.
 javax.swing.ImageIcon getCollapseIcon()
          Returns expanded state icon.
 java.awt.Component getContentAt(int index)
          Returns collapsible pane content at the specified index.
 java.awt.Insets getContentMarginAt(int index)
          Returns collapsible pane margin at the specified index.
 javax.swing.ImageIcon getExpandIcon()
          Returns collapsed state icon.
 int getFirstSelectedIndex()
          Returns index of the first expanded collapsible pane or -1 if none expanded.
 int getGap()
          Returns gap between panes for separated accordion style.
 javax.swing.Icon getIconAt(int index)
          Returns collapsible pane icon at the specified index.
 int getOrientation()
          Returns accordion orientation.
 WebCollapsiblePane getPane(int index)
          Returns collapsible pane at the specified index.
 java.util.List<WebCollapsiblePane> getPanes()
          Returns list of available collapsible panes.
 java.util.List<java.lang.Integer> getSelectedIndices()
          Returns selected collapsible pane indices.
 java.util.List<WebCollapsiblePane> getSelectedPanes()
          Returns selected collapsible panes.
 int getSelectionCount()
          Returns amount of expanded collapsible panes.
 java.lang.String getTitleAt(int index)
          Returns collapsible pane title at the specified index.
 java.awt.Component getTitleComponentAt(int index)
          Returns collapsible pane title component at the specified index.
protected  void initializeDefaultSettings(AccordionStyle style)
          Initializes default accordion settings.
 boolean isAnimate()
          Returns whether animate transition between states or not.
 boolean isAnySelected()
          Returns whether any collapsible pane is expanded or not.
 boolean isFillSpace()
          Returns whether accordion must fill all available space with expanded panes or not.
 boolean isMultiplySelectionAllowed()
          Returns whether multiply expanded panes are allowed or not.
 void loadSettings()
          Loads saved settings into the component if it is registered.
 void registerSettings(SettingsProcessor settingsProcessor)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, java.lang.Object defaultValue)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void removeAccordionListener(AccordionListener listener)
          Removes collapsible pane listener.
 void removePane(int index)
          Removes collapsible pane from the specified index from accordion.
protected  void removePane(WebCollapsiblePane pane)
          Removes collapsible pane from accordion.
 void saveSettings()
          Saves component settings.
 void setAccordionListeners(java.util.List<AccordionListener> listeners)
          Sets accordion listeners.
 void setAccordionStyle(AccordionStyle accordionStyle)
          Sets accordion style.
 void setAnimate(boolean animate)
          Sets whether animate transition between states or not.
 void setCollapseIcon(javax.swing.ImageIcon collapseIcon)
          Sets expanded state icon.
 void setContentAt(int index, java.awt.Component content)
          Sets collapsible pane content at the specified index.
 void setContentMarginAt(int index, java.awt.Insets margin)
          Sets collapsible pane margin at the specified index.
 void setContentMarginAt(int index, int margin)
          Sets collapsible pane margin at the specified index.
 void setContentMarginAt(int index, int top, int left, int bottom, int right)
          Sets collapsible pane margin at the specified index.
 void setExpandIcon(javax.swing.ImageIcon expandIcon)
          Sets collapsed state icon.
 void setFillSpace(boolean fillSpace)
          Sets whether accordion must fill all available space with expanded panes or not.
 void setGap(int gap)
          Sets gap between panes for separated accordion style.
 void setIconAt(int index, javax.swing.Icon icon)
          Sets collapsible pane icon at the specified index.
 void setMultiplySelectionAllowed(boolean multiplySelectionAllowed)
          Sets whether multiply expanded panes are allowed or not.
 void setOrientation(int orientation)
          Sets accordion orientation.
 void setSelectedIndices(java.util.List<java.lang.Integer> indices)
          Sets selected collapsible pane indices.
 void setSelectedPanes(java.util.List<WebCollapsiblePane> selectedPanes)
          Sets selected collapsible panes.
 void setTitleAt(int index, java.lang.String title)
          Sets collapsible pane title at the specified index.
 void setTitleComponentAt(int index, java.awt.Component titleComponent)
          Sets collapsible pane title component at the specified index.
 void unregisterSettings()
          Unregisters component from settings auto-save.
protected  void updatePaneIcons()
          Updates collapsible pane icons.
protected  void updatePanesAnimation()
          Updates collapsible panes animation property.
protected  void updatePanesBorderStyling()
          Updates panes styling according to accordion settings.
protected  void updateSelections(int index, boolean collapse)
          Updates panes selection states.
 
Methods inherited from class com.alee.laf.panel.WebPanel
add, add, add, add, add, add, getBorderColor, getBorderStroke, getDisabledBorderColor, getFirstComponent, getLanguageContainerKey, getLastComponent, getMargin, getMinimumHeight, getMinimumWidth, getPainter, getPreferredHeight, getPreferredSize, getPreferredWidth, getRound, getShadeTransparency, getShadeWidth, getStyleId, getWebUI, isPaintBackground, isPaintBottom, isPaintBottomLine, isPaintFocus, isPaintLeft, isPaintLeftLine, isPaintRight, isPaintRightLine, isPaintTop, isPaintTopLine, isUndecorated, isWebColoredBackground, provideShape, removeLanguageContainerKey, setBorderColor, setBorderStroke, setDisabledBorderColor, setLanguageContainerKey, setMargin, setMargin, setMargin, setMinimumHeight, setMinimumWidth, setPaintBackground, setPaintBottom, setPaintBottomLine, setPainter, setPaintFocus, setPaintLeft, setPaintLeftLine, setPaintRight, setPaintRightLine, setPaintSideLines, setPaintSides, setPaintTop, setPaintTopLine, setPreferredHeight, setPreferredWidth, setRound, setShadeTransparency, setShadeWidth, setStyleId, setUndecorated, setWebColoredBackground, updateUI
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

animate

protected boolean animate
Whether animate transition between states or not.


accordionStyle

protected AccordionStyle accordionStyle
Accordion style.


orientation

protected int orientation
Accordion orientation.


expandIcon

protected javax.swing.ImageIcon expandIcon
Collapsed state icon.


collapseIcon

protected javax.swing.ImageIcon collapseIcon
Expanded state icon.


fillSpace

protected boolean fillSpace
Whether accordion must fill all available space with expanded panes or not.


multiplySelectionAllowed

protected boolean multiplySelectionAllowed
Whether multiply expanded panes are allowed or not.


gap

protected int gap
Gap between panes for separated accordion style.


listeners

protected java.util.List<AccordionListener> listeners
Accordion collapsible pane listeners.


panes

protected java.util.List<WebCollapsiblePane> panes
Accordion collapsible panes.


stateListeners

protected java.util.List<CollapsiblePaneListener> stateListeners
Accordion collapsible pane state listeners. These listeners required for some of accordion features.


lastExpanded

protected WebCollapsiblePane lastExpanded
Index of last expanded collapsible pane.

Constructor Detail

WebAccordion

public WebAccordion()
Constructs empty accordion with default style.


WebAccordion

public WebAccordion(AccordionStyle style)
Constructs empty accordion with the specified style.

Parameters:
style - accordion style
Method Detail

initializeDefaultSettings

protected void initializeDefaultSettings(AccordionStyle style)
Initializes default accordion settings.


isAnimate

public boolean isAnimate()
Returns whether animate transition between states or not.

Returns:
true if transitions between states should be animated, false otherwise

setAnimate

public void setAnimate(boolean animate)
Sets whether animate transition between states or not.

Parameters:
animate - whether animate transition between states or not

updatePanesAnimation

protected void updatePanesAnimation()
Updates collapsible panes animation property.


getOrientation

public int getOrientation()
Returns accordion orientation.

Returns:
accordion orientation

setOrientation

public void setOrientation(int orientation)
Sets accordion orientation.

Parameters:
orientation - new accordion orientation

getExpandIcon

public javax.swing.ImageIcon getExpandIcon()
Returns collapsed state icon.

Returns:
collapsed state icon

setExpandIcon

public void setExpandIcon(javax.swing.ImageIcon expandIcon)
Sets collapsed state icon.

Parameters:
expandIcon - new collapsed state icon

getCollapseIcon

public javax.swing.ImageIcon getCollapseIcon()
Returns expanded state icon.

Returns:
expanded state icon

setCollapseIcon

public void setCollapseIcon(javax.swing.ImageIcon collapseIcon)
Sets expanded state icon.

Parameters:
collapseIcon - new expanded state icon

updatePaneIcons

protected void updatePaneIcons()
Updates collapsible pane icons.


getAccordionStyle

public AccordionStyle getAccordionStyle()
Returns accordion style.

Returns:
accordion style

setAccordionStyle

public void setAccordionStyle(AccordionStyle accordionStyle)
Sets accordion style.

Parameters:
accordionStyle - new accordion style

isFillSpace

public boolean isFillSpace()
Returns whether accordion must fill all available space with expanded panes or not.

Returns:
whether accordion must fill all available space with expanded panes or not

setFillSpace

public void setFillSpace(boolean fillSpace)
Sets whether accordion must fill all available space with expanded panes or not.

Parameters:
fillSpace - whether accordion must fill all available space with expanded panes or not

isMultiplySelectionAllowed

public boolean isMultiplySelectionAllowed()
Returns whether multiply expanded panes are allowed or not.

Returns:
whether multiply expanded panes are allowed or not

setMultiplySelectionAllowed

public void setMultiplySelectionAllowed(boolean multiplySelectionAllowed)
Sets whether multiply expanded panes are allowed or not.

Parameters:
multiplySelectionAllowed - whether multiply expanded panes are allowed or not

updateSelections

protected void updateSelections(int index,
                                boolean collapse)
Updates panes selection states.

Parameters:
index - index of the pane that will be left expanded in case multiply expanded panes are not allowed
collapse - whether allow to collapse panes or not

getGap

public int getGap()
Returns gap between panes for separated accordion style.

Returns:
gap between panes for separated accordion style

setGap

public void setGap(int gap)
Sets gap between panes for separated accordion style.

Parameters:
gap - new gap between panes for separated accordion style

addPane

public WebCollapsiblePane addPane(java.lang.String title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified title and content.

Parameters:
title - collapsible pane title
content - collapsible pane content
Returns:
new collapsible pane

addPane

public WebCollapsiblePane addPane(int index,
                                  java.lang.String title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified title and content at the specified index.

Parameters:
index - collapsible pane index
title - collapsible pane title
content - collapsible pane content
Returns:
new collapsible pane

addPane

public WebCollapsiblePane addPane(javax.swing.Icon icon,
                                  java.lang.String title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified icon, title and content.

Parameters:
icon - collapsible pane icon
title - collapsible pane title
content - collapsible pane content
Returns:
new collapsible pane

addPane

public WebCollapsiblePane addPane(int index,
                                  javax.swing.Icon icon,
                                  java.lang.String title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified icon, title and content at the specified index.

Parameters:
index - collapsible pane index
icon - collapsible pane icon
title - collapsible pane title
content - collapsible pane content
Returns:
new collapsible pane

addPane

public WebCollapsiblePane addPane(java.awt.Component title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified title component and content.

Parameters:
title - collapsible pane title component
content - collapsible pane content
Returns:
new collapsible pane

addPane

public WebCollapsiblePane addPane(int index,
                                  java.awt.Component title,
                                  java.awt.Component content)
Adds new collapsible pane into accordion with the specified title component and content at the specified index.

Parameters:
index - collapsible pane index
title - collapsible pane title component
content - collapsible pane content
Returns:
new collapsible pane

addPane

protected WebCollapsiblePane addPane(int index,
                                     WebCollapsiblePane pane)
Adds collapsible pane into accordion at the specified index.

Parameters:
index - collapsible pane index
pane - collapsible pane to add
Returns:
added collapsible pane

removePane

public void removePane(int index)
Removes collapsible pane from the specified index from accordion.

Parameters:
index - collapsible pane index

removePane

protected void removePane(WebCollapsiblePane pane)
Removes collapsible pane from accordion.

Parameters:
pane - collapsible pane to remove

getPanes

public java.util.List<WebCollapsiblePane> getPanes()
Returns list of available collapsible panes.

Returns:
list of available collapsible panes

getActualPanesList

public java.util.List<WebCollapsiblePane> getActualPanesList()
Returns actual list of available collapsible panes. Be aware that accordion might be corrupted if you modify this list directly.

Returns:
actual list of available collapsible panes

getPane

public WebCollapsiblePane getPane(int index)
Returns collapsible pane at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane at the specified index

updatePanesBorderStyling

protected void updatePanesBorderStyling()
Updates panes styling according to accordion settings.


isAnySelected

public boolean isAnySelected()
Returns whether any collapsible pane is expanded or not.

Returns:
true if any collapsible pane is expanded, false otherwise

getFirstSelectedIndex

public int getFirstSelectedIndex()
Returns index of the first expanded collapsible pane or -1 if none expanded.

Returns:
index of the first expanded collapsible pane or -1 if none expanded

getSelectionCount

public int getSelectionCount()
Returns amount of expanded collapsible panes.

Returns:
amount of expanded collapsible panes

getIconAt

public javax.swing.Icon getIconAt(int index)
Returns collapsible pane icon at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane icon at the specified index

setIconAt

public void setIconAt(int index,
                      javax.swing.Icon icon)
Sets collapsible pane icon at the specified index.

Parameters:
index - collapsible pane index
icon - new collapsible pane icon

getTitleAt

public java.lang.String getTitleAt(int index)
Returns collapsible pane title at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane title at the specified index

setTitleAt

public void setTitleAt(int index,
                       java.lang.String title)
Sets collapsible pane title at the specified index.

Parameters:
index - collapsible pane index
title - new collapsible pane title

getTitleComponentAt

public java.awt.Component getTitleComponentAt(int index)
Returns collapsible pane title component at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane title component at the specified index

setTitleComponentAt

public void setTitleComponentAt(int index,
                                java.awt.Component titleComponent)
Sets collapsible pane title component at the specified index.

Parameters:
index - collapsible pane index
titleComponent - new collapsible pane title component

getContentAt

public java.awt.Component getContentAt(int index)
Returns collapsible pane content at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane content at the specified index

setContentAt

public void setContentAt(int index,
                         java.awt.Component content)
Sets collapsible pane content at the specified index.

Parameters:
index - collapsible pane index
content - new collapsible pane content

getContentMarginAt

public java.awt.Insets getContentMarginAt(int index)
Returns collapsible pane margin at the specified index.

Parameters:
index - collapsible pane index
Returns:
collapsible pane margin at the specified index

setContentMarginAt

public void setContentMarginAt(int index,
                               java.awt.Insets margin)
Sets collapsible pane margin at the specified index.

Parameters:
index - collapsible pane index
margin - new collapsible pane margin

setContentMarginAt

public void setContentMarginAt(int index,
                               int top,
                               int left,
                               int bottom,
                               int right)
Sets collapsible pane margin at the specified index.

Parameters:
index - collapsible pane index
top - new collapsible pane top margin
left - new collapsible pane left margin
bottom - new collapsible pane bottom margin
right - new collapsible pane right margin

setContentMarginAt

public void setContentMarginAt(int index,
                               int margin)
Sets collapsible pane margin at the specified index.

Parameters:
index - collapsible pane index
margin - new collapsible pane margin

getSelectedPanes

public java.util.List<WebCollapsiblePane> getSelectedPanes()
Returns selected collapsible panes.

Returns:
selected collapsible panes

setSelectedPanes

public void setSelectedPanes(java.util.List<WebCollapsiblePane> selectedPanes)
Sets selected collapsible panes.

Parameters:
selectedPanes - selected collapsible panes

getSelectedIndices

public java.util.List<java.lang.Integer> getSelectedIndices()
Returns selected collapsible pane indices.

Returns:
selected collapsible pane indices

setSelectedIndices

public void setSelectedIndices(java.util.List<java.lang.Integer> indices)
Sets selected collapsible pane indices.

Parameters:
indices - selected collapsible pane indices

getAccordionListeners

public java.util.List<AccordionListener> getAccordionListeners()
Returns accordion listeners.

Returns:
accordion listeners

setAccordionListeners

public void setAccordionListeners(java.util.List<AccordionListener> listeners)
Sets accordion listeners.

Parameters:
listeners - accordion listeners

addAccordionListener

public void addAccordionListener(AccordionListener listener)
Adds accordion listener.

Parameters:
listener - accordion listener to add

removeAccordionListener

public void removeAccordionListener(AccordionListener listener)
Removes collapsible pane listener.

Parameters:
listener - collapsible pane listener to remove

fireSelectionChanged

protected void fireSelectionChanged()
Notifies when collapsible pane starts to expand.


registerSettings

public void registerSettings(java.lang.String key)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
key - component settings key
defaultValueClass - component default value class
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String key,
                             java.lang.Object defaultValue)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
defaultValue - component default value

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String group,
                                                      java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
group - component settings group
key - component settings key
defaultValueClass - component default value class
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key,
                             java.lang.Object defaultValue)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key
defaultValue - component default value

registerSettings

public void registerSettings(java.lang.String key,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass,
                                                      boolean loadInitialSettings,
                                                      boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
key - component settings key
defaultValueClass - component default value class
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String key,
                             java.lang.Object defaultValue,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
defaultValue - component default value
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String group,
                                                      java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass,
                                                      boolean loadInitialSettings,
                                                      boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
group - component settings group
key - component settings key
defaultValueClass - component default value class
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key,
                             java.lang.Object defaultValue,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key
defaultValue - component default value
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public void registerSettings(SettingsProcessor settingsProcessor)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
settingsProcessor - component settings processor

unregisterSettings

public void unregisterSettings()
Unregisters component from settings auto-save.

Specified by:
unregisterSettings in interface SettingsMethods

loadSettings

public void loadSettings()
Loads saved settings into the component if it is registered.

Specified by:
loadSettings in interface SettingsMethods

saveSettings

public void saveSettings()
Saves component settings.

Specified by:
saveSettings in interface SettingsMethods