public B validWhen(Predicate<C> predicate) {
		validContextPredicate = Objects.requireNonNull(predicate);

		// 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;
		}

		return self();
	}
Sets a predicate for dynamically determining if this action is valid for the current 
{@link ActionContext}.  See {@link DockingActionIf#isValidContext(ActionContext)}.

<p>Note: most actions will not use this method, but rely instead on 
{@link #enabledWhen(Predicate)}. 

<p>Note: this triggers automatic action enablement so you should not later call 
{@link DockingAction#setEnabled(boolean)} to manually manage action enablement.
 
@param predicate the predicate that will be used to dynamically determine an action's 
validity for a given {@link ActionContext}
@return this builder (for chaining)
Ghidra/Framework/Docking/src/main/java/docking/action/builder/AbstractActionBuilder.java