Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class PdoEditor<T extends PersistentDomainObject<T>>
java.lang.Object
org.tentackle.fx.AbstractFxController
org.tentackle.fx.rdc.PdoEditor<T>
- Type Parameters:
T- the pdo type
- All Implemented Interfaces:
FxController,PdoController<T>,DomainContextProvider,PdoProvider<T>,org.tentackle.validate.ScopeConfigurator
- Direct Known Subclasses:
DefaultPdoEditor,PdoViewer,SecurityEditor
public abstract class PdoEditor<T extends PersistentDomainObject<T>>
extends AbstractFxController
implements PdoController<T>, DomainContextProvider
FxController to edit a PDO.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionNavigableSet<org.tentackle.validate.ValidationMapper>Gets the validation mappers to map the validation results to the controls.
IfgetValidationPath()returns a non-null value, a set with a default mapper will be created.Gets the validation root path.
By default, the server returns validation results with a validation path that starts with the entity baseclassname (the first character in lowercase).booleanGet the changeable property of the editor's view.booleanReturns whether the user has sufficient permissions to edit the PDO.booleanReturns whether the user is allowed to create a new PDO.booleanReturns whether the user is allowed to edit the PDO and the PDO is removable.booleanReturns whether the user has sufficient permissions to view the PDO.voidprint()Prints the current PDO.abstract voidRequests the initial focus after stage is shown.voidsetChangeable(boolean changeable) Set the changeable property of the editor's view.booleanValidates the form before the PDO get saved.
This can be used for validations that are not covered by the persistence model, for example password confirmation.Methods inherited from class org.tentackle.fx.AbstractFxController
configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.pdo.DomainContextProvider
on, opMethods inherited from interface org.tentackle.fx.FxController
configure, getBinder, getContainer, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionsMethods inherited from interface org.tentackle.fx.rdc.PdoController
setPdoMethods inherited from interface org.tentackle.pdo.PdoProvider
getPdo, on
-
Constructor Details
-
PdoEditor
public PdoEditor()
-
-
Method Details
-
requestInitialFocus
public abstract void requestInitialFocus()Requests the initial focus after stage is shown. -
getDomainContext
- Specified by:
getDomainContextin interfaceDomainContextProvider
-
isViewAllowed
public boolean isViewAllowed()Returns whether the user has sufficient permissions to view the PDO.- Returns:
- true if allowed
-
isEditAllowed
public boolean isEditAllowed()Returns whether the user has sufficient permissions to edit the PDO.- Returns:
- true if allowed
-
isRemoveAllowed
public boolean isRemoveAllowed()Returns whether the user is allowed to edit the PDO and the PDO is removable.- Returns:
- true if remove allowed
-
isNewAllowed
public boolean isNewAllowed()Returns whether the user is allowed to create a new PDO.- Returns:
- true if creation allowed
-
getValidationPath
Gets the validation root path.
By default, the server returns validation results with a validation path that starts with the entity baseclassname (the first character in lowercase). If the bound PDO variable of the editor uses a different name, aValidationMapperis necessary to map the results back to the form.
This method is provided to reduce the amount of application code.- Returns:
- the validation root path, default is null
- See Also:
-
getValidationMappers
Gets the validation mappers to map the validation results to the controls.
IfgetValidationPath()returns a non-null value, a set with a default mapper will be created.- Returns:
- the mappers, null if none
-
validateForm
public boolean validateForm()Validates the form before the PDO get saved.
This can be used for validations that are not covered by the persistence model, for example password confirmation.- Returns:
- true if ok
-
print
public void print()Prints the current PDO. -
setChangeable
public void setChangeable(boolean changeable) Set the changeable property of the editor's view.- Parameters:
changeable- true if changeable
-
isChangeable
public boolean isChangeable()Get the changeable property of the editor's view.- Returns:
- true if changeable
-