Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 155299

Summary: [Markers] [RCP] Problems View should be independant of IDE application
Product: [Eclipse Project] Platform Reporter: zhiwei Zhang <zzwyxh>
Component: IDEAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: bokowski, wmitsuda
Version: 3.2Keywords: helpwanted
Target Milestone: 3.3 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 167893    
Bug Blocks:    

Description zhiwei Zhang CLA 2006-08-25 19:08:34 EDT
I put Problem Markers in my editor, and when I try to show the "Problem 
View", an error dialog will pop up showing
"An error has occured. See error log for more details."

In the problem view, I can see the error message, but the node category 
"error" has not text or icon.
the problem entry does have an icon (red square rather than a red circle with white cross in Eclipse 3.1). there is no problem when I ran my RCP under Eclipse 3.1. 

I traced to the exception and it seems the image descriptor for the category (IMG_ETOOL_PROBLEM_CATEGORY) is NULL. 

I also found a similar report from EclipsePluginCentral (for 3.2rc7)
http://www.eclipseplugincentral.com/PNphpBB2-printview-t-3542-start-0.html


below is the exception stacktrace of

!ENTRY org.eclipse.jface 4 2 2006-07-27 15:26:03.859
!MESSAGE Problems occurred when invoking code from plug-in: 
"org.eclipse.jface".
!STACK 0
org.eclipse.jface.util.Assert$AssertionFailedException: null argument;
at org.eclipse.jface.util.Assert.isNotNull(Assert.java:150)
at org.eclipse.jface.util.Assert.isNotNull(Assert.java:126)
at 
org.eclipse.jface.resource.ResourceManager.createImage(ResourceManager.java:93)
at 
org.eclipse.ui.views.markers.internal.FieldSeverityAndMessage.getImage(FieldSeverityAndMessage.java:65)
at 
org.eclipse.ui.views.markers.internal.TableViewLabelProvider.getColumnImage(TableViewLabelProvider.java:49)
at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:310)
at 
org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:95)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:840)
at 
org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:465)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at 
org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1955)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:744)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:2427)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(AbstractTreeViewer.java:1640)
at 
org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:955)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1616)
at 
org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1571)
at 
org.eclipse.jface.viewers.StructuredViewer$8.run(StructuredViewer.java:1415)
at 
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1323)
at 
org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1413)
at 
org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1370)
at 
org.eclipse.ui.views.markers.internal.MarkerView$UpdateJob.runInUIThread(MarkerView.java:222)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at 
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at 
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.rcp.Application.run(Application.java:1
at 
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:7
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:6
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Tod Creasey CLA 2006-08-28 08:05:37 EDT
The problems view is in the IDE. I assume you are using a different application then the one defined in the IDE? The IDE was not designed to be used with a different application.

Having said that it is a popular enough view that we should move it's icon loaded out of the IDE startup.

If I am correct about you using a different application let me know and I'll update the report.
Comment 2 zhiwei Zhang CLA 2006-08-28 10:38:58 EDT
Sorry, I wasn't so clear. Yes, I am using it in my RCP. 
Is there a workaround? 

Thanks again. 
Comment 3 Tod Creasey CLA 2006-08-28 10:54:36 EDT
Currently there is not.
Comment 4 tarek CLA 2006-11-29 12:59:53 EST
(In reply to comment #3)
> Currently there is not.
> 

Would the following be an acceptable workaround? Roll your own images for the problems view (or copy them from the eclipse source), create ImageDescriptors for them and then in your RCP application's WorkbenchAdvisor call

getWorkbenchConfigurer().declareImage("IMG_ETOOL_PROBLEM_CATEGORY",
  problemCategoryImageDescriptor, true);
getWorkbenchConfigurer().declareImage("IMG_OBJS_ERROR_PATH",
  errorImageDescriptor, true);
getWorkbenchConfigurer().declareImage("IMG_OBJS_WARNING_PATH",
 warningImageDescriptor, true);
getWorkbenchConfigurer().declareImage("IMG_OBJS_INFO_PATH",
 infoImageDescriptor, true);

This works. And, of course, it will break, if the problems view changes it's use of images or their symbolic names.

greetings,
tarek
Comment 5 Tod Creasey CLA 2006-11-29 14:05:17 EST
Yes and yes - just copy the problems view part of the application code into your application.

If you provide me a patch I can look at doing something better in the IDE. We should really just define these in the startup method of the plug-in.
Comment 6 Tod Creasey CLA 2007-01-09 16:44:01 EST
Fixed as a result of fixes to Bug 167893. Note there were no code changes in the problems view code just some refactoring of the application plug-in.
Comment 7 Tod Creasey CLA 2007-02-06 10:55:31 EST
Verified in 20060206-0100