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/preferences/NameConventionConfigurationBlock.java
fUseKeywordThisBox.setSelection(getBooleanValue(PREF_KEYWORD_THIS));
		fUseIsForBooleanGettersBox.setSelection(getBooleanValue(PREF_IS_FOR_GETTERS));
	}	
		
	/* (non-Javadoc)
	 * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#getFullBuildDialogStrings(boolean)
	 */
	protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
		return null; 
	}
	
	private void createEntry(List list, Key prefixKey, Key suffixKey, int kind) {
		NameConventionEntry entry= new NameConventionEntry();
		entry.kind= kind;
		entry.suffixkey= suffixKey;
		entry.prefixkey= prefixKey;	
		entry.suffix= getPreferenceValue(suffixKey);
		entry.prefix= getPreferenceValue(prefixKey);
		list.add(entry);
	}
	
	private String getPreferenceValue(Key key) {
		String value= getValue(key);
		if (value == null) {
			value= ""; 
			JavaPlugin.logErrorMessage("JavaCore preference is null. Key:" + key); 
		}
		return value;
	}