Documentation Language: Swift

Class

RemoveCommand

Command to remove a value from a many-valued structural feature.

@MainActor final class RemoveCommand

Overview

RemoveCommand removes an element from a collection-valued feature on an EObject, storing the removal index and value to enable proper undo operations.

Example Usage

let command = RemoveCommand(
    object: company,
    feature: employeesReference,
    value: employeeToRemove
)

try await command.execute()
try await command.undo() // Restores the removed employee

Topics

Initializers

?
init(object:feature:value:)

Creates a new remove command.

Instance Properties

V
canRedo

Indicates whether the command can be redone after being undone.

V
canUndo

Indicates whether the command can be undone.

V
description

A human-readable description of the command.

V
feature

The many-valued feature to remove from.

V
objectId

The object to modify.

V
value

The value to remove.

Instance Methods

F
execute()

Execute the command, applying its changes to the model.

F
redo()

Redo the command, re-applying its changes after undo.

F
undo()

Undo the command, reversing its changes to the model.

Relationships

Inherits From

Conforms To