Class BasicContextProvider
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.context.BasicContextProvider
- All Implemented Interfaces:
ContextProvider, PropertyChangeSource, Rebindable
- Direct Known Subclasses:
AbstractProjectContextProvider, AbstractProjectContextProvider, AgiCompiledClass, OpenToolWindowsContextProvider, OpenTopComponentsContextProvider, OutputTabsContextProvider, ProjectFilesContextProvider, TerminalTab
A basic, reusable implementation of the
ContextProvider interface
that provides the foundational logic for hierarchical context management.
It extends BasicPropertyChangeSource to support reactive UI bindings,
ensuring that changes to the provider's state are immediately reflected in
the context tree and details panels.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<ContextProvider> The list of immediate child providers.private final StringA detailed description of this provider's purpose.private final StringThe unique identifier for this provider.private final StringThe human-readable name of this provider.protected ContextProviderThe parent provider in the hierarchy.private booleanWhether this provider is currently active.Fields inherited from class BasicPropertyChangeSource
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAgi()Gets the parent AGI session this context provider is registered under.Gets the list of immediate child context providers.Gets the parent context provider in the hierarchy, if any.voidsetParentProvider(ContextProvider parent) Sets the parent context provider for this instance.Methods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextProvider
getContextPosition, getDescription, getFlattenedHierarchy, getFullyQualifiedId, getHeader, getIconId, getId, getInstructionsTokenCount, getName, getRagTokenCount, getSystemInstructions, isEffectivelyProviding, isProviding, populateMessage, setProvidingMethods inherited from interface PropertyChangeSource
getPropertyChangeSupport
-
Field Details
-
id
The unique identifier for this provider. -
name
The human-readable name of this provider. -
description
A detailed description of this provider's purpose. -
providing
private boolean providingWhether this provider is currently active. Defaults to true. -
parent
The parent provider in the hierarchy. -
children
The list of immediate child providers.
-
-
Constructor Details
-
BasicContextProvider
public BasicContextProvider()
-
-
Method Details
-
getChildrenProviders
Gets the list of immediate child context providers.- Specified by:
getChildrenProvidersin interfaceContextProvider- Returns:
- The list of children, or an empty list if none.
-
getParentProvider
Gets the parent context provider in the hierarchy, if any.- Specified by:
getParentProviderin interfaceContextProvider- Returns:
- The parent provider, or null if this is a root provider.
-
setParentProvider
Sets the parent context provider for this instance.- Specified by:
setParentProviderin interfaceContextProvider- Parameters:
parent- The parent provider.
-
getAgi
Gets the parent AGI session this context provider is registered under.Resolves the parent AGI session by delegating up the context provider hierarchy.
- Specified by:
getAgiin interfaceContextProvider- Returns:
- The active parent AGI session, or null if it cannot be resolved.
-

