@SuppressWarnings("unchecked")
	public <AC2 extends ActionContext, B2 extends AbstractActionBuilder<T, AC2, B2>> B2 withContext(
			Class<AC2> newActionContextClass, boolean useDefaultContext) {

		if (actionContextClass != ActionContext.class) {
			throw new IllegalStateException("Can't set the ActionContext type more than once");
		}
		this.supportsDefaultContext = useDefaultContext;

		// automatic enablement management triggered, make sure there is a existing enablement 
		// predicate. The default behavior of manual management interferes with automatic management.
		if (enabledPredicate == null) {
			enabledPredicate = ALWAYS_TRUE;
		}

		// To make this work, we need to return a builder whose ActionContext is AC2 and not AC
		//    (which is what this builder is now)
		//
		// Since we "know" that the only thing that matters regarding the ActionContext type is that
		// the template type (AC) must match the type of actionContextClass instance variable, we
		// can get away with returning this same builder and casting it to be a builder with type 
		// AC2 instead of AC.  We can do this since we set the actionContextClass below

		actionContextClass = newActionContextClass;

		B2 newSelf = (B2) self();
		return newSelf;
	}
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