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 Details

    • getTitle

      public String getTitle()
    • getComponents

      Description copied from interface: ShuffleboardContainer
      Gets the components that are direct children of this container.
      Specified by:
      getComponents in interface ShuffleboardContainer
      Returns:
      The components that are direct children of this container.
    • 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, use ShuffleboardContainer.getLayout(String, LayoutType) and the layouts in BuiltInLayouts.
      Specified by:
      getLayout in interface ShuffleboardContainer
      Parameters:
      title - the title of the layout
      type - the type of the layout, eg "List Layout" or "Grid Layout"
      Returns:
      the layout
      See Also:
    • 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the layout to get
      Returns:
      the layout 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      sendable - the sendable to display
      Returns:
      a widget to display the sendable data
    • add

      public ComplexWidget add(Sendable sendable)
      Description copied from interface: ShuffleboardContainer
      Adds a widget to this container to display the given sendable.
      Specified by:
      add in interface ShuffleboardContainer
      Parameters:
      sendable - the sendable to display
      Returns:
      a widget to display the sendable data
    • 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      defaultValue - the default value of the widget
      Returns:
      a widget to display the sendable data
      See Also:
    • add

      public SimpleWidget add(String title, String typeString, Object defaultValue)
      Description copied from interface: ShuffleboardContainer
      Adds a widget to this container to display the given data.
      Specified by:
      add in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      typeString - the NT type string
      defaultValue - the default value of the widget
      Returns:
      a widget to display the sendable data
      See Also:
    • addString

      public SuppliedValueWidget<String> addString(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:
      addString in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addNumber

      public SuppliedValueWidget<Double> addNumber(String title, DoubleSupplier 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:
      addNumber in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addDouble

      public SuppliedValueWidget<Double> addDouble(String title, DoubleSupplier 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:
      addDouble in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addFloat

      public SuppliedValueWidget<Float> addFloat(String title, FloatSupplier 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:
      addFloat in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addInteger

      public SuppliedValueWidget<Long> addInteger(String title, LongSupplier 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:
      addInteger in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addBoolean

      public SuppliedValueWidget<Boolean> addBoolean(String title, BooleanSupplier 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:
      addBoolean in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addFloatArray

      public SuppliedValueWidget<float[]> addFloatArray(String title, Supplier<float[]> 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:
      addFloatArray in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addIntegerArray

      public SuppliedValueWidget<long[]> addIntegerArray(String title, Supplier<long[]> 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:
      addIntegerArray in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - 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 interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • addRaw

      public SuppliedValueWidget<byte[]> addRaw(String title, String typeString, Supplier<byte[]> 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:
      addRaw in interface ShuffleboardContainer
      Parameters:
      title - the title of the widget
      typeString - the NT type string for the value
      valueSupplier - the supplier for values
      Returns:
      a widget to display data
    • buildInto

      public void buildInto(NetworkTable parentTable, NetworkTable metaTable)