Class SimpleWidget
java.lang.Object
edu.wpi.first.wpilibj.shuffleboard.ShuffleboardComponent<W>
edu.wpi.first.wpilibj.shuffleboard.SimpleWidget
- All Implemented Interfaces:
AutoCloseable
A Shuffleboard widget that handles a single data point such as a number or string.
-
Method Summary
Modifier and TypeMethodDescriptionvoidbuildInto(NetworkTable parentTable, NetworkTable metaTable) voidclose()getEntry()Gets the NetworkTable entry that contains the data for this widget.Gets the NetworkTable entry that contains the data for this widget.final SimpleWidgetwithWidget(WidgetType widgetType) Sets the type of widget used to display the data.final SimpleWidgetwithWidget(String widgetType) Sets the type of widget used to display the data.Methods inherited from class edu.wpi.first.wpilibj.shuffleboard.ShuffleboardComponent
buildMetadata, getParent, getTitle, getType, setType, withPosition, withProperties, withSize
-
Method Details
-
getEntry
Gets the NetworkTable entry that contains the data for this widget.- Returns:
- The NetworkTable entry that contains the data for this widget.
-
getEntry
Gets the NetworkTable entry that contains the data for this widget.- Parameters:
typeString- NetworkTable type string- Returns:
- The NetworkTable entry that contains the data for this widget.
-
close
- Specified by:
closein interfaceAutoCloseable
-
buildInto
-
withWidget
Sets the type of widget used to display the data. If not set, the default widget type will be used.- Parameters:
widgetType- the type of the widget used to display the data- Returns:
- this widget object
- See Also:
-
withWidget
Sets the type of widget used to display the data. If not set, the default widget type will be used. This method should only be used to use a widget that does not come built into Shuffleboard (i.e. one that comes with a custom or third-party plugin). To use a widget that is built into Shuffleboard, usewithWidget(WidgetType)andBuiltInWidgets.- Parameters:
widgetType- the type of the widget used to display the data- Returns:
- this widget object
-