org.eclipse.swtbot.swt.finder.widgets
Class SWTBotExpandBar

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot<ExpandBar>
      extended by org.eclipse.swtbot.swt.finder.widgets.SWTBotExpandBar

public class SWTBotExpandBar
extends AbstractSWTBot<ExpandBar>

Represents an ExpandBar.

Author:
Toby Weston

Field Summary
 
Fields inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
description, display, log, widget
 
Constructor Summary
SWTBotExpandBar(ExpandBar w)
          Constructs a new instance with the given widget.
SWTBotExpandBar(ExpandBar w, SelfDescribing description)
          Constructs a new instance with the given widget.
 
Method Summary
 int collapsedItemCount()
           
 SWTBotExpandItem collapseItem(Matcher<Widget> matcher)
          Collapses the ExpandItem and returns it.
 SWTBotExpandItem collapseItem(String itemText)
          Collapses the ExpandItem and returns it.
 int expandedItemCount()
           
 SWTBotExpandItem expandItem(Matcher<Widget> matcher)
          Expands the ExpandItem and returns it.
 SWTBotExpandItem expandItem(String itemText)
          Expands the ExpandItem and returns it.
 List<SWTBotExpandItem> getAllItems()
           
 SWTBotExpandItem getExpandItem(Matcher<Widget> matcher)
          Return the ExpandItem that matches the specified matcher.
 boolean hasItems()
           
 int itemCount()
           
 
Methods inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
absoluteLocation, assertEnabled, asyncExec, backgroundColor, click, click, clickXY, contextMenu, contextMenu, createEvent, createMouseEvent, createSelectionEvent, doubleClickXY, foregroundColor, getId, getText, getToolTipText, hasStyle, isActive, isEnabled, isEnabledInternal, isVisible, keyboard, notify, notify, notify, pressShortcut, pressShortcut, pressShortcut, rightClick, rightClick, setFocus, sleep, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, toString, traverse, waitForEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SWTBotExpandBar

public SWTBotExpandBar(ExpandBar w)
Constructs a new instance with the given widget.

Parameters:
w - the widget.
Throws:
WidgetNotFoundException - if the widget is null or widget has been disposed.

SWTBotExpandBar

public SWTBotExpandBar(ExpandBar w,
                       SelfDescribing description)
Constructs a new instance with the given widget.

Parameters:
w - the widget.
description - the description of the widget, this will be reported by AbstractSWTBot.toString()
Throws:
WidgetNotFoundException - if the widget is null or widget has been disposed.
Method Detail

itemCount

public int itemCount()
Returns:
the number of ExpandItems in the widget.

expandedItemCount

public int expandedItemCount()
Returns:
the number of items that are expanded.
See Also:
itemCount(), collapsedItemCount()

collapsedItemCount

public int collapsedItemCount()
Returns:
the number of items that are collapsed.
See Also:
itemCount(), expandedItemCount()

expandItem

public SWTBotExpandItem expandItem(String itemText)
Expands the ExpandItem and returns it.

Parameters:
itemText - the text on the item.
Returns:
the SWTBotExpandItem with the specified text.

expandItem

public SWTBotExpandItem expandItem(Matcher<Widget> matcher)
Expands the ExpandItem and returns it.

Parameters:
matcher - the matcher.
Returns:
the SWTBotExpandItem that matches the matcher

collapseItem

public SWTBotExpandItem collapseItem(String itemText)
Collapses the ExpandItem and returns it.

Parameters:
itemText - the text on the item.
Returns:
the SWTBotExpandItem with the specified text.

collapseItem

public SWTBotExpandItem collapseItem(Matcher<Widget> matcher)
Collapses the ExpandItem and returns it.

Parameters:
matcher - the matcher.
Returns:
the SWTBotExpandItem that matches the matcher.

getExpandItem

public SWTBotExpandItem getExpandItem(Matcher<Widget> matcher)
Return the ExpandItem that matches the specified matcher.

Parameters:
matcher - the matcher.
Returns:
the SWTBotExpandItem with the specified text.

getAllItems

public List<SWTBotExpandItem> getAllItems()
Returns:
a list of SWTBotExpandItem or the empty list if there was a problem with any of the items.

hasItems

public boolean hasItems()
Returns:
true if the expandBar has any items, false otherwise.