T - the PDO type@FxControllerService(binding=NO) public class PdoCrud<T extends PersistentDomainObject<T>> extends AbstractFxController implements PdoHolder<T>
| Constructor and Description |
|---|
PdoCrud() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPdoEventFilter(javafx.event.EventType<PdoEvent> eventType,
javafx.event.EventHandler<PdoEvent> eventFilter)
Adds a PDO-event filter.
|
void |
addPdoEventHandler(javafx.event.EventType<PdoEvent> eventType,
javafx.event.EventHandler<PdoEvent> eventHandler)
Adds a PDO-event handler.
|
void |
cancel()
Closes this CRUD.
|
protected boolean |
closeIfModal()
Closes the stage if modal.
|
void |
configure() |
protected InteractiveError |
createInteractiveError(org.tentackle.validate.ValidationResult validationResult)
Creates an interactive error from a validation result.
|
protected List<InteractiveError> |
createInteractiveErrors(List<org.tentackle.validate.ValidationResult> validationResults)
Creates interactive errors from validation results.
|
void |
delete()
Deletes the current PDO.
|
void |
find()
Searches for a PDO.
|
FxHBox |
getButtonBox()
Gets the HBox containing all buttons.
|
PdoEditor<T> |
getEditor()
Gets the pdo editor.
|
T |
getPdo()
Gets the pdo.
|
List<T> |
getPdoList()
Gets the list of pdos to walk through.
|
void |
initialize(URL location,
ResourceBundle resources) |
boolean |
isEditable()
Gets whether the user can change the editor's contents.
|
boolean |
isEditing()
Returns whether the PDO is being edited effectively.
|
boolean |
isModal()
Returns whether CRUD should be treated as modal.
|
void |
newPdo()
Discards the current PDO and edits a new one.
|
void |
next()
Navigates to the next PDO in the list.
|
void |
previous()
Navigates to the previous PDO in the list.
|
void |
print()
Prints the PDO.
|
boolean |
releasePdo()
Releases the current PDO.
|
void |
removeAllPdoEventListeners()
Removes all PDO-event handlers and filters.
The method is provided to avoid memleaks. |
void |
removePdoEventFilter(javafx.event.EventType<PdoEvent> eventType,
javafx.event.EventHandler<PdoEvent> eventFilter)
Removes a PDO-event filter.
|
void |
removePdoEventHandler(javafx.event.EventType<PdoEvent> eventType,
javafx.event.EventHandler<PdoEvent> eventHandler)
Removes a PDO-event handler.
|
void |
save()
Saves the current PDO.
|
void |
security()
Shows the security dialog.
|
void |
setEditable(boolean editable)
Sets whether the user can change the editor's contents.
|
void |
setEditor(PdoEditor<T> editor)
Sets the pdo editor.
|
void |
setModal(boolean modal)
Sets this CRUD should be treated as modal.
Modality cannot be retrieved from the stage because there may be no stage yet. |
void |
setPdo(T pdo)
Sets the pdo to edit.
|
void |
setPdoList(javafx.collections.ObservableList<T> pdoList)
Sets a list of PDOs to walk through via the up and next buttons.
|
protected void |
showValidationResults(org.tentackle.validate.ValidationFailedException ex)
Shows the validation errors.
|
void |
tree()
Shows the browser tree of the current PDO.
|
protected void |
updateButtons()
Updates the visibility and disabled state of the buttons.
|
protected void |
updatePrevNextButtons()
Enables/Disables the previous and next buttons.
|
void |
updateTitle()
Updates the window title if attached to its own stage.
|
createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionspublic void setEditable(boolean editable)
editable - true if editablepublic boolean isEditable()
public boolean isEditing()
public boolean isModal()
public void setModal(boolean modal)
modal - true if modalpublic void setPdoList(javafx.collections.ObservableList<T> pdoList)
pdoList - the pdos, null to disable list navigationpublic void setEditor(PdoEditor<T> editor)
editor - the editorpublic void setPdo(T pdo)
setPdo in interface PdoHolder<T extends PersistentDomainObject<T>>pdo - the pdopublic T getPdo()
getPdo in interface PdoHolder<T extends PersistentDomainObject<T>>public void updateTitle()
public void initialize(URL location, ResourceBundle resources)
initialize in interface javafx.fxml.Initializableinitialize in class AbstractFxControllerpublic void configure()
configure in interface FxControllerconfigure in class AbstractFxControllerpublic void tree()
public void previous()
public void next()
public void security()
public void newPdo()
public void save()
public void delete()
public void cancel()
public void find()
public boolean releasePdo()
public void print()
public FxHBox getButtonBox()
public void removeAllPdoEventListeners()
public void addPdoEventFilter(javafx.event.EventType<PdoEvent> eventType, javafx.event.EventHandler<PdoEvent> eventFilter)
eventType - the event typeeventFilter - the filterpublic void removePdoEventFilter(javafx.event.EventType<PdoEvent> eventType, javafx.event.EventHandler<PdoEvent> eventFilter)
eventType - the event typeeventFilter - the filterpublic void addPdoEventHandler(javafx.event.EventType<PdoEvent> eventType, javafx.event.EventHandler<PdoEvent> eventHandler)
eventType - the event typeeventHandler - the handlerpublic void removePdoEventHandler(javafx.event.EventType<PdoEvent> eventType, javafx.event.EventHandler<PdoEvent> eventHandler)
eventType - the event typeeventHandler - the handlerprotected void updateButtons()
protected void updatePrevNextButtons()
protected boolean closeIfModal()
protected InteractiveError createInteractiveError(org.tentackle.validate.ValidationResult validationResult)
validationResult - the validation resultprotected List<InteractiveError> createInteractiveErrors(List<org.tentackle.validate.ValidationResult> validationResults)
validationResults - the validation resultsprotected void showValidationResults(org.tentackle.validate.ValidationFailedException ex)
ex - the validation exceptionTentackle - distributed, domain- and model-driven