Bug 3337

Summary: Open on selection failed with double message (1GIFA80)
Product: [Eclipse Project] JDT Reporter: Nick Edgar <n.a.edgar>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M1   
Hardware: All   
OS: Windows 2000   
Whiteboard:

Description Nick Edgar CLA 2001-10-10 22:53:27 EDT
In EditorActionDelegate.run(), in the readme example, F3 fails on getShell (and therfore on openInformation too):
It can resolve getSite() to IWorkbenchPart.getSite() which returns IWorkbenchPartSite.
IWorkbenchPartSite has getShell().

The code is:

import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.*;

public class EditorActionDelegate implements IEditorActionDelegate {
	private IEditorPart editor;

/* (non-Javadoc)
 * Method declared on IActionDelegate
 */
public void run(IAction action) {
	MessageDialog.openInformation(editor.getSite().getShell(),
		MessageUtil.getString("EditorActionDelegate.Title"),  //$NON-NLS-1$
		MessageUtil.getString("EditorActionDelegate.Message")); //$NON-NLS-1$
}

// snip
}

NOTES:
Comment 1 Philipe Mulet CLA 2001-10-16 07:18:17 EDT
Cannot reproduce anymore in 204. Can resolve #getShell() fine.
Closing
Comment 2 DJ Houghton CLA 2001-10-29 17:10:38 EST
PRODUCT VERSION:
129