-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTableFacade.java
More file actions
36 lines (32 loc) · 1.11 KB
/
TableFacade.java
File metadata and controls
36 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package viewFiles;
import controllers.ViewFilesController;
import java.io.File;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JTree;
/**
*
* @author vasovourka
*/
public class TableFacade {
public static void selectedNode(JTable filesTable, JTree filesTree, JTextField pathText) {
Object node = filesTree.getLastSelectedPathComponent();
String name;
name = (node == null) ? "NONE" : node.toString();
System.out.println("selected node:" + node.toString());
pathText.setText(node.toString());
File file = new File(node.toString());
if (!(file.isFile())) {
filesTable = DefaultJtable.defaultJtable(filesTable);
ViewFilesController controller = new ViewFilesController();
controller.listFilesFolder(file, filesTable, filesTree);
} else {
System.out.println("is file cant be viewed");
}
}
}