Interface GuiProvider<T extends PersistentDomainObject<T>>

Type Parameters:
T - the PDO type
All Superinterfaces:
DomainContextProvider, PdoProvider<T>, TableConfigurationProvider<T>
All Known Implementing Classes:
DefaultGuiProvider, SecurityGuiProvider

public interface GuiProvider<T extends PersistentDomainObject<T>> extends PdoProvider<T>, TableConfigurationProvider<T>, DomainContextProvider
Provider of GUI-functionality for a pdo.
Author:
harald
  • Method Details

    • isBundleProvided

      boolean isBundleProvided()
      Returns whether a resource bundle is provided.
      Returns:
      true if provided, false if no bundle
    • getBundle

      ResourceBundle getBundle()
      Gets the resource bundle for this provider.

      Throws MissingResourceException if no bundle found.

      Returns:
      the resource bundle
    • createIcon

      javafx.scene.image.ImageView createIcon()
      Gets the PDO's icon.
      The icon is displayed in trees, for example.
      Returns:
      the icon
    • editorExists

      boolean editorExists()
      Returns whether a controller exists to edit or view this object.
      Returns:
      true if a controller exists
      See Also:
    • isEditAllowed

      boolean isEditAllowed()
      Returns whether the editor allows editing of the current pdo.
      Returns:
      true if editing allowed, always false if !editorExists
    • isViewAllowed

      boolean isViewAllowed()
      Returns whether the editor allows viewing of the current pdo.
      Returns:
      true if viewing allowed, always false if !editorExists
    • createEditor

      PdoEditor<T> createEditor()
      Creates a controller to edit or view this object.
      Returns:
      the controller
      Throws:
      FxRuntimeException - if editorExists() == false
    • finderExists

      boolean finderExists()
      Returns whether a finder exists to search for PDOs.
      Returns:
      true if controller exists
    • createFinder

      PdoFinder<T> createFinder()
      Creates a controller to search PDOs.
      Returns:
      the controller
      Throws:
      FxRuntimeException - if editorExists() == false
    • createDragboard

      javafx.scene.input.Dragboard createDragboard(javafx.scene.Node node)
      Creates the dragboard for the pdo.
      Parameters:
      node - the drag source
      Returns:
      the dragboard, null if PDO is not a DnD source
    • isDragAccepted

      boolean isDragAccepted(javafx.scene.input.DragEvent event)
      Checks whether drag over the pdo is accepted.
      Parameters:
      event - the drag event
      Returns:
      true if accepted, false if PDO does not accept the drag
    • dropDragboard

      void dropDragboard(javafx.scene.input.Dragboard dragbord)
      Drops the dragboard on the pdo.
      Parameters:
      dragbord - the dragboard
    • getTreeRoot

      T getTreeRoot()
      Gets the object to be displayed in trees in place of this object.
      Returns:
      the object to be displayed in a tree
    • getTreeText

      <P extends PersistentDomainObject<P>> String getTreeText(P parent)
      Gets the tree text with respect to the parent object this object is displayed in a tree.
      Type Parameters:
      P - the parent PDO type
      Parameters:
      parent - is the parent object, null if no parent
      Returns:
      the tree text
    • getToolTipText

      <P extends PersistentDomainObject<P>> String getToolTipText(P parent)
      Gets the tooltip text with respect to the parent object this object is displayed in a tree.
      Type Parameters:
      P - the parent PDO type
      Parameters:
      parent - is the parent object, null if no parent
      Returns:
      the tooltip text
    • createTreeItem

      javafx.scene.control.TreeItem<T> createTreeItem()
      Creates the tree item for this pdo.
      Returns:
      the tree item
    • getTreeCellFactory

      javafx.util.Callback<javafx.scene.control.TreeView<T>,javafx.scene.control.TreeCell<T>> getTreeCellFactory()
      Creates a tree cell factory for a treeview.
      Returns:
      the tree cell factory, never null
    • stopTreeExpansion

      boolean stopTreeExpansion()
      Determines whether tree explansion should stop at this object.
      Sometimes treechilds should not be expanded if in a recursive "expand all". However they should expand if the user explicitly wants to. If this method returns true, the tree will not further expand this node automatically (only on demand).
      Returns:
      true if expansion should stop.
    • providesTreeChildObjects

      boolean providesTreeChildObjects()
      Determines whether this object may have child objects that should be visible in a navigatable tree.
      Returns:
      true if object may have childs
    • getTreeChildObjects

      <P extends PersistentDomainObject<P>> Collection<? extends PersistentDomainObject<?>> getTreeChildObjects(P parent)
      Gets the childs with respect to the parent object this object is displayed in the current tree.
      Type Parameters:
      P - the parent PDO type
      Parameters:
      parent - the parent object of this object in the tree, null = no parent
      Returns:
      the childs
    • getTreeExpandMaxDepth

      int getTreeExpandMaxDepth()
      Gets the maximum level of expansion allowed in a navigatable object tree.
      The default is 0, i.e. no limit.
      Returns:
      the maximum depth of a subtree of this object, 0 = no limit (default)
    • providesTreeParentObjects

      boolean providesTreeParentObjects()
      Determines whether the navigatable object tree should show the parents of this object.
      Objects may be childs of different parents in terms of "being referenced from" or any other relation, for example: the warehouses this customer visited. Trees may provide a button to make these parents visible. The default implementation returns false.
      Returns:
      true if showing parents is enabled
    • getTreeParentObjects

      <P extends PersistentDomainObject<P>> Collection<? extends PersistentDomainObject<?>> getTreeParentObjects(P parent)
      Gets the parents with respect to the parent object this object is displayed in the current tree.
      Type Parameters:
      P - the parent PDO type
      Parameters:
      parent - the parent object, null if no parent
      Returns:
      the parents
    • createTableView

      FxTableView<T> createTableView()
      Creates the table view for given configuration.
      Returns:
      the view