com.alee.extended.panel
Class WebCollapsiblePane

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.WebCollapsiblePane
All Implemented Interfaces:
PartialDecoration, LanguageContainerMethods, LanguageMethods, SettingsMethods, ShapeProvider, Styleable, SizeMethods<WebPanel>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public class WebCollapsiblePane
extends WebPanel
implements javax.swing.SwingConstants, ShapeProvider, LanguageMethods, SettingsMethods

This extended components allows you to quickly create and manipulate a collapsible pane. Pane title, content and style can be modified in any way you like.

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  boolean animate
          Whether animate transition between states or not.
protected  WebTimer animator
          State change animation timer.
protected  javax.swing.ImageIcon cachedCollapseIcon
          Cached expanded state icon.
protected  javax.swing.ImageIcon cachedDisabledCollapseIcon
          Cached disabled expanded state icon.
protected  javax.swing.ImageIcon cachedDisabledExpandIcon
          Cached disabled collapsed state icon.
protected  javax.swing.ImageIcon cachedExpandIcon
          Cached collapsed state icon.
protected  javax.swing.ImageIcon collapseIcon
          Expanded state icon.
protected  java.awt.Component content
          Collapsible pane content.
protected  java.awt.Insets contentMargin
          Content margin.
protected  WebPanel contentPanel
          Content panel.
protected  boolean customTitle
          Whether custom title component is set or not.
protected  WebButton expandButton
          State change button.
protected  boolean expanded
          Whether collapsible pane is expanded or not.
protected  javax.swing.ImageIcon expandIcon
          Collapsed state icon.
protected  float expandSpeed
          Collapsible pane expand and collapse speed.
protected  WebPanel headerPanel
          Header panel.
protected  java.util.List<CollapsiblePaneListener> listeners
          Collapsible pane listeners.
protected  boolean rotateStateIcon
          Whether rotate state icon according to title pane position or not.
protected  boolean showStateIcon
          Whether display state icon in title pane or not.
protected  DataProvider<java.lang.Boolean> stateChangeHandler
          Handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.
protected  java.awt.Insets stateIconMargin
          State icon margin.
protected  int stateIconPostion
          State icon position in title pane.
protected  java.awt.Component titleComponent
          Title component.
protected  int titlePanePostion
          Title pane position in collapsible pane.
protected  float transitionProgress
          Current collapsible pane transition progress.
 
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
WebCollapsiblePane()
          Constructs empty collapsible pane.
WebCollapsiblePane(javax.swing.Icon icon, java.lang.String title, java.awt.Component content)
          Constructs collapsible pane with specified title icon, text and content.
WebCollapsiblePane(javax.swing.ImageIcon icon, java.lang.String title)
          Constructs empty collapsible pane with specified title icon and text.
WebCollapsiblePane(java.lang.String title)
          Constructs empty collapsible pane with specified title text.
WebCollapsiblePane(java.lang.String title, java.awt.Component content)
          Constructs collapsible pane with specified title text and content.
 
Method Summary
 void addCollapsiblePaneListener(CollapsiblePaneListener listener)
          Adds collapsible pane listener.
protected  void clearCachedCollapseIcons()
          Clears cached expanded state icons.
protected  void clearCachedExpandIcons()
          Clears cached collapsed state icons.
 boolean collapse()
          Changes expanded state to collapsed and returns whether operation succeed or not.
 boolean collapse(boolean animate)
          Changes expanded state to collapsed and returns whether operation succeed or not.
protected  javax.swing.JComponent createDefaultTitleComponent(javax.swing.Icon icon, java.lang.String title)
          Returns new default title component with specified icon and text.
 boolean expand()
          Changes expanded state to expanded and returns whether operation succeed or not.
 boolean expand(boolean animate)
          Changes expanded state to expanded and returns whether operation succeed or not.
protected  void finishCollapseAction()
          Finishes collapse action.
protected  void finishExpandAction()
          Finishes expand action.
 void fireCollapsed()
          Notifies when collapsible pane finished collapsing.
 void fireCollapsing()
          Notifies when collapsible pane starts to collapse.
 void fireExpanded()
          Notifies when collapsible pane finished expanding.
 void fireExpanding()
          Notifies when collapsible pane starts to expand.
 java.awt.Dimension getBasePreferredSize()
          Returns preferred size without taking collapsible pane content into account.
