Class PdoViewer<T extends org.tentackle.pdo.PersistentDomainObject<T>,​C extends PdoController<T>>

  • Type Parameters:
    T - the PDO type
    C - the controller type
    All Implemented Interfaces:
    org.tentackle.fx.FxController, PdoController<T>, org.tentackle.pdo.DomainContextProvider, org.tentackle.validate.ScopeConfigurator

    public class PdoViewer<T extends org.tentackle.pdo.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
       }
     
    • Constructor Summary

      Constructors 
      Constructor Description
      PdoViewer​(C viewController)
      Creates a view wrapper.
    • 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()
        Description copied from interface: PdoController
        Gets the PDO.
        Returns:
        the pdo
      • setPdo

        public void setPdo​(T pdo)
        Sets the PDO.
        Parameters:
        pdo - the pdo
      • requestInitialFocus

        public void requestInitialFocus()
        Description copied from class: PdoEditor
        Requests the initial focus after stage is shown.
        Specified by:
        requestInitialFocus in class PdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>>
      • isEditAllowed

        public boolean isEditAllowed()
        Description copied from class: PdoEditor
        Returns whether the user has sufficient permissions to edit the PDO.
        Overrides:
        isEditAllowed in class PdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>>
        Returns:
        true if allowed