Bug 3337 - Open on selection failed with double message (1GIFA80)
Summary: Open on selection failed with double message (1GIFA80)
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:53 EDT by Nick Edgar CLA
Modified: 2002-01-11 09:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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