@@ -57,7 +57,7 @@ public class MainController {
5757 private Button timeButton ;
5858
5959 @ FXML
60- private TreeView <File > file_explorer ;
60+ private TreeView <File > fileExplorer ;
6161
6262 @ FXML
6363 private TabPane tabPane ;
@@ -74,23 +74,23 @@ void initialize() {
7474 e1 .printStackTrace ();
7575 }
7676 // Set date from date button
77- date_button .setText (LocalDate .now ().toString ());
77+ dateButton .setText (LocalDate .now ().toString ());
7878 Timer timer = new Timer ();
7979 timer .scheduleAtFixedRate (new TimerTask () {
8080 @ Override
8181 public void run () {
8282 // Updates file explorer
83- // if (current_project_path != "") {
84- // Platform.runLater(() -> open_registered_project(current_project_path ));
83+ // if (currentProjectPath != "") {
84+ // Platform.runLater(() -> openRegisteredProject(currentProjectPath ));
8585 // }
8686 // Updates the time button every 2 seconds
8787 int minutes = LocalTime .now ().getMinute ();
8888 int hours = LocalTime .now ().getHour ();
89- Platform .runLater (() -> time_button
89+ Platform .runLater (() -> timeButton
9090 .setText (Integer .toString (hours ) + ((minutes < 10 ) ? ":0" : ":" ) + Integer .toString (minutes )));
9191 }
9292 }, 0 , 2000 );
93- file_explorer .getSelectionModel ().selectedItemProperty ().addListener ((observable , oldValue , newValue ) -> {
93+ fileExplorer .getSelectionModel ().selectedItemProperty ().addListener ((observable , oldValue , newValue ) -> {
9494 try {
9595 openFile (newValue .getValue ().getAbsolutePath ());
9696 } catch (IOException e ) {
@@ -108,7 +108,7 @@ void addSubdirs(String directory, TreeItem<File> treeItem) throws IOException {
108108 TreeItem <File > currentDirTreeItem = new TreeItem <>(dir .getAbsoluteFile ());
109109 treeItem .getChildren ().add (currentDirTreeItem );
110110 // Add all subdirs / files from every subdir to tree
111- add_subdirs (dir .getAbsolutePath (), currentDirTreeItem );
111+ addSubdirs (dir .getAbsolutePath (), currentDirTreeItem );
112112 }
113113 // List all sub files
114114 File [] files = new File (directory ).listFiles (File ::isFile );
@@ -120,13 +120,13 @@ void addSubdirs(String directory, TreeItem<File> treeItem) throws IOException {
120120 }
121121
122122 void openRegisteredProject (String directory ) {
123- current_project_path = directory ;
123+ currentProjectPath = directory ;
124124 Path rootFile = Paths .get (directory );
125125 TreeItem <File > rootItem = new TreeItem <>(new File (directory ));
126- file_explorer .setRoot (rootItem );
126+ fileExplorer .setRoot (rootItem );
127127 try {
128128 // Add all subdirs and subfiles to the tree root
129- add_subdirs (directory , rootItem );
129+ addSubdirs (directory , rootItem );
130130 } catch (IOException e ) {
131131 e .printStackTrace ();
132132 }
@@ -147,7 +147,7 @@ void addProject(ActionEvent event) {
147147 openRegisteredProject (project .toString ());
148148 });
149149 RegisteredProjectsListMenu .getItems ().add (projectMenuItem );
150- open_registered_project (project .toString ());
150+ openRegisteredProject (project .toString ());
151151 try {
152152 saveProjectList ();
153153 } catch (IOException e1 ) {
@@ -159,9 +159,9 @@ void addProject(ActionEvent event) {
159159 @ FXML
160160 void deleteCurrentProject (ActionEvent event ) {
161161 // Remove the current project from the registered list
162- registered_projects .remove (current_project_path );
162+ registered_projects .remove (currentProjectPath );
163163 createProjectList ();
164- close_project ();
164+ closeProject ();
165165 try {
166166 saveProjectList ();
167167 } catch (IOException e1 ) {
@@ -179,15 +179,15 @@ void createProjectList() {
179179 projectMenuItem .setText (Paths .get (project_path ).getFileName ().toString ());
180180 projectMenuItem .setOnAction (e -> {
181181 // Set open action to open the project, when clicked
182- open_registered_project (project_path );
182+ openRegisteredProject (project_path );
183183 });
184184 RegisteredProjectsListMenu .getItems ().add (projectMenuItem );
185185 }
186186 }
187187
188188 @ FXML
189189 void closeCurrentProject (ActionEvent event ) {
190- close_project ();
190+ closeProject ();
191191 }
192192
193193 void closeProject () {
@@ -241,7 +241,7 @@ void openDefaultBrowser(ActionEvent event) throws IOException, URISyntaxExceptio
241241 }
242242
243243 @ FXML
244- void openDefautMail (ActionEvent event ) throws IOException , URISyntaxException {
244+ void openDefaultMail (ActionEvent event ) throws IOException , URISyntaxException {
245245 // Shows the github side of the project in the current standard browser
246246 if (Desktop .isDesktopSupported () && Desktop .getDesktop ().isSupported (Desktop .Action .BROWSE )) {
247247 Desktop .getDesktop ().mail ();
@@ -267,24 +267,24 @@ void addTab(ActionEvent event) throws IOException {
267267 // Open a new empty tab
268268 Tab newTab = new Tab ();
269269 newTab .setText ("New tab" );
270- tab_pane .getTabs ().add (newTab );
270+ tabPane .getTabs ().add (newTab );
271271 // Select the tab
272- SingleSelectionModel <Tab > selectionModel = tab_pane .getSelectionModel ();
272+ SingleSelectionModel <Tab > selectionModel = tabPane .getSelectionModel ();
273273 selectionModel .select (newTab );
274274 }
275275
276276 @ FXML
277277 void closeCurrentTab (ActionEvent event ) {
278278 // Close the current tab
279- SingleSelectionModel <Tab > selectionModel = tab_pane .getSelectionModel ();
279+ SingleSelectionModel <Tab > selectionModel = tabPane .getSelectionModel ();
280280 Tab currentTab = selectionModel .getSelectedItem ();
281- tab_pane .getTabs ().remove (currentTab );
281+ tabPane .getTabs ().remove (currentTab );
282282 }
283283
284284 @ FXML
285285 void closeAllTabs (ActionEvent event ) {
286286 // Close all tabs of tabpane
287- tab_pane .getTabs ().clear ();
287+ tabPane .getTabs ().clear ();
288288 }
289289
290290 @ FXML
@@ -294,16 +294,16 @@ void closeFile(ActionEvent event) {
294294 }
295295
296296 @ FXML
297- void newTosoList (ActionEvent event ) throws IOException {
298- if (current_project_path != "" ) {
297+ void newTodolist (ActionEvent event ) throws IOException {
298+ if (currentProjectPath != "" ) {
299299 // Shows the create a new file dialog
300300 FXMLLoader loader = new FXMLLoader ();
301301 loader .setLocation (getClass ().getResource ("/fxml/dialogs/CreateNewFile.fxml" ));
302302 DialogPane createNewFileDialog = loader .load ();
303303 // Get the control of the dialog
304304 CreateNewFileDialogController createFileDialogController = loader .getController ();
305305 createFileDialogController .changeExtention (".todo" );
306- createFileDialogController .setDirectoryField (current_project_path + "/" );
306+ createFileDialogController .setDirectoryField (currentProjectPath + "/" );
307307 Dialog <ButtonType > dialog = new Dialog <>();
308308 dialog .setDialogPane (createNewFileDialog );
309309 dialog .setTitle ("Create a new file" );
@@ -405,7 +405,7 @@ void loadProjectList() throws IOException, JsonException {
405405 }
406406
407407 Tab get_current_tab () {
408- SingleSelectionModel <Tab > selectionModel = tab_pane .getSelectionModel ();
408+ SingleSelectionModel <Tab > selectionModel = tabPane .getSelectionModel ();
409409 return (selectionModel .getSelectedItem ());
410410 }
411411
0 commit comments