liunx
liunx

Reputation: 761

Eclipse how to send a message to a view?

I want to write a manage program, the core manager thread can control the display of views etc, but how to make it?
Are there any message notify mechanism in eclipse to do this work?

Upvotes: 2

Views: 715

Answers (2)

Java_Waldi
Java_Waldi

Reputation: 934

There is a possibility to share Data between multiple instances by binding it to the shell:

Setter:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setData(key, value);

Getter:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getData(key);

Upvotes: 1

liunx
liunx

Reputation: 761

IPropertyChangeListener!

Using IPropertyChangeListener can realize my demand, it can be a bridge to any elements, from a ui to ui, from a background job to a ui part or any other relation, so with this interface, we can use a job to get data from remote server, then notify the ui views to update it's contents.
this link shows that how to use IPropertyChangeListener

Upvotes: 1

Related Questions