Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Accessing Workbench StatusBar Contribution
Accessing Workbench StatusBar Contribution [message #499534] Mon, 23 November 2009 10:01 Go to next message
Juan is currently offline Juan
Messages: 29
Registered: July 2009
Junior Member
Hello Everyone!

I need to access the statuslinemanager contribution but not using a view
or editor. Is it possible? I'm frightened it is not :(

The way i dont want to do this is the usual you can see in tutorials,
articles or forums threads:

IActionBars bars = getViewSite().getActionBars();
IStatusLineManager statusLine = bars.getStatusLineManager();
IProgressMonitor pm = statusLine.getProgressMonitor();
pm.beginTask("Doing work", IProgressMonitor.UNKNOWN);
pm.worked(1);
.... the actual work is done here...
pm.done();


I would need to access it by PlatformUI.getWorkbench.getActiveWindow()
or similar because I have a launch() button that executes a code and I
wanna put a progress bar with custom buttoms in the status line.


Thanks in advance
Re: Accessing Workbench StatusBar Contribution [message #499701 is a reply to message #499534] Mon, 23 November 2009 19:05 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 280
Registered: July 2009
Senior Member

Hi Juan,

It is indeed hard to find the status line manager. I don't know its lifecycle
but you have a reference of it in your ApplicationActionBarAdvisor.

@Override
protected void fillStatusLine(IStatusLineManager statusLine) {

super.fillStatusLine(statusLine);
}

Best regards,

Wim Jongman

> Hello Everyone!
>
> I need to access the statuslinemanager contribution but not using a view
> or editor. Is it possible? I'm frightened it is not :(
>
> The way i dont want to do this is the usual you can see in tutorials,
> articles or forums threads:
>
> IActionBars bars = getViewSite().getActionBars();
> IStatusLineManager statusLine = bars.getStatusLineManager();
> IProgressMonitor pm = statusLine.getProgressMonitor();
> pm.beginTask("Doing work", IProgressMonitor.UNKNOWN);
> pm.worked(1);
> .... the actual work is done here...
> pm.done();
>
>
> I would need to access it by PlatformUI.getWorkbench.getActiveWindow()
> or similar because I have a launch() button that executes a code and I
> wanna put a progress bar with custom buttoms in the status line.
>
>
> Thanks in advance
Re: Accessing Workbench StatusBar Contribution [message #499860 is a reply to message #499701] Tue, 24 November 2009 11:59 Go to previous messageGo to next message
Juan is currently offline Juan
Messages: 29
Registered: July 2009
Junior Member
Yes Wim (& thanks for your answer),

I think an improvement would have to be done in this part because it is
a nightmare for developers using the status line to add/remove custom
contributions without using editors or views.

I have to do a task when user clicks over my "Run" button. I would like
to show a progress bar while the job that does the task is executing and
changing the status message.

Unfortunately It's hard issue with the current API. :(


Wim Jongman escribió:
> Hi Juan,
>
> It is indeed hard to find the status line manager. I don't know its lifecycle
> but you have a reference of it in your ApplicationActionBarAdvisor.
>
> @Override
> protected void fillStatusLine(IStatusLineManager statusLine) {
>
> super.fillStatusLine(statusLine);
> }
>
> Best regards,
>
> Wim Jongman
>
>> Hello Everyone!
>>
>> I need to access the statuslinemanager contribution but not using a view
>> or editor. Is it possible? I'm frightened it is not :(
>>
>> The way i dont want to do this is the usual you can see in tutorials,
>> articles or forums threads:
>>
>> IActionBars bars = getViewSite().getActionBars();
>> IStatusLineManager statusLine = bars.getStatusLineManager();
>> IProgressMonitor pm = statusLine.getProgressMonitor();
>> pm.beginTask("Doing work", IProgressMonitor.UNKNOWN);
>> pm.worked(1);
>> .... the actual work is done here...
>> pm.done();
>>
>>
>> I would need to access it by PlatformUI.getWorkbench.getActiveWindow()
>> or similar because I have a launch() button that executes a code and I
>> wanna put a progress bar with custom buttoms in the status line.
>>
>>
>> Thanks in advance
Re: Accessing Workbench StatusBar Contribution [message #499922 is a reply to message #499860] Tue, 24 November 2009 14:28 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The pattern for status is that the currently active part provides status. But if you want an executing task to show progress, you should look at the org.eclipse.core.runtime.jobs.Job API

For RCP apps that want to provide custom status (they don't want status per active part) they can contribute their own status control (and disable the default one).

PW


Re: Re: Accessing Workbench StatusBar Contribution [message #500014 is a reply to message #499922] Tue, 24 November 2009 17:18 Go to previous message
Wim Jongman is currently offline Wim Jongman
Messages: 280
Registered: July 2009
Senior Member

Ah, I see. And for the user control to be in the status line you can use a
control contribution for the toolbar:org.eclipse.ui.trim.status toolbar.

--

Best Regards,
Wim Jongman

Posted with Salvo, the Eclipse Newsreader - Which now has these lovely
signatures
http://twitter.com/wimjongman - http://www.remainsoftware.com -
http://www.industrial-tsi.com

ASCII stupid question, get a stupid ANSI!
(Eclipse Old Skool Quote Service)
> The pattern for status is that the currently active part provides status.
But if you want an executing task to show progress, you should look at the
org.eclipse.core.runtime.jobs.Job API
>
> For RCP apps that want to provide custom status (they don't want status per
active part) they can contribute their own status control (and disable the
default one).
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
Previous Topic:Nice XML editor for RCP?
Next Topic:Applying Filter to View - Timing question
Goto Forum:
  


Current Time: Thu Oct 23 17:59:17 GMT 2014

Powered by FUDForum. Page generated in 0.03432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software