When my application starts, one of the parts is not visible yet. When I use a handler to send data, and then open the part, I'm having trouble getting this data when the part creates. If I click on the part upon starting the application, and then use the handler again, the part will now recieve the data. So how do I get a part to receive data when it is not yet visible, or when it is created. how do I get the data that was sent earlier.
IEventBroker does not retain the data that it broadcasts.
The class for the part is not created until it is made visible (rendered to be more accurate) - you will have to store things somewhere else.
You could use some sort of 'manager' class to hold the data. Your handler can put the data in the manager and the part can retrieve it from the manager.
One way to do a manager is to use a creatable singleton:
@Creatable
@Singleton
public class MyMananger
{
...
}
This can be injected in to the handler and part and you will always get the same single instance of the manager.