Interface EntityPanel.Builder

  • Enclosing class:
    EntityPanel

    public static interface EntityPanel.Builder
    A class providing EntityPanel instances.
    • Method Detail

      • entityType

        EntityType entityType()
        Returns:
        the entityType
      • caption

        EntityPanel.Builder caption​(String caption)
        Parameters:
        caption - the panel caption
        Returns:
        this builder instance
      • getCaption

        String getCaption()
        Returns:
        the caption to use when the EntityPanel is shown in f.x. menus
      • detailPanelBuilder

        EntityPanel.Builder detailPanelBuilder​(EntityPanel.Builder panelBuilder)
        Adds the given detail panel builder to this panel builder, if it hasn't been previously added
        Parameters:
        panelBuilder - the detail panel provider
        Returns:
        this builder instance
      • refreshOnInit

        EntityPanel.Builder refreshOnInit​(boolean refreshOnInit)
        Parameters:
        refreshOnInit - if true then the data model this panel is based on will be refreshed when the panel is initialized
        Returns:
        this builder instance
      • tableConditionPanelVisible

        EntityPanel.Builder tableConditionPanelVisible​(boolean tableConditionPanelVisible)
        Parameters:
        tableConditionPanelVisible - if true then the table condition panel is made visible when the panel is initialized
        Returns:
        this builder instance
      • detailPanelState

        EntityPanel.Builder detailPanelState​(EntityPanel.PanelState detailPanelState)
        Parameters:
        detailPanelState - the state of the detail panels when this panel is initialized
        Returns:
        this builder instance
      • detailSplitPanelResizeWeight

        EntityPanel.Builder detailSplitPanelResizeWeight​(double detailSplitPanelResizeWeight)
        Parameters:
        detailSplitPanelResizeWeight - the split panel resize weight to use when initializing this panel with its detail panels
        Returns:
        this builder instance
      • preferredSize

        EntityPanel.Builder preferredSize​(Dimension preferredSize)
        Parameters:
        preferredSize - the preferred panel size
        Returns:
        this builder instance
      • panelClass

        EntityPanel.Builder panelClass​(Class<? extends EntityPanel> panelClass)
        Note that setting the EntityPanel class overrides any table panel or edit panel classes that have been set.
        Parameters:
        panelClass - the EntityPanel class to use when providing this panel
        Returns:
        this builder instance
      • editPanelClass

        EntityPanel.Builder editPanelClass​(Class<? extends EntityEditPanel> editPanelClass)
        Parameters:
        editPanelClass - the EntityEditPanel class to use when providing this panel
        Returns:
        this builder instance
      • tablePanelClass

        EntityPanel.Builder tablePanelClass​(Class<? extends EntityTablePanel> tablePanelClass)
        Parameters:
        tablePanelClass - the EntityTablePanel class to use when providing this panel
        Returns:
        this builder instance
      • onBuildPanel

        EntityPanel.Builder onBuildPanel​(Consumer<EntityPanel> onBuildPanel)
        Parameters:
        onBuildPanel - called after the entity panel has been built
        Returns:
        this builder instance
      • onBuildTablePanel

        EntityPanel.Builder onBuildTablePanel​(Consumer<EntityTablePanel> onBuildTablePanel)
        Parameters:
        onBuildTablePanel - called after the table panel has been built
        Returns:
        this builder instance
      • buildPanel

        EntityPanel buildPanel()
        Creates an EntityPanel based on this builder, assuming a EntityModel is available.
        Returns:
        an EntityPanel based on this builder
      • buildPanel

        EntityPanel buildPanel​(EntityConnectionProvider connectionProvider)
        Creates an EntityPanel based on this builder
        Parameters:
        connectionProvider - the connection provider
        Returns:
        an EntityPanel based on this builder
      • buildPanel

        EntityPanel buildPanel​(SwingEntityModel model)
        Creates an EntityPanel based on this builder
        Parameters:
        model - the EntityModel to base this panel on
        Returns:
        an EntityPanel based on this builder
      • buildEditPanel

        EntityEditPanel buildEditPanel​(EntityConnectionProvider connectionProvider)
        Creates an EntityEditPanel
        Parameters:
        connectionProvider - the connection provider
        Returns:
        an EntityEditPanel based on this provider
      • buildTablePanel

        EntityTablePanel buildTablePanel​(EntityConnectionProvider connectionProvider)
        Creates an EntityTablePanel
        Parameters:
        connectionProvider - the connection provider
        Returns:
        an EntityTablePanel based on this provider
      • createEditPanelAction

        Action createEditPanelAction​(EntityComboBox comboBox)
        Creates a new Action which shows the edit panel provided by this panel builder and if an insert is performed adds the new entity to the comboBox and selects it.
        Parameters:
        comboBox - the combo box in which to select the new entity, if created
        Returns:
        the Action
      • createEditPanelAction

        Action createEditPanelAction​(EntitySearchField searchField)
        Creates a new Action which shows the edit panel provided by this panel builder and if an insert is performed selects the new entity in the searchField.
        Parameters:
        searchField - the search field in which to select the new entity, if created
        Returns:
        the Action
      • createEditPanelAction

        Action createEditPanelAction​(JComponent component,
                                     EntityConnectionProvider connectionProvider,
                                     EventDataListener<List<Entity>> insertListener)
        Creates a new Action which shows the edit panel provided by this panel builder and if an insert is performed insertListener is notified.
        Parameters:
        component - this component used as dialog parent, receives the focus after insert
        connectionProvider - the connection provider
        insertListener - the listener notified when insert has been performed
        Returns:
        the Action