Bug 93564 Preference setting for @Override annotation
20050503 The story for adding the @Override annotation is currently abit confusing. Only the override dialog offers to add the annotation, all other override actions (quick fix, code assist) don't add it. A code style preference setting should be added to be used by all of them and the override wizatd checkbox removed. Requesting PMC approval for new the preference constant /** * A named preference that controls whether to add a override annotation for newly created methods * <p> * Value is of type <code>Boolean</code>. * </p> * @since 3.1 */ PreferenceConstants.CODEGEN_USE_OVERRIDE_ANNOTATION
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java
super(parent, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false);
		RefactoringASTParser parser= new RefactoringASTParser(AST.JLS3);
		fUnit= parser.parse(type.getCompilationUnit(), true);
		ITypeBinding binding= null;
		if (type.isAnonymous()) {
			final IJavaElement element= type.getParent();
			if (element instanceof IField) {
				final IField field= (IField) element;
				final EnumConstantDeclaration declaration= (EnumConstantDeclaration) NodeFinder.perform(fUnit, field.getSourceRange());
				final AnonymousClassDeclaration decl= declaration.getAnonymousClassDeclaration();
				if (decl != null)
					binding= decl.resolveBinding();
			} else {
				final ClassInstanceCreation creation= (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), ClassInstanceCreation.class);
				if (creation != null)
					binding= creation.resolveTypeBinding();
			}
		} else {
			final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), AbstractTypeDeclaration.class);
			if (declaration != null)
				binding= declaration.resolveBinding();
		}
		List toImplement= new ArrayList();
		IMethodBinding[] overridable= null;
		if (binding != null)
			overridable= StubUtility2.getOverridableMethods(fUnit.getAST(), binding, false);
		else
			overridable= new IMethodBinding[] {};
		for (int i= 0; i < overridable.length; i++) {
			if (Modifier.isAbstract(overridable[i].getModifiers())) {