set busy cursor

Hi,

I want to do somehing like :

try {
  component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  doProcessing();
} finally {
  component.setCursor(Cursor.getDefaultCursor());
}

in my method.
Is that possible ??
I know the busy plugin exists, but I’d like to do it another way.
This way I do not have to change existing code.

Regards,

You can use this inside a plugin:
http://www.servoy.com/docs/public-api/5 … ocker.html

This (IUIBlocker) should be exposed to us programmers through Servoy (-plugin ?) itself. Basic functionality IMHO.

Regards,

+1

+1

This is the only thing that I am missing now in Servoy comparing it to Oracle Forms.

And that is a BIG compliment !!

Yep, and it looks as if the IUIBlocker should work in both Smartclient and Webclient !

Oh, now I am reading in the IUIBlocker doc :

Block the Graphical User Interface, don’t let any cmds happen, cursor is set to wait cursor.

What would ‘don’t let any cmds happen’ mean ? No processing in code or just no UI commands ?

Hi,

Johan Compagner made an addition tot the Busy plugin
Now You can simply show a busy cursor and a normal cursor (smart client).

function setBusyNormal(event) {
	try 
	{
		plugins.busy.showWaitCursor()
		// Your code
		//
		plugins.busy.showDefaultCursor()
	}
	finally 
	{
		plugins.busy.showDefaultCursor()
	}
}

Thanks Johan !

Hi,

this code

plugins.busy.showWaitCursor()
	try {
		// some code
	} finally {
		plugins.busy.showDefaultCursor()
	}

does not show a busy cursor in my solution (Servoy 6.0.7, win 7, java 1.6.0_33).
If I use the plugins.busy.block(parameters) and plugins.busy.unblock() function the cursor get busy (circle).

Regards,

Please note that these 2 functions are not web enabled. This comes from a patch that Johan pushed at a client request for Smart client only.

Hi Patrick,

I’m using it in the Smart Client!

Regards,

Ah, OK. Sorry. I’ll have a look then.

Just tried on Win 7, Java 1.6.0_33 (32 and 64-bit), Servoy 6.0.7 in Developer AND real Smart Client and this worked fine for me with this code:

	plugins.busy.showWaitCursor();
	try {
		for (var i = 0; i < 10; i++) {
			application.sleep(500);
			application.output(i+1);
		}
	} finally {
		plugins.busy.showDefaultCursor()
	}

So I’m wondering what’s the context of your call. Are you calling it from a method that already blocked the UI? Is it in a dialog?
And what do your “// some code” do in your case?