Bug 111852 - [Progress] [RCP] Job ErrorNotification enhancement (set custom manager)
Summary: [Progress] [RCP] Job ErrorNotification enhancement (set custom manager)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P5 enhancement with 4 votes (vote)
Target Milestone: 3.3   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 154090
  Show dependency tree
 
Reported: 2005-10-06 17:45 EDT by Alexander Bieber CLA
Modified: 2007-06-27 09:43 EDT (History)
4 users (show)

See Also:


Attachments
Patch: makes setting of custom JobErrorNotification possible (23.89 KB, patch)
2005-10-06 17:47 EDT, Alexander Bieber CLA
no flags Details | Diff
changed IProgressService (6.02 KB, text/x-java)
2006-04-11 03:21 EDT, Alexander Bieber CLA
no flags Details
new IJobErrorNotificationManager (1.48 KB, text/x-java)
2006-04-11 03:23 EDT, Alexander Bieber CLA
no flags Details
new IJobErrorInfo (631 bytes, text/x-java)
2006-04-11 03:27 EDT, Alexander Bieber CLA
no flags Details
changed ProgressManager (40.99 KB, text/x-java)
2006-04-11 03:32 EDT, Alexander Bieber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bieber CLA 2005-10-06 17:45:26 EDT
Hi all,

here is a posting I wrote in newsgroup eclipse.platform.rcp, that describes the
problem I' facing:
"
We added a custom exception handler to a RCP application. It is handling
uncaught EventLoop Exceptions and those thrown within ISaveRunnables. I wondered
if there is a way to intercept exceptions that are thrown within a Job, too?
I've seen that
org.eclipse.ui.internal.progress.ProgressManager holds an instance of
ErrorNotificationManager that is responsible of displaying errors within Jobs to
the user.
For ISafeRunnables it is possible to set the runner by
SafeRunnable.setRunner(ISaveRunnableRunner);
Are there plans to provide such a similar possibility for the ProgressService in
Eclipse. Something like
IProgressService.setErrorNotifcationManager(IJobErrorNotificationManager) would
be great ... 
"

I've created a patch for org.eclipse.ui.workbench that introduces
IJobErrorNotificationListener and IJobErrorInfo used by the implementation of
IProgressService and its companions to display. I also added a method
IProgressService: setJobErrorNotificationManager(IJobErrorNotificationManager
jobErrorNotificationManager); The implementation - ProgressManager - uses the
default implementation if none was set or it was set to null.

I hope this will be taken into consideration

Best regards

Alexander Bieber
Comment 1 Alexander Bieber CLA 2005-10-06 17:47:38 EDT
Created attachment 27983 [details]
Patch: makes setting of custom JobErrorNotification possible
Comment 2 C. Lamont Gilbert CLA 2005-10-07 09:39:44 EDT
I agree.  I like to fashion all windows displayed to the user as an RCP
developer.  Job exceptions are the ones that get away.
Comment 3 Tod Creasey CLA 2006-04-10 16:25:35 EDT
This has several API changes so we will not be able to do anything more for 3.2 as we are well past the API freeze.

This patch is also out of date so I couldn't see what you were after. Could you attach either a new patch or the classes you have edited please?
Comment 4 Alexander Bieber CLA 2006-04-11 03:16:59 EDT
Hi all,

thanks for the update. 
What I intended was to provide the possibility for RCP applications to override the presentation of errors that rise when running Jobs. This lets developers provide a common UI for error reporting for their RCP application.

The patch I posted basically added one funtionallity to IProgressService:

/**
 * Sets the job error notification manager.
 *  
 * @param jobErrorNotificationManager The manager to set or <code>null</code> to reset to the default manager  
 * 
 * @since 3.?
 */
 public void setJobErrorNotificationManager(IJobErrorNotificationManager jobErrorNotificationManager);

this should accept an implementation of IJobErrorNotificationManager containing methods like
showErrorFor(Job job, String title, String msg);
addError(IStatus status, Job job);
the default implementation and setting was the existing (org.eclipse.ui.internal.progress.)ErrorNotificationManager.

I can work on a patch against the current CVS version but this is likely to be outdated too when this bug is processed. I will attach the added/changed classes here for now ...

Best regards
Comment 5 Alexander Bieber CLA 2006-04-11 03:21:44 EDT
Created attachment 38254 [details]
changed IProgressService

changed IProgressService

added:

public void setJobErrorNotificationManager(IJobErrorNotificationManager jobErrorNotificationManager);
Comment 6 Alexander Bieber CLA 2006-04-11 03:23:30 EDT
Created attachment 38255 [details]
new IJobErrorNotificationManager

new IJobErrorNotificationManager is the interface for error notification managers.
Basicly it is extracted from the existing ErrorNotificationManager
Comment 7 Alexander Bieber CLA 2006-04-11 03:27:35 EDT
Created attachment 38256 [details]
new IJobErrorInfo

new IJobErrorInfo abstracts ErrorInfo that is in an internal package and was used by ErrorNotificationManager. IJobErrorNotificationManager should be written against this interface.
Comment 8 Alexander Bieber CLA 2006-04-11 03:32:47 EDT
Created attachment 38257 [details]
changed ProgressManager

changed ProgressManager now holds an instance of IJobErrorNotificationManager and acsesses it via a getter IJobErrorNotificationManager getErrorManager() that will create a default one if not set.
Comment 9 Alexander Bieber CLA 2006-04-11 03:35:42 EDT
This is it. I also changed 

ErrorInfo.java
ErrorNotificationManager.java
FinishedJobs.java
JobErrorDialog.java
NewProgressViewer.java
ProgressAnimationItem.java
WorkbenchSiteProgressService.java

but these changes I think will result when adding the interfaces.

Best regards
Comment 10 Tod Creasey CLA 2006-04-11 07:48:05 EDT
Reopening for consideration post 3.2.
Comment 11 Alexander Bieber CLA 2006-11-06 05:15:07 EST
Any news on this issue?
It is tagged 'helpwanted'. Should I do a new patch for the current cvs version? Can this still be included in 3.3 ?

Regards, Alex
Comment 12 Tod Creasey CLA 2006-11-06 08:03:59 EST
We are revisiting our error reporting in general in 3.3 and the progress error reporting is part of it.

I am adding this as a prerequisite of the plan item to make sure we cover your cases adequately.
Comment 13 Alexander Bieber CLA 2006-11-06 09:15:00 EST
Thanks, Tod. I see there's a lot going on with similar topics.
Please tell me if I can help on this one.

Regards, Alex
Comment 14 Tod Creasey CLA 2007-06-21 15:55:05 EDT
BTW this changed significantly in 3.3. Szymon may have more insight
Comment 15 Szymon Brandys CLA 2007-06-21 16:05:33 EDT
This now can be achieved by using the status handling facility.
The facility is in Eclipse since 3.3.
Comment 16 Tod Creasey CLA 2007-06-27 09:43:56 EDT
Marking verified