Package org.uberfire.client.workbench
Class DefaultBeanFactory
- java.lang.Object
-
- org.uberfire.client.workbench.DefaultBeanFactory
-
- All Implemented Interfaces:
BeanFactory
@ApplicationScoped public class DefaultBeanFactory extends Object implements BeanFactory
BeanFactory using Errai IOCBeanManager to instantiate (CDI) beans
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jboss.errai.ioc.client.container.SyncBeanManageriocManager
-
Constructor Summary
Constructors Constructor Description DefaultBeanFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy(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.CompassDropControllernewDropController(WorkbenchPanelView<?> view)WorkbenchPanelPresenternewRootPanel(PerspectiveActivity activity, org.uberfire.workbench.model.PanelDefinition root)Creates a new perspective root panel for the given Perspective Activity and Root Panel Definition.WorkbenchPanelPresenternewWorkbenchPanel(org.uberfire.workbench.model.PanelDefinition definition)Creates a new panel with the properties specified in the given definition.WorkbenchPartPresenternewWorkbenchPart(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.
-
-
-
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:BeanFactoryCreates a new part presenter/view pair with the given properties.- Specified by:
newWorkbenchPartin interfaceBeanFactory- 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 aMultiTabWorkbenchPanelPresenter.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:BeanFactoryCreates a new perspective root panel for the given Perspective Activity and Root Panel Definition. The returned object must be destroyed by a call toBeanFactory.destroy(Object)when it is no longer needed.- Specified by:
newRootPanelin interfaceBeanFactory- 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:BeanFactoryCreates a new panel with the properties specified in the given definition.- Specified by:
newWorkbenchPanelin interfaceBeanFactory- 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.
-
newDropController
public CompassDropController newDropController(WorkbenchPanelView<?> view)
- Specified by:
newDropControllerin interfaceBeanFactory
-
destroy
public void destroy(Object o)
Description copied from interface:BeanFactoryDestroys 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 aWorkbenchPartPresenterinstance in will result in the destruction of that presenter, its view, and all other dependent beans injected into that graph of objects.- Specified by:
destroyin interfaceBeanFactory- Parameters:
o- a bean which was returned from one of the newXXX() methods in this class and which has not been destroyed yet.
-
-