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 Constructor Description PdoEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DomainContextgetDomainContext()NavigableSet<org.tentackle.validate.ValidationMapper>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.StringgetValidationPath()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).booleanisChangeable()Get the changeable property of the editor's view.booleanisEditAllowed()Returns whether the user has sufficient permissions to edit the PDO.booleanisNewAllowed()Returns whether the user is allowed to create a new PDO.booleanisRemoveAllowed()Returns whether the user is allowed to edit the PDO and the PDO is removable.booleanisViewAllowed()Returns whether the user has sufficient permissions to view the PDO.voidprint()Prints the current PDO.abstract voidrequestInitialFocus()Requests the initial focus after stage is shown.voidsetChangeable(boolean changeable)Set the changeable property of the editor's view.booleanvalidateForm()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.-
Methods inherited from class org.tentackle.fx.AbstractFxController
configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjections
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tentackle.pdo.DomainContextProvider
on, op
-
Methods inherited from interface org.tentackle.fx.FxController
configure, getBinder, getContainer, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjections
-
Methods inherited from interface org.tentackle.fx.rdc.PdoController
setPdo
-
Methods inherited from interface org.tentackle.pdo.PdoProvider
getPdo, on
-
-
-
-
Method Detail
-
requestInitialFocus
public abstract void requestInitialFocus()
Requests the initial focus after stage is shown.
-
getDomainContext
public DomainContext 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
public String 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()
-
getValidationMappers
public NavigableSet<org.tentackle.validate.ValidationMapper> 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
-
-