The Gradient Generator creates a parametric gradient between two control points.
Drag the filter handles to specify the two control points.
Use the color boxes in the layer property window to choose the gradient colors.
Press the swap button next to the color boxes to reverse the gradient.
The Gradient Generator produces the same gradients as the Gradient Tool. The difference is that the Gradient Tool works on Image Layers, whereas the Gradient Generator is a fully parametric object, a Generator Layer, which can be changed at any time.