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 ComplexWidgetadd(Sendable sendable)Adds a widget to this container to display the given sendable.ComplexWidgetadd(String title, Sendable sendable)Adds a widget to this container to display the given sendable.SimpleWidgetadd(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.voidbuildInto(NetworkTable parentTable, NetworkTable metaTable)List<ShuffleboardComponent<?>>getComponents()Gets the components that are direct children of this container.ShuffleboardLayoutgetLayout(String title)Gets the already-defined layout in this container with the given title.ShuffleboardLayoutgetLayout(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.StringgetTitle()-
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:ShuffleboardContainerGets the components that are direct children of this container.- Specified by:
getComponentsin interfaceShuffleboardContainer
-
getLayout
public ShuffleboardLayout getLayout(String title, String type)
Description copied from interface:ShuffleboardContainerGets 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:
getLayoutin 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:ShuffleboardContainerGets 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:
getLayoutin 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:ShuffleboardContainerAdds a widget to this container to display the given sendable.- Specified by:
addin 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:ShuffleboardContainerAdds a widget to this container to display the given sendable.- Specified by:
addin 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:ShuffleboardContainerAdds a widget to this container to display the given data.- Specified by:
addin 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
public SuppliedValueWidget<String> addString(String title, Supplier<String> valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addStringin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addNumber
public SuppliedValueWidget<Double> addNumber(String title, DoubleSupplier valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addNumberin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addBoolean
public SuppliedValueWidget<Boolean> addBoolean(String title, BooleanSupplier valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addBooleanin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addStringArray
public SuppliedValueWidget<String[]> addStringArray(String title, Supplier<String[]> valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addStringArrayin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addDoubleArray
public SuppliedValueWidget<double[]> addDoubleArray(String title, Supplier<double[]> valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addDoubleArrayin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addBooleanArray
public SuppliedValueWidget<boolean[]> addBooleanArray(String title, Supplier<boolean[]> valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addBooleanArrayin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
addRaw
public SuppliedValueWidget<byte[]> addRaw(String title, Supplier<byte[]> valueSupplier) throws IllegalArgumentException
Description copied from interface:ShuffleboardContainerAdds 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:
addRawin interfaceShuffleboardContainer- Parameters:
title- the title of the widgetvalueSupplier- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException- if a widget already exists in this container with the given title
-
buildInto
public void buildInto(NetworkTable parentTable, NetworkTable metaTable)
-
-