use of org.rstudio.core.client.files.FileSystemItem in project rstudio by rstudio.
the class ChooseFolderDialog method onSelection.
@Override
public void onSelection(SelectionEvent<FileSystemItem> event) {
super.onSelection(event);
FileSystemItem item = event.getSelectedItem();
if (item != null && item.isDirectory())
browser_.setFilename(item.getName());
}
use of org.rstudio.core.client.files.FileSystemItem in project rstudio by rstudio.
the class ChooseFolderDialog2 method ls.
@Override
public FileSystemItem[] ls() {
FileSystemItem[] items = super.ls();
ArrayList<FileSystemItem> dirs = new ArrayList<FileSystemItem>();
for (FileSystemItem item : items) if (item.isDirectory())
dirs.add(item);
return dirs.toArray(new FileSystemItem[0]);
}
use of org.rstudio.core.client.files.FileSystemItem in project rstudio by rstudio.
the class ChooseFolderDialog2 method onSelection.
@Override
public void onSelection(SelectionEvent<FileSystemItem> event) {
super.onSelection(event);
FileSystemItem item = event.getSelectedItem();
if (item != null)
browser_.setFilename(item.getPath());
else
browser_.setFilename("");
}
use of org.rstudio.core.client.files.FileSystemItem in project rstudio by rstudio.
the class DirectoryContentsWidget method setContents.
public void setContents(FileSystemItem[] contents, FileSystemItem parentDirectory) {
clearContents();
if (parentDirectory != null)
addItem(parentDirectory, "..", new ImageResource2x(FileIconResources.INSTANCE.iconUpFolder2x()));
for (FileSystemItem fsi : contents) addItem(fsi, null, null);
showProgress(false);
}
use of org.rstudio.core.client.files.FileSystemItem in project rstudio by rstudio.
the class DirectoryContentsWidget method selectBufferMatchImpl.
private boolean selectBufferMatchImpl(String buffer, StringTransformer transformer) {
String string = transformer.transform(buffer);
int i = 0;
for (Map.Entry<String, FileSystemItem> entry : items_.entrySet()) {
String fileName = transformer.transform(entry.getKey());
if (fileName.startsWith(string)) {
setSelectedRow(i);
return true;
}
i++;
}
return false;
}
Aggregations