protected  javax.swing.ImageIcon getCachedCollapseIcon()
          Returns cached expanded state icon.
protected  javax.swing.ImageIcon getCachedDisabledCollapseIcon()
          Returns cached disabled expanded state icon.
protected  javax.swing.ImageIcon getCachedDisabledExpandIcon()
          Returns cached disabled collapsed state icon.
protected  javax.swing.ImageIcon getCachedExpandIcon()
          Returns cached collapsed state icon.
 javax.swing.ImageIcon getCollapseIcon()
          Returns expanded state icon.
 java.util.List<CollapsiblePaneListener> getCollapsiblePaneListeners()
          Returns collapsible pane listeners.
 java.awt.Component getContent()
          Returns collapsible pane content.
 java.awt.Insets getContentMargin()
          Returns content margin.
 WebButton getExpandButton()
          Returns state change button.
 javax.swing.ImageIcon getExpandIcon()
          Returns collapsed state icon.
 WebPanel getHeaderPanel()
          Returns header panel.
 javax.swing.Icon getIcon()
          Returns default title component icon.
 DataProvider<java.lang.Boolean> getStateChangeHandler()
          Returns handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.
 java.awt.Insets getStateIconMargin()
          Returns state icon margin.
 int getStateIconPostion()
          Returns state icon position in title pane.
 java.lang.String getTitle()
          Returns default title component text.
 java.awt.Component getTitleComponent()
          Returns title component.
 int getTitlePanePostion()
          Returns title pane position in collapsible pane.
 float getTransitionProgress()
          Returns current collapsible pane transition progress.
 boolean invertExpandState()
          Changes expanded state to opposite and returns whether operation succeed or not.
 boolean invertExpandState(boolean animate)
          Changes expanded state to opposite and returns whether operation succeed or not.
 boolean isAnimate()
          Returns whether animate transition between states or not.
 boolean isAnimating()
          Returns whether collapsible pane is performing animated transition at the moment or not.
 boolean isExpanded()
          Returns whether this collapsible pane is expanded or not.
 boolean isLanguageSet()
          Returns whether this component registered in LanguageManager or not.
 boolean isRotateStateIcon()
          Returns whether rotate state icon according to title pane position or not.
 boolean isShowStateIcon()
          Returns whether display state icon in title pane or not.
 boolean isStateChangeEnabled()
          Returns whether collapsible pane state change is enabled 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 removeCollapsiblePaneListener(CollapsiblePaneListener listener)
          Removes collapsible pane listener.
 void removeLanguage()
          Unregisters component from LanguageManager.
 void removeLanguageUpdater()
          Unregisters any custom language updater set for this component.
 void saveSettings()
          Saves component settings.
 void setAnimate(boolean animate)
          Sets whether animate transition between states or not
 void setCollapseIcon(javax.swing.ImageIcon collapseIcon)
          Sets expanded state icon.
 void setCollapsiblePaneListeners(java.util.List<CollapsiblePaneListener> listeners)
          Sets collapsible pane listeners.
 void setContent(java.awt.Component content)
          Sets collapsible pane content.
 void setContentMargin(java.awt.Insets margin)
          Sets content margin.
 void setContentMargin(int margin)
          Sets content margin.
 void setContentMargin(int top, int left, int bottom, int right)
          Sets content margin.
 boolean setExpanded(boolean expanded)
          Changes expanded state to specified one and returns whether operation succeed or not.
 boolean setExpanded(boolean expanded, boolean animate)
          Changes expanded state to specified one and returns whether operation succeed or not.
 void setExpandIcon(javax.swing.ImageIcon expandIcon)
          Sets collapsed state icon.
 void setIcon(javax.swing.Icon icon)
          Sets default title component icon.
 void setLanguage(java.lang.String key, java.lang.Object... data)
          Registers component in LanguageManager under specified key and with specified formatting data.
 void setLanguageUpdater(LanguageUpdater updater)
          Registers custom language updater for this component.
 void setRotateStateIcon(boolean rotateStateIcon)
          Sets whether rotate state icon according to title pane position or not.
 void setShowStateIcon(boolean showStateIcon)
          Sets whether display state icon in title pane or not.
 void setStateChangeHandler(DataProvider<java.lang.Boolean> stateChangeHandler)
          Sets handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.
 void setStateIconMargin(java.awt.Insets margin)
          Sets state icon margin.
 void setStateIconPostion(int stateIconPostion)
          Sets state icon position in title pane.
