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 with
add(Sendable)
, add(String, Object)
, and add(String, Sendable)
. Widgets can
also be added to layouts with getLayout(String, String)
; layouts can be nested
arbitrarily deep (note that too many levels may make deeper components unusable).-
Method Summary
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.SuppliedValueWidget<Boolean>
addBoolean(String title, BooleanSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<boolean[]>
addBooleanArray(String title, Supplier<boolean[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<double[]>
addDoubleArray(String title, Supplier<double[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<Double>
addNumber(String title, DoubleSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<byte[]>
addRaw(String title, Supplier<byte[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<String>
addString(String title, Supplier<String> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<String[]>
addStringArray(String title, Supplier<String[]> valueSupplier)
Adds a widget to this container.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, addCamera, addPersistent, getLayout
-
Method Details
-
getTitle
-
getComponents
Description copied from interface:ShuffleboardContainer
Gets the components that are direct children of this container.- Specified by:
getComponents
in interfaceShuffleboardContainer
- Returns:
- The components that are direct children of this container.
-
getLayout
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
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
-
add
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
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
-
add
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)
-
addString
Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addString
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addNumber
Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addNumber
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addBoolean
Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addBoolean
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addStringArray
public SuppliedValueWidget<String[]> addStringArray(String title, Supplier<String[]> valueSupplier)Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addStringArray
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addDoubleArray
public SuppliedValueWidget<double[]> addDoubleArray(String title, Supplier<double[]> valueSupplier)Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addDoubleArray
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addBooleanArray
public SuppliedValueWidget<boolean[]> addBooleanArray(String title, Supplier<boolean[]> valueSupplier)Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addBooleanArray
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
addRaw
Description copied from interface:ShuffleboardContainer
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Specified by:
addRaw
in interfaceShuffleboardContainer
- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
-
buildInto
-