Class ToggleAgiContextAction

java.lang.Object
com.intellij.openapi.actionSystem.AnAction
com.intellij.openapi.actionSystem.ToggleAction
uno.anahata.asi.intellij.tools.ide.actions.ToggleAgiContextAction
All Implemented Interfaces:
com.intellij.openapi.actionSystem.ActionUpdateThreadAware, com.intellij.openapi.actionSystem.Toggleable, com.intellij.openapi.project.PossiblyDumbAware

public class ToggleAgiContextAction extends com.intellij.openapi.actionSystem.ToggleAction
A single session's toggle within the "AGI Context" popup: checked when the selected files are all in that session's context, and adds/removes them on toggle.
Author:
anahata
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.intellij.openapi.actionSystem.ActionUpdateThreadAware

    com.intellij.openapi.actionSystem.ActionUpdateThreadAware.Recursive
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Agi
    The session this toggle targets.

    Fields inherited from class com.intellij.openapi.actionSystem.AnAction

    ACTIONS_KEY, ACTIONS_MOD_COUNT, EMPTY_ARRAY

    Fields inherited from interface com.intellij.openapi.actionSystem.Toggleable

    SELECTED_KEY, SELECTED_PROPERTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a toggle for the given session, labelled with its display name.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull com.intellij.openapi.actionSystem.ActionUpdateThread
    boolean
    isSelected(@NotNull com.intellij.openapi.actionSystem.AnActionEvent e)
    void
    setSelected(@NotNull com.intellij.openapi.actionSystem.AnActionEvent e, boolean state)

    Methods inherited from class com.intellij.openapi.actionSystem.ToggleAction

    actionPerformed, createTemplatePresentation, update

    Methods inherited from class com.intellij.openapi.actionSystem.AnAction

    addSynonym, addTextOverride, addTextOverride, applyTextOverride, applyTextOverride, beforeActionPerformedUpdate, copyActionTextOverride, copyActionTextOverrides, copyFrom, copyShortcutFrom, displayTextInToolbar, getEventProject, getShortcutSet, getSynonyms, getTemplatePresentation, getTemplateText, isDefaultIcon, isDumbAware, isEnabledInModalContext, isInInjectedContext, registerCustomShortcutSet, registerCustomShortcutSet, registerCustomShortcutSet, registerCustomShortcutSet, setDefaultIcon, setEnabledInModalContext, setInjectedContext, setShortcutSet, toString, unregisterCustomShortcutSet, useSmallerFontForTextInToolbar

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • agi

      private final transient Agi agi
      The session this toggle targets.
  • Constructor Details

    • ToggleAgiContextAction

      public ToggleAgiContextAction(Agi agi)
      Constructs a toggle for the given session, labelled with its display name.
      Parameters:
      agi - the target session.
  • Method Details

    • isSelected

      public boolean isSelected(@NotNull @NotNull com.intellij.openapi.actionSystem.AnActionEvent e)

      Selected when the current file selection is fully in this session's context.

      Specified by:
      isSelected in class com.intellij.openapi.actionSystem.ToggleAction
    • setSelected

      public void setSelected(@NotNull @NotNull com.intellij.openapi.actionSystem.AnActionEvent e, boolean state)

      Adds the selection to the session's context when enabling, removes it when disabling.

      Specified by:
      setSelected in class com.intellij.openapi.actionSystem.ToggleAction
    • getActionUpdateThread

      @NotNull public @NotNull com.intellij.openapi.actionSystem.ActionUpdateThread getActionUpdateThread()

      Membership is a lightweight resource-manager lookup, safe to compute off the EDT.

      Specified by:
      getActionUpdateThread in interface com.intellij.openapi.actionSystem.ActionUpdateThreadAware
      Overrides:
      getActionUpdateThread in class com.intellij.openapi.actionSystem.AnAction