Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » PlatformUI.getWorkbench().getProgressService()(PlatformUI.getWorkbench().getProgressService() does not show progress while loading)
PlatformUI.getWorkbench().getProgressService() [message #659490] Mon, 14 March 2011 09:27 Go to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
hello,

we're developing single-source RCP/RAP enterprise product. the following code snippet is intended to notify user that long running operation is in progress. this is due to time consuming method called CreatePartControl in the EditorPart. this method is responsible for constructing UI elements in the composite.we're delegating this UI building logic to a DatasetCompositeFactory, which is responsible for rendering the UI elements of the EditorPart. (we're not using static UI's, ie, the UI of the editor's are dynamic and hence customizable by end users).

this is working as expected under RCP, i.e when an Editor is invoked, it pops up the Progress Dialog Monitor and notify the user that long operation is running in the background. however the same code which we utilize in RAP does not notify the user while constructing the UI that the long operation is running in the background. it does not show the Progress Monitor Dialog at all and neither you find error message.

our requirement is to visually notify users, when Editor loading is consuming time, with a progress monitor or something similar.


	@Override
	public void createPartControl(final Composite parent) {
		final FormLayout layout = new FormLayout();
		layout.marginWidth = 0;
		layout.marginHeight = 0;
		parent.setLayout(layout);
		/*
		 * ProgressService will notify the user that the loading of the
		 * workbench element, i.e EditorPart is already in progress using
		 * ProgressMonitorDialog
		 */
		try {
			PlatformUI
					.getWorkbench()
					.getProgressService()
					.runInUI(PlatformUI.getWorkbench().getProgressService(),
							new IRunnableWithProgress() {
								@Override
								public void run(final IProgressMonitor monitor) {
									monitor.beginTask(
											"Opening Editor in progress, please wait..",
											IProgressMonitor.UNKNOWN);
									final long eventOne = System
											.currentTimeMillis();
									DatasetCompositeFactory
											.getInstance()
											.buildComposite(
													parent,
													_userInterfaceRender
															.getCompositePanelModel(),
													_datasetControllerArray);
									final long diff = eventOne
											- System.currentTimeMillis();
									System.out.println("diff - " + diff);
									monitor.done();
								}
							}, null);
		} catch (final InvocationTargetException e) {
			e.printStackTrace();
		} catch (final InterruptedException e) {
			e.printStackTrace();
		}
	}



kindly advise us if this is the correct/preferred approach to implement this feature on RAP, or alternative approach if any exist.

regards,
sudesh
Re: PlatformUI.getWorkbench().getProgressService() [message #659511 is a reply to message #659490] Mon, 14 March 2011 11:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sudesh,
could you try to enable the UICallBack manually. Does it make any
change? Witch version of RAP are you using - 1.4M5 (with workbench 3.7
update) or an old one (based on workbench 3.4)? If your code works in
RCP, but not in RAP it's probably a bug. Please file a bugzilla with a
complete self-running snippet to reproduce it.
Thanks,
Ivan

On 3/14/2011 11:27 AM, Sudesh Bulathsinhala wrote:
> hello,
>
> we're developing single-source RCP/RAP enterprise product. the
> following code snippet is intended to notify user that long running
> operation is in progress. this is due to time consuming method called
> CreatePartControl in the EditorPart. this method is responsible for
> constructing UI elements in the composite.we're delegating this UI
> building logic to a DatasetCompositeFactory, which is responsible for
> rendering the UI elements of the EditorPart. (we're not using static
> UI's, ie, the UI of the editor's are dynamic and hence customizable by
> end users).
>
> this is working as expected under RCP, i.e when an Editor is invoked,
> it pops up the Progress Dialog Monitor and notify the user that long
> operation is running in the background. however the same code which we
> utilize in RAP does not notify the user while constructing the UI that
> the long operation is running in the background. it does not show the
> Progress Monitor Dialog at all and neither you find error message.
>
> our requirement is to visually notify users, when Editor loading is
> consuming time, with a progress monitor or something similar.
>
>
> @Override
> public void createPartControl(final Composite parent) {
> final FormLayout layout = new FormLayout();
> layout.marginWidth = 0;
> layout.marginHeight = 0;
> parent.setLayout(layout);
> /*
> * ProgressService will notify the user that the loading of the
> * workbench element, i.e EditorPart is already in progress using
> * ProgressMonitorDialog
> */
> try {
> PlatformUI
> .getWorkbench()
> .getProgressService()
>
> .runInUI(PlatformUI.getWorkbench().getProgressService(),
> new IRunnableWithProgress() {
> @Override
> public void run(final IProgressMonitor
> monitor) {
> monitor.beginTask(
> "Opening Editor in
> progress, please wait..",
> IProgressMonitor.UNKNOWN);
> final long eventOne = System
> .currentTimeMillis();
> DatasetCompositeFactory
> .getInstance()
> .buildComposite(
> parent,
> _userInterfaceRender
>
> .getCompositePanelModel(),
>
> _datasetControllerArray);
> final long diff = eventOne
> - System.currentTimeMillis();
> System.out.println("diff - " + diff);
> monitor.done();
> }
> }, null);
> } catch (final InvocationTargetException e) {
> e.printStackTrace();
> } catch (final InterruptedException e) {
> e.printStackTrace();
> }
> }
>
>
> kindly advise us if this is the correct/preferred approach to
> implement this feature on RAP, or alternative approach if any exist.
>
> regards,
> sudesh
>
Re: PlatformUI.getWorkbench().getProgressService() [message #659520 is a reply to message #659511] Mon, 14 March 2011 12:18 Go to previous messageGo to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello Ivan,

I tried setting the UICallBack.activate() but still the progress indicator is not getting visible while loading.

Is this the correct approach to implement such behavior while loading the editor ?

Our requirement is to visually notify the user that some background operation is in progress (UI construction is progress), using workbench progress bar mechanism.

Let me know if the approach we've chosen was correct for both RCP and RAP and hence I would report on bugzilla accordingly.

Thanks,
Sudesh Bulathsinhala
Re: PlatformUI.getWorkbench().getProgressService() [message #659527 is a reply to message #659520] Mon, 14 March 2011 12:27 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sudesh,
as I said, if it's working in RCP as expected - this is a valid use case
and should work in RAP too. Please file a bugzilla with a simple
self-running snippet/project to reproduce it. We will take a look on it
as soon as possible.
Thanks,
Ivan

On 3/14/2011 2:18 PM, Sudesh Bulathsinhala wrote:
> Hello Ivan,
>
> I tried setting the UICallBack.activate() but still the progress
> indicator is not getting visible while loading.
>
> Is this the correct approach to implement such behavior while loading
> the editor ?
>
> Our requirement is to visually notify the user that some background
> operation is in progress (UI construction is progress), using
> workbench progress bar mechanism.
>
> Let me know if the approach we've chosen was correct for both RCP and
> RAP and hence I would report on bugzilla accordingly.
>
> Thanks,
> Sudesh Bulathsinhala
>
Re: PlatformUI.getWorkbench().getProgressService() [message #659537 is a reply to message #659527] Mon, 14 March 2011 13:33 Go to previous message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello,

I will do the needful as you suggested.

Regards,
Sudesh Bulathsinhala
Previous Topic:Deployment Tool Problem
Next Topic:[ANN] Revoked: Platform filters in RAP
Goto Forum:
  


Current Time: Thu Mar 28 19:15:06 GMT 2024

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

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

Back to the top