Bug 100989 - [quick fix] Add field quick fix doesn't recognize static methods
Summary: [quick fix] Add field quick fix doesn't recognize static methods
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 19:46 EDT by Randy Hudson CLA
Modified: 2009-01-23 11:33 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 Randy Hudson CLA 2005-06-20 19:46:35 EDT
When invoking add field quick fix inside a static method such as main(Sting[]),
the field added must be static.

Use quick fix to define the field "lastMouseMove" in the encapsulating class.

public static void main(String[] args) {
	Display display = new Display();
	final Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.RIGHT_TO_LEFT);
	shell.setText("Shell");
	
	shell.addMouseMoveListener(new MouseMoveListener() {
		public void mouseMove(MouseEvent e) {
			lastMouseMove = new Point(e.x,e.y);
		}
	});