Bug 17598 Source->Generate Getter and Setter enabled for read only file
F1 This action is enabled for read-only files. Executing it shows a dialog saying that the file is read-only. The action should be disabled since all other source actions are disabled as well.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
dialog.setContainerMode(true);
		dialog.setSize(60, 18);
		dialog.setInput(type);
		dialog.setExpandedElements(type.getFields());
		dialog.setInitialSelections(preselected);
		dialog.open();
		Object[] result= dialog.getResult();
		if (result == null)
			return;
		IField[] getterFields= getGetterFields(result);
		IField[] setterFields= getSetterFields(result);
		generate(getterFields, setterFields);
	}
	private static ISelectionStatusValidator createValidator() {
		return new ISelectionStatusValidator(){
			public IStatus validate(Object[] selection) {
				int count= countSelectedMethods(selection);
				if (count == 0)
					return new StatusInfo(IStatus.ERROR, ""); 
				if (count == 1)	
					return new StatusInfo(IStatus.INFO, ActionMessages.getString("AddGetterSetterAction.one_selected")); 
					
				String message= ActionMessages.getFormattedString("AddGetterSetterAction.methods_selected", String.valueOf(count));
				return new StatusInfo(IStatus.INFO, message);
			}
		};
	}
	
	private static int countSelectedMethods(Object[] selection){
		int count= 0;