Package github.jaffe2718.mccs.jfx
Class MccsController
java.lang.Object
github.jaffe2718.mccs.jfx.MccsController
- All Implemented Interfaces:
javafx.fxml.Initializable
the controller of the mccs IDE
-
Field Summary
Modifier and TypeFieldDescriptionjavafx.scene.layout.VBox
javafx.scene.control.Button
javafx.scene.control.TabPane
javafx.scene.control.MenuItem
javafx.scene.control.MenuItem
javafx.scene.control.Tab
javafx.scene.control.ContextMenu
javafx.scene.control.TreeView<PathNodeItem>
javafx.stage.Popup
the popup of findjavafx.scene.control.TabPane
javafx.scene.control.MenuBar
javafx.scene.layout.VBox
javafx.scene.control.MenuItem
javafx.scene.control.MenuItem
javafx.scene.control.MenuItem
javafx.scene.control.Menu
javafx.scene.control.MenuItem
javafx.scene.control.MenuItem
org.fxmisc.richtext.CodeArea
javafx.scene.control.ToolBar
javafx.scene.control.Menu
javafx.scene.control.MenuItem
javafx.stage.Popup
the popup of replacejavafx.scene.control.TabPane
javafx.scene.layout.BorderPane
javafx.scene.control.Button
javafx.scene.control.ComboBox<String>
javafx.scene.layout.VBox
javafx.scene.layout.VBox
javafx.scene.control.ToolBar
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
editCopy
(javafx.event.ActionEvent event) copy selected textvoid
editCut
(javafx.event.ActionEvent event) cut selected textvoid
editFind
(javafx.event.ActionEvent event) find textvoid
editPaste
(javafx.event.ActionEvent event) paste textvoid
editRedo
(javafx.event.ActionEvent event) redovoid
editReplace
(javafx.event.ActionEvent event) replace textvoid
editSelectAll
(javafx.event.ActionEvent event) select allvoid
editUndo
(javafx.event.ActionEvent event) undovoid
getLeftTabPaneOnClicked
(@NotNull javafx.scene.input.MouseEvent mouseEvent) Release or take back the left tab panevoid
getOnCopyToMenuItemAction
(javafx.event.ActionEvent event) copy the file or directory show a dialog to let the user choose the destination directoryvoid
getOnDeleteMenuItemAction
(@NotNull javafx.event.ActionEvent event) delete the file or directory make sure the user want to delete the file or directory by showing a dialog first if the user click "OK", delete the file or directory after deleting the file or directory, remove the node from the tree viewvoid
getOnMainCloseAction
(javafx.event.ActionEvent event) close the current tabvoid
getOnMainExitAction
(javafx.event.ActionEvent event) exitvoid
getOnMainNewDirAction
(javafx.event.ActionEvent event) when the user clicks the "New Directory" menu item, show a dialog to choose the path to create the new directoryvoid
getOnMainNewFileAction
(@NotNull javafx.event.ActionEvent event) when the user clicks the "New File" menu item, create a new file and add it to the tabpane create a new codearea and add it to the tabpane, as a cache for the new filevoid
getOnMainOpenAction
(javafx.event.ActionEvent event) when the user clicks the "Open" menu item, show a file chooser to let the user choose the file to open if the user chooses a file, check whether the path is valid, then open the file in a new tab else if the user cancels the file chooser, do nothingvoid
getOnMainSaveAction
(javafx.event.ActionEvent event) save the current tab's code to the filevoid
getOnMainSaveAsAction
(javafx.event.ActionEvent event) save the current tab's code as a new filevoid
getOnMouseClickFileTreeView
(@NotNull javafx.scene.input.MouseEvent mouseEvent) view the file treevoid
getOnMoveToMenuItemAction
(javafx.event.ActionEvent event) move the file or directory
show a dialog to let the user choose the destination directory if the destination directory is the same as the source directory, do nothing; if the destination directory is a subdirectory of the source directory, show a dialog and do nothing; if the destination directory is a parent directory of the source directory, show a dialog and do nothing;
else move the file or directory with following steps:
1.void
getOnNewDirectoryItemAction
(@NotNull javafx.event.ActionEvent event) show a dialog to create a new directory and create a new node in the tree view for the new directoryvoid
getOnNewFileMenuItemAction
(@NotNull javafx.event.ActionEvent event) show a dialog to create a new file and create a new tab to edit the file and create a new node in the tree view for the new filevoid
getOnOpenMenuItemAction
(javafx.event.Event event) Open file menu item event open a file and create a new tab to edit the file when click the "Open" menu item expand the tree node when click the directory nodevoid
getOnRenameMenuItemAction
(@NotNull javafx.event.ActionEvent event) Rename the file and update the tree viewvoid
getOpenInExplorerMenuItemAction
(javafx.event.ActionEvent event) open the file in the explorervoid
getRightTabPaneOnClicked
(@NotNull javafx.scene.input.MouseEvent mouseEvent) Right Tab Pane on Clicked
show/hide/switch tabvoid
getRunButtonOnAction
(javafx.event.ActionEvent event) When the user click the "Run" button, execute the minecraft command in the code area or terminate the threadvoid
initialize
(URL location, ResourceBundle resources) Called to initialize a controller after its root element has been completely processed.void
onMainAboutAction
(javafx.event.ActionEvent event) show the about dialogvoid
onMouseClickedButtonHideShow
(@NotNull javafx.scene.input.MouseEvent mouseEvent) show/hide the log area
-
Field Details
-
findPopup
public javafx.stage.Popup findPopupthe popup of find -
replacePopup
public javafx.stage.Popup replacePopupthe popup of replace -
root
public javafx.scene.layout.BorderPane root -
mainMenuBar
public javafx.scene.control.MenuBar mainMenuBar -
topToolBar
public javafx.scene.control.ToolBar topToolBar -
runModeComboBox
-
runButton
public javafx.scene.control.Button runButton -
leftTabPane
public javafx.scene.control.TabPane leftTabPane -
fileExplorerTab
public javafx.scene.control.Tab fileExplorerTab -
fileTreeView
-
fileTreeContextMenu
public javafx.scene.control.ContextMenu fileTreeContextMenu -
openMenuItem
public javafx.scene.control.MenuItem openMenuItem -
newMenu
public javafx.scene.control.Menu newMenu -
newFileMenuItem
public javafx.scene.control.MenuItem newFileMenuItem -
newDirectoryMenuItem
public javafx.scene.control.MenuItem newDirectoryMenuItem -
refactorMenu
public javafx.scene.control.Menu refactorMenu -
renameMenuItem
public javafx.scene.control.MenuItem renameMenuItem -
copyToMenuItem
public javafx.scene.control.MenuItem copyToMenuItem -
moveToMenuItem
public javafx.scene.control.MenuItem moveToMenuItem -
deleteMenuItem
public javafx.scene.control.MenuItem deleteMenuItem -
openInExplorerMenuItem
public javafx.scene.control.MenuItem openInExplorerMenuItem -
rightTabPane
public javafx.scene.control.TabPane rightTabPane -
mcCmdTabVBox
public javafx.scene.layout.VBox mcCmdTabVBox -
sysCmdTabVBox
public javafx.scene.layout.VBox sysCmdTabVBox -
toolsTabVBox
public javafx.scene.layout.VBox toolsTabVBox -
codeTabPane
public javafx.scene.control.TabPane codeTabPane -
bottomVBox
public javafx.scene.layout.VBox bottomVBox -
outToolBar
public javafx.scene.control.ToolBar outToolBar -
buttonHideShow
public javafx.scene.control.Button buttonHideShow -
outLogCodeArea
public org.fxmisc.richtext.CodeArea outLogCodeArea
-
-
Constructor Details
-
MccsController
public MccsController()
-
-
Method Details
-
initialize
Called to initialize a controller after its root element has been completely processed.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
location
- The location used to resolve relative paths for the root object, ornull
if the location is not known.resources
- The resources used to localize the root object, ornull
if the root object was not localized.
-
getOnMouseClickFileTreeView
public void getOnMouseClickFileTreeView(@NotNull @NotNull javafx.scene.input.MouseEvent mouseEvent) view the file tree- Parameters:
mouseEvent
- the mouse event
-
onMouseClickedButtonHideShow
public void onMouseClickedButtonHideShow(@NotNull @NotNull javafx.scene.input.MouseEvent mouseEvent) show/hide the log area- Parameters:
mouseEvent
- the mouse event
-
getLeftTabPaneOnClicked
public void getLeftTabPaneOnClicked(@NotNull @NotNull javafx.scene.input.MouseEvent mouseEvent) Release or take back the left tab pane- Parameters:
mouseEvent
- the mouse event
-
getRightTabPaneOnClicked
public void getRightTabPaneOnClicked(@NotNull @NotNull javafx.scene.input.MouseEvent mouseEvent) Right Tab Pane on Clicked
show/hide/switch tab- Parameters:
mouseEvent
- the mouse event
-
getRunButtonOnAction
public void getRunButtonOnAction(javafx.event.ActionEvent event) When the user click the "Run" button, execute the minecraft command in the code area or terminate the thread- Parameters:
event
- the action event
-
getOnOpenMenuItemAction
public void getOnOpenMenuItemAction(javafx.event.Event event) Open file menu item event open a file and create a new tab to edit the file when click the "Open" menu item expand the tree node when click the directory node- Parameters:
event
- the action event
-
getOnNewFileMenuItemAction
public void getOnNewFileMenuItemAction(@NotNull @NotNull javafx.event.ActionEvent event) show a dialog to create a new file and create a new tab to edit the file and create a new node in the tree view for the new file- Parameters:
event
- the event
-
getOnNewDirectoryItemAction
public void getOnNewDirectoryItemAction(@NotNull @NotNull javafx.event.ActionEvent event) show a dialog to create a new directory and create a new node in the tree view for the new directory- Parameters:
event
- the event
-
getOpenInExplorerMenuItemAction
public void getOpenInExplorerMenuItemAction(javafx.event.ActionEvent event) open the file in the explorer- Parameters:
event
- the event
-
getOnDeleteMenuItemAction
public void getOnDeleteMenuItemAction(@NotNull @NotNull javafx.event.ActionEvent event) delete the file or directory make sure the user want to delete the file or directory by showing a dialog first if the user click "OK", delete the file or directory after deleting the file or directory, remove the node from the tree view- Parameters:
event
- the event
-
getOnRenameMenuItemAction
public void getOnRenameMenuItemAction(@NotNull @NotNull javafx.event.ActionEvent event) Rename the file and update the tree view- Parameters:
event
- the event
-
getOnCopyToMenuItemAction
public void getOnCopyToMenuItemAction(javafx.event.ActionEvent event) copy the file or directory show a dialog to let the user choose the destination directory- Parameters:
event
- the event
-
getOnMoveToMenuItemAction
public void getOnMoveToMenuItemAction(javafx.event.ActionEvent event) move the file or directory
show a dialog to let the user choose the destination directory if the destination directory is the same as the source directory, do nothing; if the destination directory is a subdirectory of the source directory, show a dialog and do nothing; if the destination directory is a parent directory of the source directory, show a dialog and do nothing;
else move the file or directory with following steps:
1. move the file or directory to the destination directory;
2. refresh the parent node of the source directory or file;- Parameters:
event
- the event
-
getOnMainNewFileAction
public void getOnMainNewFileAction(@NotNull @NotNull javafx.event.ActionEvent event) when the user clicks the "New File" menu item, create a new file and add it to the tabpane create a new codearea and add it to the tabpane, as a cache for the new file- Parameters:
event
- the event
-
getOnMainNewDirAction
public void getOnMainNewDirAction(javafx.event.ActionEvent event) when the user clicks the "New Directory" menu item, show a dialog to choose the path to create the new directory- Parameters:
event
- the action event
-
getOnMainOpenAction
public void getOnMainOpenAction(javafx.event.ActionEvent event) when the user clicks the "Open" menu item, show a file chooser to let the user choose the file to open if the user chooses a file, check whether the path is valid, then open the file in a new tab else if the user cancels the file chooser, do nothing- Parameters:
event
- the action event
-
getOnMainSaveAction
public void getOnMainSaveAction(javafx.event.ActionEvent event) save the current tab's code to the file- Parameters:
event
- the event
-
getOnMainSaveAsAction
public void getOnMainSaveAsAction(javafx.event.ActionEvent event) save the current tab's code as a new file- Parameters:
event
- the event
-
getOnMainCloseAction
public void getOnMainCloseAction(javafx.event.ActionEvent event) close the current tab- Parameters:
event
- the event
-
getOnMainExitAction
public void getOnMainExitAction(javafx.event.ActionEvent event) exit- Parameters:
event
- the event
-
editSelectAll
public void editSelectAll(javafx.event.ActionEvent event) select all- Parameters:
event
- the event
-
editCopy
public void editCopy(javafx.event.ActionEvent event) copy selected text- Parameters:
event
- the event
-
editCut
public void editCut(javafx.event.ActionEvent event) cut selected text- Parameters:
event
- the event
-
editPaste
public void editPaste(javafx.event.ActionEvent event) paste text- Parameters:
event
- the event
-
editFind
public void editFind(javafx.event.ActionEvent event) find text- Parameters:
event
- the event
-
editReplace
public void editReplace(javafx.event.ActionEvent event) replace text- Parameters:
event
- the event
-
editUndo
public void editUndo(javafx.event.ActionEvent event) undo- Parameters:
event
- the event
-
editRedo
public void editRedo(javafx.event.ActionEvent event) redo- Parameters:
event
- the event
-
onMainAboutAction
public void onMainAboutAction(javafx.event.ActionEvent event) show the about dialog- Parameters:
event
- the event
-