-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveListener.java
More file actions
36 lines (31 loc) · 878 Bytes
/
RemoveListener.java
File metadata and controls
36 lines (31 loc) · 878 Bytes
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 template, choose Tools | Templates
* and open the template in the editor.
*/
package Notes;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author pokus
*/
public class RemoveListener implements ActionListener{
Window window;
Core core;
public RemoveListener(Window window, Core core) {
this.window = window;
this.core = core;
}
@Override
public void actionPerformed(ActionEvent e) {
String[] path = window.getActualPath();
String[] files = core.getFiles(path[0]);
core.removeNote(path[0], path[1]);
System.out.println("Remove: " + path[0] + "/" + path[1]);
window.setFiles(core.getFiles(path[0]));
window.setFocus();
if(files.length == 0){
window.setFolders(core.getFolders());
}
}
}