Interface Edit
public interface Edit
-
Method Summary
Modifier and TypeMethodDescriptionReturns the prepared attribute that is being edited.default void
setEditInProgress
(boolean editInProgress) Optional method indicating that edit is still ongoingvoid
setInvalid
(String cause) Sets the validation state of this edit to false.void
Sets the value.
-
Method Details
-
getPreparedAttribute
PreparedAttribute getPreparedAttribute()Returns the prepared attribute that is being edited.- Returns:
- the prepared attribute that is being edited.
-
setValue
Sets the value. The supplied value must adhere to both the type and refinement of this edit's prepared attribute. Implicitly sets this edit to valid.- Parameters:
value
- The value to set.
-
setInvalid
Sets the validation state of this edit to false. Invalid edits suggests that the user has tried to make changes to the attribute but that the changes are not valid for the attribute. For example, implementors that show multiple attribute editors in the same view and has an OK button might disable the OK button if any of the edits are invalid, or show a message that some of the data will not be saved when a user clicks the OK button.
CallingsetValue
implicitly sets the validation state to true, indicating a valid edit.- Parameters:
cause
- A message that can be shown to a user to indicate why the edit is not valid. Implementations are free to ignore the cause, treating the call to this method as changing a boolean to false.- Throws:
NullPointerException
- if cause is null.
-
setEditInProgress
default void setEditInProgress(boolean editInProgress) Optional method indicating that edit is still ongoing- Parameters:
editInProgress
- boolean indicating if the edit is still ongoing
-