|
|
Re: IStatusLineManger [message #1043019 is a reply to message #1042473] |
Wed, 17 April 2013 06:57 |
Dennis Murray Messages: 4 Registered: April 2013 |
Junior Member |
|
|
Thanks Tom. But now I have another Problem. I want to add a Statusbar in my e4 App. So i created a ToolControl, set it to the bottom of the window and linked it with the following class:
public class StatusLine {
public StatusLine() {
}
/**
* Create contents of the StatusLine
*/
@PostConstruct
public void createControls(Composite parent, IStatusLineManager statusManager) {
StatusLineContributionItem field = new StatusLineContributionItem("HelloWorld");
field.setText("Hello World");
statusManager.add(field);
}
@PreDestroy
public void dispose() {
}
@Focus
public void setFocus() {
// TODO Set the focus to control
}
}
And i get the same Error as before:
org.eclipse.e4.core.di.InjectionException: Unable to process "StatusLine#createControls()": no actual value was found for the argument "IStatusLineManager".
[Updated on: Wed, 17 April 2013 06:59] Report message to a moderator
|
|
|
Re: IStatusLineManger [message #1043129 is a reply to message #1043019] |
Wed, 17 April 2013 10:12 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
Hi,
I need this as well, looking at the IStatusLineManager a bit, I don't
think this concept is supported in e4 "out of the box". Note I am
talking pure e4 here, no dependencies on org.eclipse.ui.* plugins.
The IStatusLineManager in 3.x is produced by IActionBars
implementations, and guess what IActionBars is in the org.eclipse.ui
package/plugin.
Now, that's fine, because the whole concept of IActionBars is not
applicable in case of pure e4 (Wow, that's quiet a statement, please
shoot if this is wrong! ).
If you look a 3.x implementation of IActionBars (As seen in the attached
screenshot), you will see in SubActionBars for example this:
public IStatusLineManager getStatusLineManager() {
if (statusLineMgr == null) {
statusLineMgr = new SubStatusLineManager(parent
.getStatusLineManager());
statusLineMgr.setVisible(active);
}
return statusLineMgr;
}
So, what needs to be done for pure e4 is to add the creation of a
IStatusLineManager by Dependency injection. This is done with a
ContextInjectionFactory.make(...) method. You could do this perhaps in
the MPart related to the status line.
Hope this helps.
Cheers Christophe
On 17-04-13 08:57, Dennis Murray wrote:
> Thanks Tom. But now I have a another Problem. I want to add a Statusbar
> in my e4 App. So i created a ToolControl, set it to the bottom of the
> window and linked it with the following class:
> public class StatusLine {
>
> public StatusLine() {
> }
>
> /**
> * Create contents of the StatusLine
> */
>
> @PostConstruct
> public void createControls(Composite parent, IStatusLineManager
> statusManager) {
>
>
> StatusLineContributionItem field = new
> StatusLineContributionItem("HelloWorld");
> field.setText("Hello World");
> statusManager.add(field);
>
> }
>
> @PreDestroy
> public void dispose() {
> }
>
> @Focus
> public void setFocus() {
> // TODO Set the focus to control
> }
> }
> And i get the same Error as before:
> org.eclipse.e4.core.di.InjectionException: Unable to process
> "AboutHandler.statusLine": no actual value was found for the argument
> "IStatusLineManager"
>
>
|
|
|
Re: IStatusLineManger [message #1043883 is a reply to message #1043129] |
Thu, 18 April 2013 08:18 |
Eclipse User |
|
|
|
On a quick look I see that there is no one which puts a status line manager in the context hierarchy which means you can not inject it, no matter where you put your @Inject. If you want a status manager it's pretty trivial to provide an addon and put in a context of your choice (on a MWindow's context level for example) at start up and have it injected anywhere you need it.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03457 seconds