Information Technology Reference
In-Depth Information
The lifecycle annotations
All the visible UberFire components (perspectives, editors, pop ups, and screens) are
defined in a way that makes them very detached from any core UberFire functionality. All
you have to do is annotate certain methods to let UberFire connect them for you to all the
right places. However, we just started with configuration annotations, and we still have to
see a very important group of annotations that are used to define what to do on specific
events that the workbench will send to your components.
Whenever a perspective changes, a screen is created, an editor is closed, or when the work-
bench needs to shut down, we need a way to tell our components how to react or even pass
specific information about the event. For events as common as opening, closing, or focus-
ing on a component, UberFire provides us with a series of lifecycle annotations that are vis-
ible in the following diagram:
The annotations shown in the preceding diagram are as follows:
@OnStartup : When the component is initialized, methods marked with this an-
notation are called. For workbench editors, the method should have a VFS path ob-
ject as a parameter and for all other workbench parts it should have zero paramet-
ers. It is commonly used to initialize server components.
Search WWH ::




Custom Search