EditOperation

interface EditOperation<T>(source)

Represents an ongoing edit operation of some View. The operation defines any View associated with the edit and the data that gets returned when completed.

Functions

Link copied to clipboard
abstract fun cancel()

Called to cancel editing and allow the operation to clean up. Any View returned by invoke will be removed from the editing control at this point.

Link copied to clipboard
abstract fun complete(): Result<T>

Called when editing is requested to complete. This can happen if the user triggers a key or mouse event, of if the control being edited needs to transition away from editing and would like to get a result.

Link copied to clipboard
abstract operator fun invoke(): View?

Called to initiate the edit. This allows an optional View to be used within the editing control as a replacement for the existing item being edited. A good example is returning a TextField when editing some text. The text field would be inserted into the editing control in place of the text while editing happens.