protected  void setStateIcons()
          Installs state icons into state change button.
 void setTitle(java.lang.String title)
          Sets default title component text.
 void setTitleAlignment(int alignment)
          Sets default title component text alignment.
 void setTitleComponent(java.awt.Component titleComponent)
          Sets custom title component.
 void setTitlePanePostion(int titlePanePostion)
          Sets title pane position in collapsible pane.
protected  void stopAnimation()
          Stops state transition animation.
protected  void takeFocus()
          Transfers application focus to this collapsible pane.
 void unregisterSettings()
          Unregisters component from settings auto-save.
protected  void updateDefaultTitleBorder()
          Updates default title component border.
protected  void updateDefaultTitleComponent()
          Updates default title component.
protected  void updateDefaultTitleComponent(javax.swing.Icon icon, java.lang.String title)
          Updates default title component with the specified title icon and text.
protected  void updateHeaderPosition()
          Updates header panel position.
protected  void updateHeaderSides()
          Updates header panel sides style.
 void updateLanguage(java.lang.Object... data)
          Updates component language and formatting data.
 void updateLanguage(java.lang.String key, java.lang.Object... data)
          Changes component language key and updates its language and formatting data.
protected  void updateStateIconMargin()
          Updates state icon margin.
protected  void updateStateIconPosition()
          Updates state icon position.
protected  void updateStateIcons()
          Updates state icons.
 
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
 
Methods inherited from interface com.alee.utils.laf.ShapeProvider
provideShape
 

Field Detail

animate

protected boolean animate
Whether animate transition between states or not.


expandIcon

protected javax.swing.ImageIcon expandIcon
Collapsed state icon.


collapseIcon

protected javax.swing.ImageIcon collapseIcon
Expanded state icon.


stateIconMargin

protected java.awt.Insets stateIconMargin
State icon margin.


rotateStateIcon

protected boolean rotateStateIcon
Whether rotate state icon according to title pane position or not.


showStateIcon

protected boolean showStateIcon
Whether display state icon in title pane or not.


stateIconPostion

protected int stateIconPostion
State icon position in title pane.


titlePanePostion

protected int titlePanePostion
Title pane position in collapsible pane.


contentMargin

protected java.awt.Insets contentMargin
Content margin.


listeners

protected java.util.List<CollapsiblePaneListener> listeners
Collapsible pane listeners.


cachedExpandIcon

protected javax.swing.ImageIcon cachedExpandIcon
Cached collapsed state icon.


cachedDisabledExpandIcon

protected javax.swing.ImageIcon cachedDisabledExpandIcon
Cached disabled collapsed state icon.


cachedCollapseIcon

protected javax.swing.ImageIcon cachedCollapseIcon
Cached expanded state icon.


cachedDisabledCollapseIcon

protected javax.swing.ImageIcon cachedDisabledCollapseIcon
Cached disabled expanded state icon.


stateChangeHandler

protected DataProvider<java.lang.Boolean> stateChangeHandler
Handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.


expanded

protected boolean expanded
Whether collapsible pane is expanded or not.


transitionProgress

protected float transitionProgress
Current collapsible pane transition progress. When pane is fully expanded this variable becomes 1f. When pane is fully collapsed this variable becomes 0f.


expandSpeed

protected float expandSpeed
Collapsible pane expand and collapse speed.


animator

protected WebTimer animator
State change animation timer.


customTitle

protected boolean customTitle
Whether custom title component is set or not.


headerPanel

protected WebPanel headerPanel
Header panel.


titleComponent

protected java.awt.Component titleComponent
Title component.


expandButton

protected WebButton expandButton
State change button.


contentPanel

