Interface PopupFactory
public interface PopupFactory
Used to create a popup
This interface cannot to be instantiated
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull javafx.stage.Popup
Create a find popup
the layout of the popup is like this: the fist row's length is 20px, the second row's length is 200px
| Label("Regex") | TextField | // the first row, height is 20px
| Label() | HBox{Button("Find") | Button("Exit")} | // the second row, height is 20px
This popup will be shown when user click the "Find" button in the toolbar "Edit" It will find the regex in the current tab of the codeTabPanestatic javafx.stage.Popup
createPromptPopup
(List<String> promptList) Create a prompt popup
This popup will be shown when the text in the codeArea is changed.
Match the last word(maybe an unfinished word or number) in the codeArea by using regex, the last word means the word before the cursor without any space.
When the user clicks the prompt, the prompt will be inserted into the codeArea, the last word will be replaced by the prompt which is clicked.static @NotNull javafx.stage.Popup
Create a replacement popup
| Label("Regex") | TextField | // the first row, height is 20px
| Label("Replace") | TextField | // the second row, height is 20px
| Null | HBox{Button("Next") | Button("Replace") | Button("Replace All") | Button("Exit")} | // the third row, height is 20px
This popup will be shown when user click the "Replace" button in the toolbar "Edit"
It will be used to replace the text matched the regex
-
Method Details
-
createFindPopup
@NotNull static @NotNull javafx.stage.Popup createFindPopup()Create a find popup
the layout of the popup is like this: the fist row's length is 20px, the second row's length is 200px
| Label("Regex") | TextField | // the first row, height is 20px
| Label() | HBox{Button("Find") | Button("Exit")} | // the second row, height is 20px
This popup will be shown when user click the "Find" button in the toolbar "Edit" It will find the regex in the current tab of the codeTabPane- Returns:
- the find popup
-
createReplacePopup
@NotNull static @NotNull javafx.stage.Popup createReplacePopup()Create a replacement popup
| Label("Regex") | TextField | // the first row, height is 20px
| Label("Replace") | TextField | // the second row, height is 20px
| Null | HBox{Button("Next") | Button("Replace") | Button("Replace All") | Button("Exit")} | // the third row, height is 20px
This popup will be shown when user click the "Replace" button in the toolbar "Edit"
It will be used to replace the text matched the regex- Returns:
- the replacement popup
-
createPromptPopup
Create a prompt popup
This popup will be shown when the text in the codeArea is changed.
Match the last word(maybe an unfinished word or number) in the codeArea by using regex, the last word means the word before the cursor without any space.
When the user clicks the prompt, the prompt will be inserted into the codeArea, the last word will be replaced by the prompt which is clicked.- Parameters:
promptList
- a list of String, each String is a prompt- Returns:
- a prompt popup to be shown when the text in the codeArea is changed
-