how do I access to an Object of a View from somewhere else?
(Following code is just to sketch what i want to do)
public class View extends ViewPart {
public static final String ID = "view";
private static List list;
public View() {
}
@Override
public void createPartControl(Composite parent) {
list = new List(parent, SWT.BORDER);
}
@Override
public void setFocus() {
}
public static void addToList(String string) {
list.add(string);
}
}
Now I want be able to use View.addToList("Message") anywhere in the application.
Use the following code snippet, and replace
[ID]with the id you specified for your view inplugin.xml.The id is usually in the form of
com.domain.something.viewNameand can be found under your view contribution.