protected WebPanel contentPanel
Content panel.


content

protected java.awt.Component content
Collapsible pane content.

Constructor Detail

WebCollapsiblePane

public WebCollapsiblePane()
Constructs empty collapsible pane.


WebCollapsiblePane

public WebCollapsiblePane(java.lang.String title)
Constructs empty collapsible pane with specified title text.

Parameters:
title - collapsible pane title text

WebCollapsiblePane

public WebCollapsiblePane(javax.swing.ImageIcon icon,
                          java.lang.String title)
Constructs empty collapsible pane with specified title icon and text.

Parameters:
icon - collapsible pane title icon
title - collapsible pane title text

WebCollapsiblePane

public WebCollapsiblePane(java.lang.String title,
                          java.awt.Component content)
Constructs collapsible pane with specified title text and content.

Parameters:
title - collapsible pane title text
content - collapsible pane content

WebCollapsiblePane

public WebCollapsiblePane(javax.swing.Icon icon,
                          java.lang.String title,
                          java.awt.Component content)
Constructs collapsible pane with specified title icon, text and content.

Parameters:
icon - collapsible pane title icon
title - collapsible pane title text
content - collapsible pane content
Method Detail

takeFocus

protected void takeFocus()
Transfers application focus to this collapsible pane.


updateDefaultTitleComponent

protected void updateDefaultTitleComponent()
Updates default title component.


updateDefaultTitleComponent

protected void updateDefaultTitleComponent(javax.swing.Icon icon,
                                           java.lang.String title)
Updates default title component with the specified title icon and text.

Parameters:
icon - collapsible pane title icon
title - collapsible pane title text

updateDefaultTitleBorder

protected void updateDefaultTitleBorder()
Updates default title component border.


updateHeaderPosition

protected void updateHeaderPosition()
Updates header panel position.


updateHeaderSides

protected void updateHeaderSides()
Updates header panel sides style.


updateStateIconPosition

protected void updateStateIconPosition()
Updates state icon position.


updateStateIconMargin

protected void updateStateIconMargin()
Updates state icon margin.


createDefaultTitleComponent

protected javax.swing.JComponent createDefaultTitleComponent(javax.swing.Icon icon,
                                                             java.lang.String title)
Returns new default title component with specified icon and text.

Parameters:
title - collapsible pane title text
icon - collapsible pane title icon
Returns:
new default title component with specified icon and text

getStateChangeHandler

public DataProvider<java.lang.Boolean> getStateChangeHandler()
Returns handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.

Returns:
state change handler

setStateChangeHandler

public void setStateChangeHandler(DataProvider<java.lang.Boolean> stateChangeHandler)
Sets handler that dynamically enable and disable collapsible pane state changes by providing according boolean value.

Parameters:
stateChangeHandler - new state change handler

isStateChangeEnabled

public boolean isStateChangeEnabled()
Returns whether collapsible pane state change is enabled or not.

Returns:
true if collapsible pane state change is enabled, false otherwise

isAnimating

public boolean isAnimating()
Returns whether collapsible pane is performing animated transition at the moment or not.

Returns:
true if collapsible pane is performing animated transition at the moment, false otherwise

invertExpandState

public boolean invertExpandState()
Changes expanded state to opposite and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Returns:
true if operation succeed, false otherwise

invertExpandState

public boolean invertExpandState(boolean animate)
Changes expanded state to opposite and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Parameters:
animate - whether animate state change transition or not
Returns:
true if operation succeed, false otherwise

isExpanded

public boolean isExpanded()
Returns whether this collapsible pane is expanded or not.

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

setExpanded

public boolean setExpanded(boolean expanded)
Changes expanded state to specified one and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Returns:
true if operation succeed, false otherwise

setExpanded

public boolean setExpanded(boolean expanded,
                           boolean animate)
Changes expanded state to specified one and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Parameters:
animate - whether animate state change transition or not
Returns:
true if operation succeed, false otherwise

collapse

public boolean collapse()
Changes expanded state to collapsed and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Returns:
true if operation succeed, false otherwise

collapse

public boolean collapse(boolean animate)
Changes expanded state to collapsed and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Parameters:
animate - whether animate state change transition or not
Returns:
true if operation succeed, false otherwise

