Home » Eclipse Projects » Remote Application Platform (RAP) » StatusLineManager
|
Re: StatusLineManager [message #536779 is a reply to message #536491] |
Sun, 30 May 2010 21:26 |
|
Hi Edin,
you should not put the UIThread to sleep as this will interrupt the
request processing. Instead you could use Display#timerExec() to trigger
a delayed UI operation. Please not that you'd need a UICallback to flush
the UI update.
Hope that helps,
Ralf
ededagic wrote:
> Hello,
>
> with view.getViewSite().getActionBars().getStatusLineManager().se
> tErrorMessage( "Some Error"); i can tell the Status Line to show some
> error. Is possible to tell the LineManager to remove this message i.e
> after 3 seconds. Or any idea how to workaround it? i tried to put Thread
> into sleep, and then write:
> view.getViewSite().getActionBars().getStatusLineManager().se
> tErrorMessage( "");
> but the result is that at the end i only see the last setErrorMessage
> with empty string. the first one will not be shown.
> best Regards, Edin
|
|
|
Re: StatusLineManager [message #538668 is a reply to message #536779] |
Tue, 08 June 2010 11:34 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
Yes it helped, but only partially.
The message that should disappear after 3 seconds is still visible, till the user clicks with the mouse somewhere in the app. Seems that the app knows, it has to remove to message but the screen, or display or shell or sth else is not refreshed after that time. the mouse click actualises it somehow if i click on the screen before 3 seconds passed, the message is still there, and if i click on it after 3 sec, the message disappears. any idea why, or how to make it disaper after 3 sec, without clicking with mouse ?
Thx, Edin
|
|
|
Re: StatusLineManager [message #538700 is a reply to message #538668] |
Tue, 08 June 2010 12:55 |
|
Hi Edin,
there is no automatic "server push", therefore the change is visible not
before the next user interaction that triggers an Ajax request.
To solve this, you have to enable a UICallBack before calling timerExec
and disable it when the message has been written.
Hope this helps, Ralf
ededagic wrote:
> Yes it helped, but only partially.
>
> The message that should disappear after 3 seconds is still visible, till
> the user clicks with the mouse somewhere in the app. Seems that the app
> knows, it has to remove to message but the screen, or display or shell
> or sth else is not refreshed after that time. the mouse click actualises
> it somehow if i click on the screen before 3 seconds passed, the message
> is still there, and if i click on it after 3 sec, the message
> disappears. any idea why, or how to make it disaper after 3 sec, without
> clicking with mouse ?
> Thx, Edin
|
|
| |
Re: StatusLineManager [message #544042 is a reply to message #539517] |
Thu, 01 July 2010 12:51 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
HI, i have another question that is similar to the previous but only more complex. lets imagine the following scenario:
i have a rap application with 10 users simultaneosly using it. one of them is admin. he need the function to send the message to the other users. therefore whenever a user logs into the application, im saving the reference to his swt.Display instance to be able to use MessageDialog methods. for the admin, there is a view that shows the checkbox table with logged in users. checking one or more of them selects them to receive the admin message. therefore im looping the list of the Display instances of the users and call a MessageDialog method on it. sofar its working with one restriction:
When im sending the message to a user, and he is doing nothing, just looking on the screen, nothing happens. The message will not popup until he clikcs somewhere in the application, somehow acitvating it. I think it has again something to do with the UICallback. BUt this time it should be called on the users side, when admin (another user) send him the message. but im not able to manage that. i tried the following but it doesnt work:
UICallBack.activate("Message");
Thread messageThread = new Thread(new Runnable() {
public void run() {
final Display display = userMap.get(userId);
display.asyncExec(new Runnable() {
public void run() {
MessageDialog.openWarning(
display.getActiveShell(),
"Nachricht vom Administrator",
message); UICallBack.deactivate("" + userId);
}
});
});
but in that way it only works as described abowe (with click of the user). Im thankful for any sort of tip.
Best regards, Edin
|
|
|
Re: StatusLineManager [message #544273 is a reply to message #544042] |
Fri, 02 July 2010 08:21 |
|
Hi,
there is no way of notifying the client except in the response to a
client request. Therefore, the activation of a UICallback have do be
done within a request to take effect. Activating a UICallback from a
background thread (or from the UIThread of another session) can't work.
In your case, you could either activate a UICallback for every user at
application startup or you could implement a polling mechanism that
allows clients to check for admin messages every n minutes.
Regards, Ralf
ededagic wrote:
> HI, i have another question that is similar to the previous but only
> more complex. lets imagine the following scenario:
>
> i have a rap application with 10 users simultaneosly using it. one of
> them is admin. he need the function to send the message to the other
> users. therefore whenever a user logs into the application, im saving
> the reference to his swt.Display instance to be able to use
> MessageDialog methods. for the admin, there is a view that shows the
> checkbox table with logged in users. checking one or more of them
> selects them to receive the admin message. therefore im looping the list
> of the Display instances of the users and call a MessageDialog method
> on it. sofar its working with one restriction: When im sending the
> message to a user, and he is doing nothing, just looking on the screen,
> nothing happens. The message will not popup until he clikcs somewhere in
> the application, somehow acitvating it. I think it has again something
> to do with the UICallback. BUt this time it should be called on the
> users side, when admin (another user) send him the message. but im not
> able to manage that. i tried the following but it doesnt work:
>
> UICallBack.activate("Message");
> Thread messageThread = new Thread(new Runnable() {
> public void run() {
> final Display display = userMap.get(userId);
> display.asyncExec(new Runnable() {
> public void run() {
> MessageDialog.openWarning(
> display.getActiveShell(),
> "Nachricht vom Administrator",
> message);
> UICallBack.deactivate("" + userId);
> }
> });
> });
>
> but in that way it only works as described abowe (with click of the
> user). Im thankful for any sort of tip.
>
> Best regards, Edin
|
|
|
Goto Forum:
Current Time: Fri Nov 08 22:22:08 GMT 2024
Powered by FUDForum. Page generated in 0.04230 seconds
|