# SelectionMenuComponent

Artifact: [androidx.pdf:pdf-viewer](https://developer.android.com/jetpack/androidx/releases/pdf) [View Source](https://cs.android.com/search?q=file:androidx/pdf/selection/ViewerSelectionMenuComponent.kt+class:androidx.pdf.selection.SelectionMenuComponent) Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

*** ** * ** ***


```
public final class SelectionMenuComponent extends ContextMenuComponent
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.pdf.selection.ContextMenuComponent](https://developer.android.com/reference/androidx/pdf/selection/ContextMenuComponent) ||
|   | ↳ | [androidx.pdf.selection.SelectionMenuComponent](https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuComponent) |

*** ** * ** ***

Represents a clickable item with a label in a selection menu.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuComponent#SelectionMenuComponent(kotlin.Any,kotlin.String,kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html key, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html label, https://developer.android.com/reference/java/lang/String.html contentDescription, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onClick )` |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuComponent#getContentDescription()()` An optional accessibility description for screen readers. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuComponent#getLabel()()` The text to display for this menu item. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuComponent#getOnClick()()` A lambda function invoked when the item is clicked, providing access to the `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession`. |

### Inherited methods

From [androidx.pdf.selection.ContextMenuComponent](https://developer.android.com/reference/androidx/pdf/selection/ContextMenuComponent) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/pdf/selection/ContextMenuComponent#getKey()()`

A unique identifier for this component within its context menu.

## Public constructors

### SelectionMenuComponent

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public SelectionMenuComponent(
    @NonNull Object key,
    @NonNull String label,
    String contentDescription,
    @NonNull Function1<@NonNull SelectionMenuSession, Unit> onClick
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html key` | A unique identifier for this component. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html label` | The text to display for this menu item. |
| `https://developer.android.com/reference/java/lang/String.html contentDescription` | An optional accessibility description for screen readers. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onClick` | A lambda function invoked when the item is clicked, providing access to the `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession`. |

## Public methods

### getContentDescription

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public final String getContentDescription()
```

An optional accessibility description for screen readers.

### getLabel

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public final @NonNull String getLabel()
```

The text to display for this menu item.

### getOnClick

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public final @NonNull Function1<@NonNull SelectionMenuSession, Unit> getOnClick()
```

A lambda function invoked when the item is clicked, providing access to the `https://developer.android.com/reference/androidx/pdf/selection/SelectionMenuSession`.