finishCollapseAction

protected void finishCollapseAction()
Finishes collapse action.


expand

public boolean expand()
Changes expanded state to expanded and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Returns:
true if operation succeed, false otherwise

expand

public boolean expand(boolean animate)
Changes expanded state to expanded and returns whether operation succeed or not. Operation might fail in case state change is disabled for some reason.

Parameters:
animate - whether animate state change transition or not
Returns:
true if operation succeed, false otherwise

finishExpandAction

protected void finishExpandAction()
Finishes expand action.


stopAnimation

protected void stopAnimation()
Stops state transition animation.


getTitlePanePostion

public int getTitlePanePostion()
Returns title pane position in collapsible pane.

Returns:
title pane position in collapsible pane

setTitlePanePostion

public void setTitlePanePostion(int titlePanePostion)
Sets title pane position in collapsible pane.

Parameters:
titlePanePostion - new title pane position in collapsible pane

getContentMargin

public java.awt.Insets getContentMargin()
Returns content margin.

Returns:
content margin

setContentMargin

public void setContentMargin(java.awt.Insets margin)
Sets content margin.

Parameters:
margin - content margin

setContentMargin

public void setContentMargin(int top,
                             int left,
                             int bottom,
                             int right)
Sets content margin.

Parameters:
top - top content margin
left - left content margin
bottom - bottom content margin
right - right content margin

setContentMargin

public void setContentMargin(int margin)
Sets content margin.

Parameters:
margin - content margin

isAnimate

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

Returns:
true if animate transition between states, 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

getIcon

public javax.swing.Icon getIcon()
Returns default title component icon.

Returns:
default title component icon

setIcon

public void setIcon(javax.swing.Icon icon)
Sets default title component icon.

Parameters:
icon - new default title component icon

getTitle

public java.lang.String getTitle()
Returns default title component text.

Returns:
default title component text

setTitle

public void setTitle(java.lang.String title)
Sets default title component text.

Parameters:
title - new default title component text

setTitleAlignment

public void setTitleAlignment(int alignment)
Sets default title component text alignment.

Parameters:
alignment - new default title component text alignment

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

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

getStateIconMargin

public java.awt.Insets getStateIconMargin()
Returns state icon margin.

Returns:
state icon margin

setStateIconMargin

public void setStateIconMargin(java.awt.Insets margin)
Sets state icon margin.

Parameters:
margin - new state icon margin

isRotateStateIcon

public boolean isRotateStateIcon()
Returns whether rotate state icon according to title pane position or not.

Returns:
true if stat icon must be rotated according to title pane position, false otherwise

setRotateStateIcon

public void setRotateStateIcon(boolean rotateStateIcon)
Sets whether rotate state icon according to title pane position or not.

Parameters:
rotateStateIcon - whether rotate state icon according to title pane position or not

isShowStateIcon

public boolean isShowStateIcon()
Returns whether display state icon in title pane or not.

Returns:
true if state icon must be displayed in title pane, false otherwise

setShowStateIcon

public void setShowStateIcon(boolean showStateIcon)
Sets whether display state icon in title pane or not.

Parameters:
showStateIcon - whether display state icon in title pane or not

getStateIconPostion

public int getStateIconPostion()
Returns state icon position in title pane.

Returns:
state icon position in title pane

setStateIconPostion

public void setStateIconPostion(int stateIconPostion)
Sets state icon position in title pane.

Parameters:
stateIconPostion - new state icon position in title pane

updateStateIcons

protected void updateStateIcons()
Updates state icons.


setStateIcons

protected void setStateIcons()
Installs state icons into state change button.


clearCachedCollapseIcons

protected void clearCachedCollapseIcons()
Clears cached expanded state icons.


getCachedCollapseIcon

protected javax.swing.ImageIcon getCachedCollapseIcon()
Returns cached expanded state icon.

Returns:
cached expanded state icon

getCachedDisabledCollapseIcon

protected javax.swing.ImageIcon getCachedDisabledCollapseIcon()
Returns cached disabled expanded state icon.

Returns:
cached disabled expanded state icon

clearCachedExpandIcons

