Class PromptActions
java.lang.Object
io.github.jbastgen.stemma.app.ui.dialog.PromptActions
What can be done with the prompts of the library, shared by the favourites panel of the Cowork view and the dialog that manages all
prompts: new, edit (a form), delete or hide (after a question), favourites, categories. Every change is written to the prompt file at
once and then
changed runs, so both places show the same library.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA change of the prompt file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchange(PromptActions.FileChange change, String done) Runs a change of the prompt file, tells the views and saysdone(already translated) when it is not empty.voidA form to change a prompt.voidA form for a new prompt, prefilled with a title and text; it is a favourite unless the box is cleared.voidremoveCategory(String category) Asks, then removes a category with its prompts: the user's own are deleted, the ready-made ones hidden.voidAsks, then deletes one of the user's own prompts, or hides a ready-made one.voidrenameCategory(String category) A form with the name of a category.voidrestore()Brings back the built-in prompts that were hidden or edited.voidsetFavorite(CoworkPrompts.Prompt p, boolean favorite) Marks the prompt as a favourite or not.
-
Constructor Details
-
PromptActions
- Parameters:
backend- what the view offers: toasts, forms and questionsfile- the prompt file of the userchanged- runs after every change, so the views show the new library
-
-
Method Details
-
change
Runs a change of the prompt file, tells the views and saysdone(already translated) when it is not empty. -
newPrompt
A form for a new prompt, prefilled with a title and text; it is a favourite unless the box is cleared. -
editPrompt
A form to change a prompt. A ready-made prompt becomes one of the user's own (a copy) and the original is hidden. -
removePrompt
Asks, then deletes one of the user's own prompts, or hides a ready-made one. -
setFavorite
Marks the prompt as a favourite or not. -
restore
public void restore()Brings back the built-in prompts that were hidden or edited. -
renameCategory
A form with the name of a category. -
removeCategory
Asks, then removes a category with its prompts: the user's own are deleted, the ready-made ones hidden.
-