Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class PdoViewer<T extends org.tentackle.pdo.PersistentDomainObject<T>,C extends org.tentackle.fx.FxController & org.tentackle.pdo.PdoHolder<T>>
- java.lang.Object
-
- org.tentackle.fx.AbstractFxController
-
- org.tentackle.fx.rdc.PdoEditor<T>
-
- org.tentackle.fx.rdc.PdoViewer<T,C>
-
- Type Parameters:
T- the PDO typeC- the controller type
- All Implemented Interfaces:
org.tentackle.fx.FxController,org.tentackle.pdo.DomainContextProvider,org.tentackle.pdo.PdoHolder<T>,org.tentackle.validate.ScopeConfigurator
public class PdoViewer<T extends org.tentackle.pdo.PersistentDomainObject<T>,C extends org.tentackle.fx.FxController & org.tentackle.pdo.PdoHolder<T>> extends PdoEditor<T>
A wrapper for some view controller that can be used as a pdo editor.
Useful to view PDOs that cannot be edited.Example (in a GuiProvider):
@Override public PdoEditor<Incident> createEditor() { return new PdoViewer<Incident, IncidentView>(Fx.load(IncidentView.class)); } @Override public boolean isEditAllowed() { return false; // disable the edit item in the context menu }
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetPdo()CgetViewController()Gets the view controller.booleanisEditAllowed()Returns whether the user has sufficient permissions to edit the PDO.voidrequestInitialFocus()Requests the initial focus after stage is shown.voidsetPdo(T pdo)-
Methods inherited from class org.tentackle.fx.rdc.PdoEditor
getDomainContext, getValidationMappers, getValidationPath, isChangeable, isNewAllowed, isRemoveAllowed, isViewAllowed, print, setChangeable, validateForm
-
Methods inherited from class org.tentackle.fx.AbstractFxController
configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjections
-
-
-
-
Constructor Detail
-
PdoViewer
public PdoViewer(C viewController)
Creates a view wrapper.- Parameters:
viewController- the view controller
-
-
Method Detail
-
getViewController
public C getViewController()
Gets the view controller.- Returns:
- the controller
-
getPdo
public T getPdo()
-
setPdo
public void setPdo(T pdo)
-
requestInitialFocus
public void requestInitialFocus()
Description copied from class:PdoEditorRequests the initial focus after stage is shown.- Specified by:
requestInitialFocusin classPdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>>
-
isEditAllowed
public boolean isEditAllowed()
Description copied from class:PdoEditorReturns whether the user has sufficient permissions to edit the PDO.- Overrides:
isEditAllowedin classPdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>>- Returns:
- true if allowed
-
-