# Class CarRow

java.lang.Object
com.codename1.car.CarRow

public class CarRow extends Object

A single selectable row in a `CarListTemplate`. Maps to `androidx.car.app.model.Row` and to a `CPListItem` on CarPlay. A row has a primary title, an optional secondary text line, an optional leading image and an activation listener.

    CarRow track = new CarRow("Take Five")
            .setText("Dave Brubeck")
            .setImage(albumArt)
            .setOnAction(ctx -> play(trackId));

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CarRow()`
  Creates an empty row.
  `CarRow(String title)`
  Creates a row with the supplied title.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Image`
  `getImage()`
  Returns the leading image, or null.
  `CarActionListener`
  `getOnAction()`
  Returns the activation listener, or null.
  `String`
  `getText()`
  Returns the secondary text line, or null.
  `String`
  `getTitle()`
  Returns the primary title.
  `boolean`
  `isBrowsable()`
  Returns true when this row drills into a sub-screen (renders a chevron).
  `CarRow`
  `setBrowsable(boolean browsable)`
  Marks this row as browsable, i.e.
  `CarRow`
  `setImage(Image image)`
  Sets the leading image (album art, POI thumbnail, icon).
  `CarRow`
  `setOnAction(CarActionListener listener)`
  Sets the listener invoked (on the EDT) when the row is selected.
  `CarRow`
  `setText(String text)`
  Sets the secondary text line shown under the title.
  `CarRow`
  `setTitle(String title)`
  Sets the primary title.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CarRow

    public CarRow()
    Creates an empty row.

  - ### CarRow

    public CarRow(String title)

    Creates a row with the supplied title.

    ###### Parameters

    - `title`: the primary line

- ## Method Details

  - ### getTitle

    public String getTitle()
    Returns the primary title.

  - ### setTitle

    public CarRow setTitle(String title)

    Sets the primary title.

    ###### Parameters

    - `title`: the primary line

    ###### Returns

    this row, for chaining

  - ### getText

    public String getText()
    Returns the secondary text line, or null.

  - ### setText

    public CarRow setText(String text)

    Sets the secondary text line shown under the title.

    ###### Parameters

    - `text`: the secondary line

    ###### Returns

    this row, for chaining

  - ### getImage

    public Image getImage()
    Returns the leading image, or null.

  - ### setImage

    public CarRow setImage(Image image)

    Sets the leading image (album art, POI thumbnail, icon).

    ###### Parameters

    - `image`: the leading image

    ###### Returns

    this row, for chaining

  - ### isBrowsable

    public boolean isBrowsable()
    Returns true when this row drills into a sub-screen (renders a chevron).

  - ### setBrowsable

    public CarRow setBrowsable(boolean browsable)

    Marks this row as browsable, i.e. selecting it pushes a deeper `CarScreen` (the head unit renders a disclosure chevron). Set this for rows whose listener pushes another screen.

    ###### Parameters

    - `browsable`: true to render a drill-in affordance

    ###### Returns

    this row, for chaining

  - ### getOnAction

    public CarActionListener getOnAction()
    Returns the activation listener, or null.

  - ### setOnAction

    public CarRow setOnAction(CarActionListener listener)

    Sets the listener invoked (on the EDT) when the row is selected.

    ###### Parameters

    - `listener`: the activation callback

    ###### Returns

    this row, for chaining