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/text/java/AnonymousTypeCompletionProposal.java
OverrideMethodDialog dialog= new OverrideMethodDialog(JavaPlugin.getActiveWorkbenchShell(), null, dummyType, true);
						dialog.setGenerateComment(false);
						dialog.setGenerateAnnotation(false);
						dialog.setElementPositionEnabled(false);
						if (dialog.open() == Window.OK) {
							annotations= dialog.getGenerateAnnotation();
							Object[] selection= dialog.getResult();
							if (selection != null) {
								ArrayList result= new ArrayList(selection.length);
								for (int index= 0; index < selection.length; index++) {
									if (selection[index] instanceof IMethodBinding)
										result.add(((IBinding) selection[index]).getKey());
								}
								keys= (String[]) result.toArray(new String[result.size()]);
								settings.createComments= dialog.getGenerateComment();
							}
						}
					} else {
						settings.createComments= false;
						List list= new ArrayList();
						for (int index= 0; index < bindings.length; index++) {
							if (Modifier.isAbstract(bindings[index].getModifiers()))
								list.add(bindings[index].getKey());
						}
						keys= (String[]) list.toArray(new String[list.size()]);
					}
					if (keys == null) {
						setReplacementString(""); 
						setReplacementLength(0);
						return false;