Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #74 from DaemonF/fileBrowser3

File browser speed up
  • Loading branch information...
commit 87ecf9842d2fa223f09ae7cc6d4d170dcfcbf097 2 parents a9f8431 + cbdf4eb
Will willscott authored
15 oneswarm_gwt_ui/src/edu/washington/cs/oneswarm/ui/gwt/client/fileDialog/FileBrowser.java
View
@@ -7,8 +7,6 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.OpenEvent;
import com.google.gwt.event.logical.shared.OpenHandler;
-import com.google.gwt.event.logical.shared.SelectionEvent;
-import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HasTreeItems;
@@ -36,10 +34,6 @@
private PopupPanel popup;
private Queue<FileTreeItem> openItems;
-
-
- // Will be appended to directories for display
- static final String DIRECTORY_IDENTIFIER = " [...]";
public FileBrowser(String session, boolean directoryOk, final AsyncCallback<String> callback) {
this.session = session;
@@ -133,7 +127,13 @@ private void growTree(final HasTreeItems root, String filePath) {
fileSystem = OneSwarmRPCClient.getService();
}
- root.removeItems();
+ if(root instanceof FileTreeItem)
+ if(((FileTreeItem) root).fileStatus() == FileInfo.FileStatusFlag.NO_READ_PERMISSION){
+ root.removeItems();
+ root.addItem(new FileTreeItem(msg.file_browser_label_unreadable_directory()));
+ ((FileTreeItem) root).setState(true);
+ return;
+ }
if(root instanceof FileTreeItem)
if(((FileTreeItem) root).fileStatus() == FileInfo.FileStatusFlag.NO_READ_PERMISSION){
@@ -147,6 +147,7 @@ public void onFailure(Throwable caught) {
}
public void onSuccess(FileInfo[] result) {
+ root.removeItems();
if (result != null) {
if(result.length == 0)
root.addItem(new FileTreeItem(msg.file_browser_label_empty_directory()));
Please sign in to comment.
Something went wrong with that request. Please try again.