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.
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
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPdo()Gets the view controller.booleanReturns whether the user has sufficient permissions to edit the PDO.voidRequests the initial focus after stage is shown.voidSets the PDO.Methods inherited from class org.tentackle.fx.rdc.PdoEditor
getDomainContext, getValidationMappers, getValidationPath, isChangeable, isNewAllowed, isRemoveAllowed, isViewAllowed, print, setChangeable, validateFormMethods 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.pdo.PdoProvider
on
-
Constructor Details
-
PdoViewer
Creates a view wrapper.- Parameters:
viewController- the view controller
-
-
Method Details
-
getViewController
Gets the view controller.- Returns:
- the controller
-
getPdo
-
setPdo
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
-