-
- 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(SelectionChangeEvent event) {
- if (mysharedTreeSelectionModel.getSelectedObject() != null) {
- deselectOthers(mysharedTreeView, mysharedTreeSelectionModel);
- upload.setEnabled(false);
- updateSharedFolder(mysharedTreeSelectionModel.getSelectedObject(), true);
- }
- showRelevantToolbarButtons();
- }
- });
- selectionModels.add(mysharedTreeSelectionModel);
- mysharedTreeViewModel = new MysharedTreeViewModel(Pithos.this, mysharedTreeSelectionModel);
- mysharedTreeViewModel.initialize(new Command() {
-
- @Override
- public void execute() {
- mysharedTreeView = new MysharedTreeView(mysharedTreeViewModel);
- trees.insert(mysharedTreeView, 2);
- treeViews.add(mysharedTreeView);
- createOtherSharedTree();
- }
- });
- }
-
- void createOtherSharedTree() {
- otherSharedTreeSelectionModel = new SingleSelectionModel<Folder>();
- otherSharedTreeSelectionModel.addSelectionChangeHandler(new Handler() {
- @Override
- public void onSelectionChange(SelectionChangeEvent event) {
- if (otherSharedTreeSelectionModel.getSelectedObject() != null) {
- deselectOthers(otherSharedTreeView, otherSharedTreeSelectionModel);
- otherSharedTreeView.addStyleName("cellTreeWidget-selectedTree");
- applyPermissions(otherSharedTreeSelectionModel.getSelectedObject());
- updateOtherSharedFolder(otherSharedTreeSelectionModel.getSelectedObject(), true);
- }
- showRelevantToolbarButtons();
- }
- });
- selectionModels.add(otherSharedTreeSelectionModel);
- otherSharedTreeViewModel = new OtherSharedTreeViewModel(Pithos.this, otherSharedTreeSelectionModel);
- otherSharedTreeViewModel.initialize(new Command() {
-
- @Override
- public void execute() {
- otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
- trees.insert(otherSharedTreeView, 3);
- treeViews.add(otherSharedTreeView);
- }
- });
- }
-
- public void logoff() {
- Configuration conf = (Configuration) GWT.create(Configuration.class);
- Cookies.removeCookie(conf.authCookie(), "/");
- Cookies.removeCookie(conf.authTokenCookie(), "/");
- for (String s: Cookies.getCookieNames())
- if (s.startsWith(conf.shibSessionCookiePrefix()))
- Cookies.removeCookie(s, "/");
- Window.Location.assign(Window.Location.getPath());
- }
-
- public String getErrorData() {
- if (error != null)
- return error.toString();
- return "";
- }
-
- public void setError(Throwable t) {
- error = t;
- }
-
- public void showRelevantToolbarButtons() {
- toolbar.showRelevantButtons();
- }