Bug 112440 Generate Delegate Methods does not work in anonymous types
Build ID: I20051011-1655 When selecting "Generate Delegate Methods" for an anonymous type, the refactoring does not use the fields of the anonymous type, but of the enclosing type as a reference (1). When inserting methods (from fields of the enclosing type) at the current position, it fails without an error message (2). 1) Select "Foo()", invoke the Refactoring => No generation possible 2) Add a field to top-level class Foo, select "Foo()" invoke the Refactoring, select some method and "insert at current position" => Generation possible, but methods do not get inserted. ---- public class Foo { public void foo() { Foo d= new Foo() { Foo d; }; } } ----
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddDelegateMethodsAction.java
public AddDelegateMethodsDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, CompilationUnitEditor editor, IType type, boolean isConstructor) throws JavaModelException {
			super(parent, labelProvider, contentProvider, editor, type, isConstructor);
		}
		/*
		 * @see org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog#createLinkControl(org.eclipse.swt.widgets.Composite)
		 */
		protected Control createLinkControl(Composite composite) {
			Link link= new Link(composite, SWT.WRAP);
			link.setText(JavaUIMessages.DelegateMethodDialog_link_message); 
			link.addSelectionListener(new SelectionAdapter() {
				public void widgetSelected(SelectionEvent e) {
					openCodeTempatePage(CodeTemplateContextType.METHODCOMMENT_ID);
				}
			});
			link.setToolTipText(JavaUIMessages.DelegateMethodDialog_link_tooltip); 
			
			GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
			gridData.widthHint= convertWidthInCharsToPixels(40); 
			link.setLayoutData(gridData);
			return link;
		}
	}
	private static class AddDelegateMethodsLabelProvider extends BindingLabelProvider {