Class PdoViewer<T extends PersistentDomainObject<T>,C extends PdoController<T>>

Type Parameters:
T - the PDO type
C - 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
   }
 
  • Constructor Details

    • PdoViewer

      public PdoViewer(C viewController)
      Creates a view wrapper.
      Parameters:
      viewController - the view controller
  • Method Details

    • 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: PdoEditor
      Requests the initial focus after stage is shown.
      Specified by:
      requestInitialFocus in class PdoEditor<T extends 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 PersistentDomainObject<T>>
      Returns:
      true if allowed