Interface BeanFactory

  • All Known Implementing Classes:
    DefaultBeanFactory

    public interface BeanFactory
    A Factory definition to create new instances of managed beans.
    • Method Detail

      • newWorkbenchPart

        WorkbenchPartPresenter newWorkbenchPart​(org.uberfire.workbench.model.menu.Menus menus,
                                                String title,
                                                com.google.gwt.user.client.ui.IsWidget titleDecoration,
                                                org.uberfire.workbench.model.PartDefinition definition,
                                                Class<? extends WorkbenchPartPresenter> partType)
        Creates a new part presenter/view pair with the given properties.
        Parameters:
        menus - The menus to associate with the new part. Null means no menus.
        title - The title to associate with the new part that the containing panel may display (for example, as the tab label in a MultiTabWorkbenchPanelPresenter.
        titleDecoration - The title decoration that a panel may choose to display beside the part's title. Null is permitted, and means no title decoration.

        NOTE: presently, none of the built-in panel types display a part's title decoration.

        definition - Defines all other aspects of the part to create. Must not be null.
        partType - The new part type.
        Returns:
      • newRootPanel

        WorkbenchPanelPresenter newRootPanel​(PerspectiveActivity activity,
                                             org.uberfire.workbench.model.PanelDefinition root)
        Creates a new perspective root panel for the given Perspective Activity and Root Panel Definition. The returned object must be destroyed by a call to destroy(Object) when it is no longer needed.
        Parameters:
        activity - the perspective that the root panel is being created for. Must not be null.
        root - description of the panel to create. Must not be null.
        Returns:
        a new WorkbenchPanelPresenter configured as specified in the given panel definition. This bean must be passed to destroy(Object) when no longer in use by the application.
      • newWorkbenchPanel

        WorkbenchPanelPresenter newWorkbenchPanel​(org.uberfire.workbench.model.PanelDefinition definition)
        Creates a new panel with the properties specified in the given definition.
        Parameters:
        definition - specification of the panel that should be created. Must not be null.
        Returns:
        a new panel presenter/view pair that is ready for use in the workbench. This bean must be passed to destroy(Object) when no longer in use by the application.
      • destroy

        void destroy​(Object o)
        Destroys the entire graph of beans that were created and returned via a call to any of the newXXX() methods in this class. For example, passing a WorkbenchPartPresenter instance in will result in the destruction of that presenter, its view, and all other dependent beans injected into that graph of objects.
        Parameters:
        o - a bean which was returned from one of the newXXX() methods in this class and which has not been destroyed yet.