+
+ public void addSelectionModel(@SuppressWarnings("rawtypes") SingleSelectionModel model) {
+ selectionModels.add(model);
+ }
+
+ public OtherSharedTreeView getOtherSharedTreeView() {
+ return otherSharedTreeView;
+ }
+
+ public void updateTrash(boolean showFiles, Command callback) {
+ updateFolder(trash, showFiles, callback);
+ }
+
+ public void updateGroupsNode() {
+ groupTreeView.updateGroupNode(null);
+ }
+
+ public void addGroup(String groupname) {
+ Group newGroup = new Group(groupname);
+ account.addGroup(newGroup);
+ groupTreeView.updateGroupNode(null);
+ }
+
+ public void removeGroup(Group group) {
+ account.removeGroup(group);
+ updateGroupsNode();
+ }
+
+ public TreeView getSelectedTree() {
+ return selectedTree;
+ }
+
+ public Folder getSelection() {
+ return selectedTree.getSelection();
+ }
+
+ public void showFolderStatistics(int folderFileCount) {
+ numOfFiles.setHTML(String.valueOf(folderFileCount));
+ }
+
+ public GroupTreeView getGroupTreeView() {
+ return groupTreeView;
+ }
+
+ public void sessionExpired() {
+ new SessionExpiredDialog(this).center();
+ }
+
+ public void updateRootFolder(Command callback) {
+ updateFolder(account.getPithos(), false, callback);
+ }
+
+ void createMySharedTree() {
+ mysharedTreeSelectionModel = new SingleSelectionModel<Folder>();
+ mysharedTreeSelectionModel.addSelectionChangeHandler(new Handler() {
+ @Override
+ public void onSelectionChange(@SuppressWarnings("unused") SelectionChangeEvent event) {
+ if (mysharedTreeSelectionModel.getSelectedObject() != null) {
+ deselectOthers(mysharedTreeView, mysharedTreeSelectionModel);
+ upload.setEnabled(false);
+ updateSharedFolder(mysharedTreeSelectionModel.getSelectedObject(), true);
+ }
+ }
+ });
+ selectionModels.add(mysharedTreeSelectionModel);
+ mysharedTreeViewModel = new MysharedTreeViewModel(Pithos.this, mysharedTreeSelectionModel);
+ mysharedTreeViewModel.initialize(new Command() {
+
+ @Override
+ public void execute() {
+ mysharedTreeView = new MysharedTreeView(mysharedTreeViewModel);
+ trees.insert(mysharedTreeView, 3);
+ createOtherSharedTree();
+ }
+ });
+ }
+
+ void createOtherSharedTree() {
+ otherSharedTreeSelectionModel = new SingleSelectionModel<Folder>();
+ otherSharedTreeSelectionModel.addSelectionChangeHandler(new Handler() {
+ @Override
+ public void onSelectionChange(@SuppressWarnings("unused") SelectionChangeEvent event) {
+ if (otherSharedTreeSelectionModel.getSelectedObject() != null) {
+ deselectOthers(otherSharedTreeView, otherSharedTreeSelectionModel);
+ applyPermissions(otherSharedTreeSelectionModel.getSelectedObject());
+ updateOtherSharedFolder(otherSharedTreeSelectionModel.getSelectedObject(), true);
+ }
+ }
+ });
+ selectionModels.add(otherSharedTreeSelectionModel);
+ otherSharedTreeViewModel = new OtherSharedTreeViewModel(Pithos.this, otherSharedTreeSelectionModel);
+ otherSharedTreeViewModel.initialize(new Command() {
+
+ @Override
+ public void execute() {
+ otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
+ trees.insert(otherSharedTreeView, 4);
+ }
+ });
+ }
+
+ public void logoff() {
+ Configuration conf = (Configuration) GWT.create(Configuration.class);
+ Cookies.removeCookie(conf.authCookie());
+ Window.Location.assign(Window.Location.getHost());
+ }