- public void reflow() {
-
- // Reset the lines
- selectedFile = -1;
- maxLineWidth = 0;
- files.clear();
-
- // Build a list of files in this directory
- File [] newFiles = path.listFiles();
- for (int i = 0; i < newFiles.length; i++) {
- if (newFiles[i].getName().startsWith(".")) {
- continue;
- }
- if (newFiles[i].isDirectory()) {
- continue;
- }
- files.add(newFiles[i]);
- }
-
- for (int i = 0; i < files.size(); i++) {
- String line = renderFile(i);
- if (line.length() > maxLineWidth) {
- maxLineWidth = line.length();
- }
- }
-
- // Start at the top
- if (vScroller == null) {
- vScroller = new TVScroller(this, getWidth() - 1, 0,
- getHeight() - 1);
- } else {
- vScroller.setX(getWidth() - 1);
- vScroller.setHeight(getHeight() - 1);
- }
- vScroller.setBottomValue(files.size() - getHeight() - 1);
- vScroller.setTopValue(0);
- vScroller.setValue(0);
- if (vScroller.getBottomValue() < 0) {
- vScroller.setBottomValue(0);
- }
- vScroller.setBigChange(getHeight() - 1);
+ public TDirectoryList(final TWidget parent, final String path, final int x,
+ final int y, final int width, final int height, final TAction action) {