protected void clearCachedExpandIcons()
Clears cached collapsed state icons.


getCachedExpandIcon

protected javax.swing.ImageIcon getCachedExpandIcon()
Returns cached collapsed state icon.

Returns:
cached collapsed state icon

getCachedDisabledExpandIcon

protected javax.swing.ImageIcon getCachedDisabledExpandIcon()
Returns cached disabled collapsed state icon.

Returns:
cached disabled collapsed state icon

getHeaderPanel

public WebPanel getHeaderPanel()
Returns header panel.

Returns:
header panel

getExpandButton

public WebButton getExpandButton()
Returns state change button.

Returns:
state change button

getTitleComponent

public java.awt.Component getTitleComponent()
Returns title component.

Returns:
title component

setTitleComponent

public void setTitleComponent(java.awt.Component titleComponent)
Sets custom title component.

Parameters:
titleComponent - new custom title component

getContent

public java.awt.Component getContent()
Returns collapsible pane content.

Returns:
collapsible pane content

setContent

public void setContent(java.awt.Component content)
Sets collapsible pane content.

Parameters:
content - new collapsible pane content

getCollapsiblePaneListeners

public java.util.List<CollapsiblePaneListener> getCollapsiblePaneListeners()
Returns collapsible pane listeners.

Returns:
collapsible pane listeners

setCollapsiblePaneListeners

public void setCollapsiblePaneListeners(java.util.List<CollapsiblePaneListener> listeners)
Sets collapsible pane listeners.

Parameters:
listeners - new collapsible pane listeners

addCollapsiblePaneListener

public void addCollapsiblePaneListener(CollapsiblePaneListener listener)
Adds collapsible pane listener.

Parameters:
listener - collapsible pane listener to add

removeCollapsiblePaneListener

public void removeCollapsiblePaneListener(CollapsiblePaneListener listener)
Removes collapsible pane listener.

Parameters:
listener - collapsible pane listener to remove

fireExpanding

public void fireExpanding()
Notifies when collapsible pane starts to expand.


fireExpanded

public void fireExpanded()
Notifies when collapsible pane finished expanding.


fireCollapsing

public void fireCollapsing()
Notifies when collapsible pane starts to collapse.


fireCollapsed

public void fireCollapsed()
Notifies when collapsible pane finished collapsing.


getTransitionProgress

public float getTransitionProgress()
Returns current collapsible pane transition progress. Returns 1f when pane is fully expanded and 0f when pane is fully collapsed.

Returns:
current collapsible pane transition progress

getBasePreferredSize

public java.awt.Dimension getBasePreferredSize()
Returns preferred size without taking collapsible pane content into account.

Returns:
preferred size without taking collapsible pane content into account

setLanguage

public void setLanguage(java.lang.String key,
                        java.lang.Object... data)
Registers component in LanguageManager under specified key and with specified formatting data.

Specified by:
setLanguage in interface LanguageMethods
Parameters:
key - language record key
data - formatting data

updateLanguage

public void updateLanguage(java.lang.Object... data)
Updates component language and formatting data.

Specified by:
updateLanguage in interface LanguageMethods
Parameters:
data - new formatting data

updateLanguage

public void updateLanguage(java.lang.String key,
                           java.lang.Object... data)
Changes component language key and updates its language and formatting data.

Specified by:
updateLanguage in interface LanguageMethods
Parameters:
key - new language key
data - new formatting data

removeLanguage

public void removeLanguage()
Unregisters component from LanguageManager.

Specified by:
removeLanguage in interface LanguageMethods

isLanguageSet

public boolean isLanguageSet()
Returns whether this component registered in LanguageManager or not.

Specified by:
isLanguageSet in interface LanguageMethods
Returns:
true if component is registered in LanguageManager, false otherwise

setLanguageUpdater

public void setLanguageUpdater(LanguageUpdater updater)
Registers custom language updater for this component.

Specified by:
setLanguageUpdater in interface LanguageMethods
Parameters:
updater - component language updater

removeLanguageUpdater

public void removeLanguageUpdater()
Unregisters any custom language updater set for this component.

Specified by:
removeLanguageUpdater in interface LanguageMethods

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