Warning: session_start(): open(/var/lib/php/sessions/sess_ephjg1bnelcjppuagmdg749hkh, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass JFileDropTarget extends MetaWithChangeListeners is Swingable {
settable S msg = "Drop file here";
// currently dropped file
settableWithVar File file;
// file can also be null
event fileSelected(File file);
SingleComponentPanel scp = scp();
*() {
varFile().onChange(file -> {
updateComponent();
fileSelected(file);
});
}
cachedVisualize {
if (!scp.hasComponent())
scp.setComponent(makeComponent());
ret jHandleFileDrop(l1 setFile, scp);
}
void updateComponent {
scp.setComponent(makeComponent());
}
JComponent makeComponent() {
ret file == null
? noFileComponent()
: componentForFile(msg);
}
JComponent noFileComponent() {
ret jcenteredlabel(msg);
}
swappable JComponent componentForFile(File file) {
ret jfullcenter(jFilePathLabel(file));
}
}