Package io.jmix.aichat.action
Class AiMessageCopyAction
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.aichat.action.AiMessageAction<AiMessageCopyAction>
io.jmix.aichat.action.AiMessageCopyAction
- All Implemented Interfaces:
Action,HasShortcutCombination
@ActionType("aichat_messageCopy")
public class AiMessageCopyAction
extends AiMessageAction<AiMessageCopyAction>
Built-in, client-side copy action. Copies the message's text to the clipboard entirely on
the client (inside the user gesture, no server round-trip), then briefly flips its icon to a
check mark to confirm. The list recognizes this type and tags it with the
"copy"
client handler; AiMessageAction.execute(io.jmix.aichat.action.AiMessageActionPerformedEvent) is never called.
Its icon is supplied through CSS — the jmix-ai-message-action-copy class plus the
--jmix-ai-message-icon-copy / --jmix-ai-message-icon-check masks — so the
action carries no icon component. Its description is localized from the message bundle, but
it is only a fallback for a reader of the action itself: when AiMessageList serializes
the action it prefers the copy label of its own i18n object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe class name the client keys the copy behavior off, applied to the rendered button.static final StringThe action type id, for<action type="aichat_messageCopy"/>in a descriptor.Fields inherited from class io.jmix.aichat.action.AiMessageAction
classNamesFields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visibleFields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates the action with the default idID.Creates the action with the given id. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHook for subclasses to set defaults (icon, description, class names).protected voidsetMessages(Messages messages) Methods inherited from class io.jmix.aichat.action.AiMessageAction
actionPerform, actionPerform, addActionPerformedListener, addClassNames, execute, getClassNames, refreshState, self, setEnabled, setShortcutCombination, setText, setVariant, setVisible, unsupported, withClassNames, withDescription, withHandler, withIconMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getIconComponent, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setIconComponent
-
Field Details
-
ID
The action type id, for<action type="aichat_messageCopy"/>in a descriptor.- See Also:
-
COPY_CLASS_NAME
The class name the client keys the copy behavior off, applied to the rendered button.- See Also:
-
-
Constructor Details
-
AiMessageCopyAction
public AiMessageCopyAction()Creates the action with the default idID. -
AiMessageCopyAction
Creates the action with the given id.- Parameters:
id- the action id
-
-
Method Details
-
initAction
protected void initAction()Description copied from class:AiMessageActionHook for subclasses to set defaults (icon, description, class names). Empty by default.Called from the constructor, so it runs before the subclass's own field initializers: set state through the inherited setters, not through subclass fields.
- Overrides:
initActionin classAiMessageAction<AiMessageCopyAction>
-
setMessages
-