Move MainContent and its derivative to a new package, rework ContactList
[jvcard.git] / src / be / nikiroo / jvcard / tui / panes / FileList.java
1 package be.nikiroo.jvcard.tui.panes;
2
3 import java.io.File;
4 import java.util.List;
5
6 import be.nikiroo.jvcard.tui.KeyAction;
7 import be.nikiroo.jvcard.tui.UiColors;
8 import be.nikiroo.jvcard.tui.KeyAction.DataType;
9 import be.nikiroo.jvcard.tui.KeyAction.Mode;
10
11 import com.googlecode.lanterna.gui2.Label;
12
13 public class FileList extends MainContentList {
14 private List<File> files;
15
16 public FileList(List<File> files) {
17 super(UiColors.Element.CONTACT_LINE,
18 UiColors.Element.CONTACT_LINE_SELECTED);
19
20 setFiles(files);
21 }
22
23 /**
24 * Change the list of currently selected files.
25 *
26 * @param files
27 * the new files
28 */
29 public void setFiles(List<File> files) {
30 clearItems();
31 this.files = files;
32
33 // TODO
34 for (File file : files) {
35 addItem(file.getName());
36 }
37
38 setSelectedIndex(0);
39 }
40
41 @Override
42 public DataType getDataType() {
43 return DataType.CARD_FILES;
44 }
45
46 @Override
47 public String getExitWarning() {
48 // TODO Auto-generated method stub
49 return null;
50 }
51
52 @Override
53 public List<KeyAction> getKeyBindings() {
54 // TODO Auto-generated method stub
55 return null;
56 }
57
58 @Override
59 public Mode getMode() {
60 return Mode.FILE_LIST;
61 }
62
63 @Override
64 public String getTitle() {
65 // TODO Auto-generated method stub
66 return null;
67 }
68
69 }