|
|
|
|
Re: Passing a variable to View from Application.java [message #627969 is a reply to message #627016] |
Thu, 23 September 2010 08:03 |
walid ammous Messages: 5 Registered: September 2010 |
Junior Member |
|
|
Thank you very much Tom and Daniel.
What I understood is that I need to use either OSG-Services or declarative service approach.
Unfortunately I am not familiar with these. So could you please show me some Real Implementation of these techniques.
So let's say I have a variable (int x) that I declared in Application.java.
public Object start(IApplicationContext context) {
Display display = PlatformUI.createDisplay();
//declare a variable x
int x = 0;
//what to write here in order to use one of those techniques.
try {
int returnCode = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
}
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
and then in View.java
public void createPartControl(Composite parent) {
//how to retrieve the variable here
}
[Updated on: Thu, 23 September 2010 08:05] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03323 seconds