Home » Eclipse Projects » Rich Client Platform (RCP) » How to automatically refresh a view without any action by the user
| | |
Re: How to automatically refresh a view without any action by the user [message #463691 is a reply to message #463682] |
Wed, 14 February 2007 11:03   |
Eclipse User |
|
|
|
Concerning the problem, which view should be refreshed, Paul Webster wrote:
"In IWorkbenchPage there are methods like isPartVisible(*) and
getViewStack(*).
Later,
PW "
HTH,
Stefan
Bill Blalock schrieb:
> Cem Dayanik wrote:
>
>> have you tried using TableViewer#refresh() method?
>
>> you need use Display#syncExec/asyncExec to update UI.
>
>
> Is this what you mean?
> Activator.getDefault().getWorkbench().getDisplay().syncExec(
> new Runnable() {
> public void run(){
> FtpClientView.plugin.viewer.refresh();
> }
> });
>
> where "plugin" is a public static variable of FtpClient and "viewer" is
> a public instance of the TableViewer?
>
> =====================================================
>
> If there are multiple views in the RCP how can the program which does
> this tell which view is on top and needs to be refreshed? Or refresh both?
>
> My program has two view, FtpClientView and FtpServerView. Ususally one
> is on top of the other.
>
> Thanks
> Bill Blalock
>
>
>> "Bill Blalock" <Bill.Blalock@certegy.com> wrote in message
>> news:710cca59b04848e0ab3426015db449d0$1@www.eclipse.org...
>>> I have been working on a RCP with a Table viewer based on the wizard
>>> in the view extension.
>>>
>>> This view shows information from an FTP log. The table shows objects
>>> in a TreeMap class which is updated every few minutes. Table entries
>>> in which the file is late or has a problem have an image to indicate
>>> the problem.
>>>
>>> When the user "does something" to the view, such as sorting by
>>> column, the IStructuredContentProvider class is called. The class
>>> sees that the underlying TreeMap has been updated and the contents of
>>> the view are refreshed.
>>>
>>> The program which provides the TreeMap is running on the server.
>>> Every few minutes it wakes up, deserialized the TreeMap, updates it,
>>> serializes it and then sets a semiphore or trigger file.
>>>
>>> The IStructuredContentProvider of the RCP program checks the
>>> semiphore or trigger file, if present it deserialized the updated
>>> TreeMap and refreshes.
>>>
>>> That is probably more than you care to know!
>>>
>>> I'd like the view to be self refreshing, so table is update without
>>> having to wait for the user to do something which causes the
>>> IStructuredContentProvider to be called.
>>>
>>> Does anyone have ideas how to do this? Methods to override?
>>> In a general sense a thread could be started which wakes up and
>>> checks the semiphore every few minutes and gives the RCP a kick to
>>> update the display. But what to kick?
>>>
>>> Thanks all
>>> Bill Blalock
>>>
>>>
>
>
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 18 09:50:36 EDT 2025
Powered by FUDForum. Page generated in 0.04948 seconds
|