Bug 4228 - Widget is disposed error (1GKCZQM)
Summary: Widget is disposed error (1GKCZQM)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Linux
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Randy Giffen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 7576 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 23:08 EDT by Jared Burns CLA
Modified: 2002-01-28 16:07 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2001-10-10 23:08:11 EDT
Browsing files in the Java Hierarchy Perspective with the hierarchy view on
the workbench sidebar. When I switch between editors using the F3 key on types,
I occasionally get an internal error (stack trace below). After the error, I noticed that the outline view
stops updating when I switch beween editors.

Log: Thu Sep 20 11:50:35 EDT 2001
2 org.eclipse.ui 2 Problems occurred when invoking code from plug-in: 
org.eclipse.ui.
org.eclipse.swt.SWTException: Widget is disposed
		 at org.eclipse.swt.SWT.error(SWT.java:1700)
		 at org.eclipse.swt.SWT.error(SWT.java:1741)
		 at org.eclipse.swt.widgets.Widget.error(Widget.java:262)
		 at org.eclipse.swt.widgets.ToolItem.getDisplay(ToolItem.java(Compiled Code))
		 at org.eclipse.swt.widgets.Widget.isValidThread(Widget.java(Compiled Code))
		 at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java(Compiled Code))
		 at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java(Compiled Code))
		 at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.java:504)
		 at org.eclipse.ui.internal.ViewActionBars.updateActionBars(ViewActionBars.java:48)
		 at org.eclipse.ui.part.PageBookView.showPageRec(PageBookView.java:458)
		 at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:344)
		 at org.eclipse.ui.views.contentoutline.ContentOutline.partBroughtToTop(ContentOutline.java:177)
		 at org.eclipse.ui.internal.PartListenerList$2.run(PartListenerList.java:51)
		 at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Compiled Code))
		 at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
		 at org.eclipse.ui.internal.PartListenerList.firePartBroughtToTop(PartListenerList.java:49)
		 at org.eclipse.ui.internal.WorkbenchPage.firePartBroughtToTop(WorkbenchPage.java:553)
		 at org.eclipse.ui.internal.WorkbenchPage.bringToTop(WorkbenchPage.java:154)
		 at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:67)
		 at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:1071)
		 at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:221)
		 at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:207)
		 at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:195)
		 at org.eclipse.jdt.internal.ui.actions.OpenJavaElementAction.open(OpenJavaElementAction.java:52)
		 at org.eclipse.jdt.internal.ui.javaeditor.OpenOnSelectionAction.run(OpenOnSelectionAction.java:103)
		 at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:397)
		 at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:351)
		 at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:342)
		 at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47)
		 at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
		 at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
		 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
		 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
		 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
		 at org.eclipse.ui.internal.Workbench.run(Workbench.java:676)
		 at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:810)
		 at org.eclipse.core.boot.BootLoader.run(BootLoader.java:280)
		 at java.lang.reflect.Method.invoke(Native Method)
		 at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
		 at org.eclipse.core.launcher.Main.run(Main.java:433)
		 at org.eclipse.core.launcher.Main.main(Main.java:306)


NOTES:
EG (9/20/2001 9:38:06 AM)
	CK pls investigate into a reproducable case on Linux or Windows
Comment 1 Claude Knaus CLA 2001-10-11 08:13:10 EDT
How to reproduce (204):

  1) Open a compilation unit in the java editor.
  2) Hit F3 on another type inside the compilation unit.
     If the associated compilation unit is already open in the editor,
     the error occurs, otherwise go back to the first compilation unit
     and hit F3 again on that type.

This problem occurs on Linux, but not on W2K.

It seems that some toolbar items (the first three) of the Outline toolbar get 
disposed too early. The last toolbar item stays 'alive'.

Comment 2 Erich Gamma CLA 2001-10-11 08:26:25 EDT
The JavaOutline page is making its contributions
the official way (see below) and the walkback 
happens deep inside UI code. Suspect that there is a problem in the toolbar 
management code. Moving to Platform UI

	public void makeContributions(IMenuManager menuManager, IToolBarManager 
toolBarManager, IStatusLineManager statusLineManager) {
		...
		Action action= new LexicalSortingAction();
		toolBarManager.add(action);		
                ...
Comment 3 Jared Burns CLA 2001-12-12 17:15:59 EST
This still occurs on the 20011211 build.
Comment 4 Randy Giffen CLA 2002-01-07 11:57:05 EST
I cannot repeat in the 20011219 integration build (I was able to repeat in an 
earlier build). Could you verify that it is no longer occuring?

Also, just so I understand better what was happening, Claude could you 
elaborate what you ment by "It seems that some toolbar items (the first three) 
of the Outline toolbar get disposed too early." 
Was this occuring in ToolBarManager.update(boolean) ? 
Comment 5 Jared Burns CLA 2002-01-17 11:58:42 EST
*** Bug 7576 has been marked as a duplicate of this bug. ***
Comment 6 Randy Giffen CLA 2002-01-28 16:07:09 EST
The problem was due to a callback we receive on motif that we do not get on 
Windows. The callback occurs when a toolitem is disposed. On motif we get an 
activation callback on the editor's control. This triggers a part activated 
notification and we reenter the toolbar update code.

Added a check in PageBookView to do nothing if it is asked to show the page rec 
which it is already showing.