Class MccsController

java.lang.Object
github.jaffe2718.mccs.jfx.MccsController
All Implemented Interfaces:
javafx.fxml.Initializable

public class MccsController extends Object implements javafx.fxml.Initializable
the controller of the mccs IDE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    javafx.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 find
    javafx.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 replace
    javafx.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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    editCopy(javafx.event.ActionEvent event)
    copy selected text
    void
    editCut(javafx.event.ActionEvent event)
    cut selected text
    void
    editFind(javafx.event.ActionEvent event)
    find text
    void
    editPaste(javafx.event.ActionEvent event)
    paste text
    void
    editRedo(javafx.event.ActionEvent event)
    redo
    void
    editReplace(javafx.event.ActionEvent event)
    replace text
    void
    editSelectAll(javafx.event.ActionEvent event)
    select all
    void
    editUndo(javafx.event.ActionEvent event)
    undo
    void
    getLeftTabPaneOnClicked(@NotNull javafx.scene.input.MouseEvent mouseEvent)
    Release or take back the left tab pane
    void
    getOnCopyToMenuItemAction(javafx.event.ActionEvent event)
    copy the file or directory show a dialog to let the user choose the destination directory
    void
    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 view
    void
    getOnMainCloseAction(javafx.event.ActionEvent event)
    close the current tab
    void
    getOnMainExitAction(javafx.event.ActionEvent event)
    exit
    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
    void
    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 file
    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
    void
    getOnMainSaveAction(javafx.event.ActionEvent event)
    save the current tab's code to the file
    void
    getOnMainSaveAsAction(javafx.event.ActionEvent event)
    save the current tab's code as a new file
    void
    getOnMouseClickFileTreeView(@NotNull javafx.scene.input.MouseEvent mouseEvent)
    view the file tree
    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.
    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 directory
    void
    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 file
    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
    void
    getOnRenameMenuItemAction(@NotNull javafx.event.ActionEvent event)
    Rename the file and update the tree view
    void
    getOpenInExplorerMenuItemAction(javafx.event.ActionEvent event)
    open the file in the explorer
    void
    getRightTabPaneOnClicked(@NotNull javafx.scene.input.MouseEvent mouseEvent)
    Right Tab Pane on Clicked
    show/hide/switch tab
    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
    void
    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 dialog
    void
    onMouseClickedButtonHideShow(@NotNull javafx.scene.input.MouseEvent mouseEvent)
    show/hide the log area

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • findPopup

      public javafx.stage.Popup findPopup
      the popup of find
    • replacePopup

      public javafx.stage.Popup replacePopup
      the popup of replace
    • root

      public javafx.scene.layout.BorderPane root
    • topToolBar

      public javafx.scene.control.ToolBar topToolBar
    • runModeComboBox

      public javafx.scene.control.ComboBox<String> runModeComboBox
    • runButton

      public javafx.scene.control.Button runButton
    • leftTabPane

      public javafx.scene.control.TabPane leftTabPane
    • fileExplorerTab

      public javafx.scene.control.Tab fileExplorerTab
    • fileTreeView

      public javafx.scene.control.TreeView<PathNodeItem> 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

      public void initialize(URL location, ResourceBundle resources)
      Called to initialize a controller after its root element has been completely processed.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      location - The location used to resolve relative paths for the root object, or null if the location is not known.
      resources - The resources used to localize the root object, or null 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