Class ShuffleboardTab
- java.lang.Object
-
- edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab
-
- All Implemented Interfaces:
ShuffleboardContainer
public final class ShuffleboardTab extends Object implements ShuffleboardContainer
Represents a tab in the Shuffleboard dashboard. Widgets can be added to the tab withadd(Sendable)
,add(String, Object)
, andadd(String, Sendable)
. Widgets can also be added to layouts withgetLayout(String, String)
; layouts can be nested arbitrarily deep (note that too many levels may make deeper components unusable).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComplexWidget
add(Sendable sendable)
Adds a widget to this container to display the given sendable.ComplexWidget
add(String title, Sendable sendable)
Adds a widget to this container to display the given sendable.SimpleWidget
add(String title, Object defaultValue)
Adds a widget to this container to display the given data.void
buildInto(NetworkTable parentTable, NetworkTable metaTable)
List<ShuffleboardComponent<?>>
getComponents()
Gets the components that are direct children of this container.ShuffleboardLayout
getLayout(String title)
Gets the already-defined layout in this container with the given title.ShuffleboardLayout
getLayout(String title, String type)
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.String
getTitle()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.shuffleboard.ShuffleboardContainer
add, add, addPersistent, getLayout
-
-
-
-
Method Detail
-
getTitle
public String getTitle()
-
getComponents
public List<ShuffleboardComponent<?>> getComponents()
Description copied from interface:ShuffleboardContainer
Gets the components that are direct children of this container.- Specified by:
getComponents
in interfaceShuffleboardContainer
-
getLayout
public ShuffleboardLayout getLayout(String title, String type)
Description copied from interface:ShuffleboardContainer
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called. Note: this method should only be used to use a layout type that is not already built into Shuffleboard. To use a layout built into Shuffleboard, useShuffleboardContainer.getLayout(String, LayoutType)
and the layouts inBuiltInLayouts
.- Specified by:
getLayout
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the layouttype
- the type of the layout, eg "List Layout" or "Grid Layout"- Returns:
- the layout
- See Also:
ShuffleboardContainer.getLayout(String, LayoutType)
-
getLayout
public ShuffleboardLayout getLayout(String title) throws NoSuchElementException
Description copied from interface:ShuffleboardContainer
Gets the already-defined layout in this container with the given title.Shuffleboard.getTab("Example Tab") .getLayout("My Layout", BuiltInLayouts.kList); // Later... Shuffleboard.getTab("Example Tab") .getLayout("My Layout");
- Specified by:
getLayout
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the layout to get- Returns:
- the layout with the given title
- Throws:
NoSuchElementException
- if no layout has yet been defined with the given title
-
add
public ComplexWidget add(String title, Sendable sendable)
Description copied from interface:ShuffleboardContainer
Adds a widget to this container to display the given sendable.- Specified by:
add
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetsendable
- the sendable to display- Returns:
- a widget to display the sendable data
-
add
public ComplexWidget add(Sendable sendable) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainer
Adds a widget to this container to display the given sendable.- Specified by:
add
in interfaceShuffleboardContainer
- Parameters:
sendable
- the sendable to display- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title, or if the sendable's name has not been specified
-
add
public SimpleWidget add(String title, Object defaultValue)
Description copied from interface:ShuffleboardContainer
Adds a widget to this container to display the given data.- Specified by:
add
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetdefaultValue
- the default value of the widget- Returns:
- a widget to display the sendable data
- See Also:
add(String title, Object defaultValue)
-
buildInto
public void buildInto(NetworkTable parentTable, NetworkTable metaTable)
-
-