protected void validate() {
		if (actionCallback == null) {
			throw new IllegalStateException(
				"Can't build a DockingAction without an action callback");
		}
		if (windowWhen == When.CONTEXT_MATCHES && actionContextClass == null) {
			throw new IllegalStateException("The InWindow state was set to " +
				"\"CONTEXT_MATCHES\", but no context class was set. Use" +
				" the \"withContext\" method");
		}
	}
Sets the action context for this action and whether or not this action supports default
context as explained in {@link ActionContext}. If this context is set, then this 
action is only valid when the current context is that type or extends that type.
<P>
After this method has been called, any the following methods will use this new context type 
in the method signature: ({@link #validContextWhen(Predicate)}, 
{@link #enabledWhen(Predicate)}, and 
{@link #popupWhen(Predicate)}).
<P>
For example, assume you have an action that is only enabled when the context is of type
FooContext.  If you don't call this method to set the action context type,  you would
have to write your predicate something like this:
<pre>
{@literal builder.enabledWhen(context -> }{
    if (!(context instanceof FooContext)) {
        return false;
    }
    return ((FooContext) context).isAwesome();
});
</pre>
But by first calling the builder method <CODE>withContext(FooContext.class)</CODE>, then the
context will be the new type and you can simply write:

<pre>
{@literal builder.enabledWhen(context -> context.isAwesome()) }
</pre>

<p>Note: this triggers automatic action enablement based on context for the action, so you 
should not later manually manage action enablement using the action's 
{@link DockingAction#setEnabled(boolean)} method.
<P>
For more details on how the action context system works, see {@link ActionContext}.

@param newActionContextClass the more specific ActionContext type.
@param <AC2> The new ActionContext type (as determined by the newActionContextClass) that
the returned builder will have.
@param <B2> the new builder type.
@param useDefaultContext if true, then this action also supports operating on a default
context other than the active (focused) provider's context
@return an ActionBuilder whose generic types have been modified to match the new ActionContext.
It still contains all the configuration that has been applied so far
Ghidra/Framework/Docking/src/main/java/docking/action/builder/AbstractActionBuilder.java