Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class PdoViewer<T extends PersistentDomainObject<T>,C extends PdoController<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:
FxController,PdoController<T>,DomainContextProvider,PdoProvider<T>,org.tentackle.validate.ScopeConfigurator
public class PdoViewer<T extends PersistentDomainObject<T>,C extends PdoController<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)Sets the 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
-
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.pdo.PdoProvider
on
-
-
-
-
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)
Sets the PDO.- Parameters:
pdo- the pdo
-
requestInitialFocus
public void requestInitialFocus()
Description copied from class:PdoEditorRequests the initial focus after stage is shown.- Specified by:
requestInitialFocusin classPdoEditor<T extends 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 PersistentDomainObject<T>>- Returns:
- true if allowed
-
-