Class DefaultBeanFactory

  • All Implemented Interfaces:
    BeanFactory

    @ApplicationScoped
    public class DefaultBeanFactory
    extends Object
    implements BeanFactory
    BeanFactory using Errai IOCBeanManager to instantiate (CDI) beans
    • Field Detail

      • iocManager

        @Inject
        protected org.jboss.errai.ioc.client.container.SyncBeanManager iocManager
    • Constructor Detail

      • DefaultBeanFactory

        public DefaultBeanFactory()
    • Method Detail

      • newWorkbenchPart

        public 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)
        Description copied from interface: BeanFactory
        Creates a new part presenter/view pair with the given properties.
        Specified by:
        newWorkbenchPart in interface BeanFactory
        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

        public WorkbenchPanelPresenter newRootPanel​(PerspectiveActivity activity,
                                                    org.uberfire.workbench.model.PanelDefinition root)
        Description copied from interface: BeanFactory
        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 BeanFactory.destroy(Object) when it is no longer needed.
        Specified by:
        newRootPanel in interface BeanFactory
        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 BeanFactory.destroy(Object) when no longer in use by the application.
      • newWorkbenchPanel

        public WorkbenchPanelPresenter newWorkbenchPanel​(org.uberfire.workbench.model.PanelDefinition definition)
        Description copied from interface: BeanFactory
        Creates a new panel with the properties specified in the given definition.
        Specified by:
        newWorkbenchPanel in interface BeanFactory
        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 BeanFactory.destroy(Object) when no longer in use by the application.
      • destroy

        public void destroy​(Object o)
        Description copied from interface: BeanFactory
        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.
        Specified by:
        destroy in interface BeanFactory
        Parameters:
        o - a bean which was returned from one of the newXXX() methods in this class and which has not been destroyed yet.