2 // Armadillo File Manager
3 // Copyright (c) 2010, Robert Sesek <http://www.bluestatic.org>
5 // This program is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free Software
7 // Foundation, either version 3 of the License, or any later version.
10 goog
.provide('armadillo.File');
12 goog
.require('goog.Disposable');
13 goog
.require('goog.dom');
16 * A file in a directory listing.
17 * @param {string} File name.
20 armadillo
.File
= function(name
) {
21 goog
.Disposable
.call(this);
23 this.isDirectory_
= app
.isDirectory_(name
);
25 goog
.inherits(armadillo
.File
, goog
.Disposable
);
31 goog
.Disposable
.prototype.disposeInternal
= function() {
32 armadillo
.File
.superClass_
.disposeInternal
.call(this);
37 * Constructs the Elements that make up the UI.
38 * @returns {Element} An element ready for insertion into DOM.
40 armadillo
.File
.prototype.draw
= function() {
42 this.element_
= goog
.dom
.createElement('li');
43 this.element_
.representedObject
= this;
45 goog
.dom
.removeChildren(this.element_
);
46 goog
.dom
.setTextContent(this.element_
, this.name_
);
47 app
.listeners_
.push(goog
.events
.listen(this.element_
,
48 goog
.events
.EventType
.CLICK
, app
.clickHandler_
, false, app
));