For computing the distribution of the sample mean the method described above can be used with any sampling design, that is, it is the same for the case without replacement and for the case with replacement. Indeed, considering some statistic depending on the sample $T(S)$ its sampling distribution is:
$$P(T(S)=k)=\sum_{S \ s.t. \ T(S)=k} P(S), \text{ for any } k \text{ in the image of }T.$$
In the book, $T$ is the sample mean, that is, $T(S)=\dfrac{\sum_{i\in S} X_i}{n}.$ Note that the last expression is valid for both with replacement and without replacement schemes. Indeed, for every sampling design.
However, IN SAMPLING THEORY (which is our case), if the author does not specify otherwise, the default sampling design usually is without replacement because is more accurate (it has less mean squared error (MSE) ) than the one with replacement (IN PROBABILITY AND INFERENCE THE DEFAULT SAMPLING DESIGN IS WITH REPLACEMENT).
Note that here we are computing the sampling distribution of some estimator $T(S)$ among the samples $S$ and the random element in this problem is not the value of the variable $X$ on each element of the population $X_i$ but which sample is drawn. So we deal with the probabilities $P(S)$ for each sample. In sampling theory most of times the values $X_i$ are considered deterministic and the actual random variable is the variable $e_i:$
$$e_i= \left\{ \begin{array}{lcc}
1 & if & i \in S \\
\\ 0 & if & i \notin S
\end{array}
\right.$$
Do not confuse sampling theory with classical probability or statistical inference in which you normally have random variables $X_1,\ldots, X_n $ which are chosen indepently (and therefore with replacement).