Download data/copilotj/plugin/awt/component/choice_node.py from introvoyz045/CopilotJ: direct link, hf CLI and curl.
- Browser
- Download file 688 Bytes
-
https://huggingface.co/datasets/introvoyz045/CopilotJ/resolve/main/data/copilotj/plugin/awt/component/choice_node.py
- Command line
-
hf download hf://datasets/introvoyz045/CopilotJ/data/copilotj/plugin/awt/component/choice_node.py
-
curl -L -o choice_node.py https://huggingface.co/datasets/introvoyz045/CopilotJ/resolve/main/data/copilotj/plugin/awt/component/choice_node.py
688 Bytes
| # SPDX-FileCopyrightText: Copyright contributors to the CopilotJ project. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| from typing import Literal | |
| from copilotj.plugin.awt._base import ActionResponse, ComponentBase, str_or_empty | |
| __all__ = ["ChoiceNode", "ChoiceSelectItemResponse"] | |
| class ChoiceNode(ComponentBase[Literal["java.awt.Choice"]]): | |
| items: list[str] | |
| selected_item: str | |
| def _describe_one_line(self) -> str: | |
| items_str = ", ".join([str_or_empty(item) for item in self.items]) | |
| return f"Choice: selected={str_or_empty(self.selected_item)}, items=[{items_str}]" | |
| type ChoiceSelectItemResponse = ActionResponse[Literal["java.awt.Choice.selectItem"], None] | |