com.tensegrity.gui.swt.control.panels.slidepanel
Class SlidePanel

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended bycom.tensegrity.gui.swt.control.panels.slidepanel.SlidePanel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class SlidePanel
extends org.eclipse.swt.widgets.Composite

The SWT SlidePanel is, like its Swing-based version, a gui container for displaying several child controls. These controls are added to the SlidePanelContent which can be hidden or shown. This goes along with the SlidePanel state collapsed or expanded.

If the parent org.eclipse.swt.widgets.Composite wants to react on any size change, i.e. if the SlidePanel state changes from collapsed to expanded or vice versa, it should register itself as a SlidePanelListener and adjust its layout on every state change.

Beside any arbitrary Controls it is also possible to add SlidePanels as nested panels to SlidePanelContent. In this case the layout of the SlidePanelContent is automatically set to SlidePanelContainerLayout and should not be changed. As a restriction it is not possible to mix SlidePanel with other Controls within a SlidePanelContent.

Version:
$Id: SlidePanel.java,v 1.2 2005/09/27 11:11:04 ArndHouben Exp $
Author:
ArndHouben

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SlidePanel(org.eclipse.swt.widgets.Composite parent, int style)
          Creates a new SlidePanel.
 
Method Summary
 void addSlidePanelListener(SlidePanelListener l)
          Adds the specified SlidePanelListener to the list of listeners which gets informed about any state change of this SlidePanel.
protected  void close()
          This disposes the SlidePanel and informs all registered SlidePanelListeners about the state change.
 SlidePanelContent getContent()
          Returns the used content component.
 SlidePanelTitle getTitle()
          Returns the used title component.
 boolean isCollapsed()
          Returns true if the SlidePanel is currently collapsed or false if it is expanded
 void layout()
           
 void removeSlidePanelListener(SlidePanelListener l)
          Removes the specified SlidePanelListener from the listener list.
protected  void toggleCollapse()
          Toggles the SlidePanel collapsed state and triggers a relayout of its content.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlidePanel

public SlidePanel(org.eclipse.swt.widgets.Composite parent,
                  int style)
Creates a new SlidePanel.

Parameters:
parent - the parent Composite of this control
style - SWT style bits
Method Detail

isCollapsed

public final boolean isCollapsed()
Returns true if the SlidePanel is currently collapsed or false if it is expanded

Returns:
the SlidePanel collapsed state

getContent

public final SlidePanelContent getContent()
Returns the used content component.

Returns:
the used SlidePanelContent

getTitle

public final SlidePanelTitle getTitle()
Returns the used title component.

Returns:
the used SlidePanelTitle

addSlidePanelListener

public final void addSlidePanelListener(SlidePanelListener l)
Adds the specified SlidePanelListener to the list of listeners which gets informed about any state change of this SlidePanel.

Parameters:
l - the SlidePanelListener to register

removeSlidePanelListener

public final void removeSlidePanelListener(SlidePanelListener l)
Removes the specified SlidePanelListener from the listener list.

Parameters:
l - the SlidePanelListener to remove

layout

public void layout()

toggleCollapse

protected final void toggleCollapse()
Toggles the SlidePanel collapsed state and triggers a relayout of its content. Additionally it informs all registered SlidePanelListeners about a state change.


close

protected final void close()
This disposes the SlidePanel and informs all registered SlidePanelListeners about the state change.



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.