TreeItem item = event.getSelectedItem();
processItemSelected(item);
String path = GSS.get().getApiPath() + GSS.get().getCurrentUserResource().getUsername()+ "/";
- ((RestResource) GSS.get().getFolders().getCurrent().getUserObject()).updateHistoryAbs(item,path);
+ ((RestResource) GSS.get().getFolders().getCurrent().getUserObject()).updateHistory(item,path);
}
});
public void setTreeSelectedItem(TreeItem newSelectedItem) {
treeSelectedItem = newSelectedItem;
}
-
- /**
- * construct the partial path of the selected TreeItem
- *
- * @param selectedItem the selectedItem to check
- */
- public String constructPartialPath(TreeItem selectedItem){
- String result = DisplayHelper.trim(selectedItem.getText());
- TreeItem parent = selectedItem.getParentItem();
- while (!(DisplayHelper.trim(parent.getText()).equals("My Shared") || DisplayHelper.trim(parent.getText()).equals("Other's Shared")||DisplayHelper.trim(parent.getText()).equals("Trash"))){
- result = DisplayHelper.trim(parent.getText()) + "/" + result;
- if(result.equals("My Shared")||result.equals("Other's Shared")) return result;
- parent = parent.getParentItem();
- }
-
- return result;
- }
- /**
- * examine whether a folder name like "Trash", "My Shared", "Other's Shared" is inside path
- *
- * @param selectedItem the selectedTreeItem to check
- */
-
- public boolean containsFolder(TreeItem selectedItem, String folderName){
- TreeItem parent = selectedItem.getParentItem();
- while (parent != null){
- String parentItemText = parent.getText();
- String parentItemTextTr = DisplayHelper.trim(parentItemText);
- if(parentItemTextTr.equals(folderName)) return true;
- parent = parent.getParentItem();
- }
- return false;
- }
}
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
-import com.google.gwt.user.client.ui.TreeItem;
/**
* @author kman
return getDate(modificationDate.getTime());
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
package gr.ebs.gss.client.rest.resource;
+import gr.ebs.gss.client.DisplayHelper;
import gr.ebs.gss.client.GSS;
import gr.ebs.gss.client.rest.MultipleGetCommand;
import gr.ebs.gss.client.rest.MultipleGetCommand.Cached;
filesExpanded = newFilesExpanded;
}
+ /**
+ * history support for folder navigation
+ */
@Override
- public void updateHistoryAbs(TreeItem item, String path){
+ public void updateHistory(TreeItem item, String path){
try{
if(getParentURI() == null){
- if(GSS.get().getFolders().getPopupTree().containsFolder(item, "Trash")){
+ if(containsFolder(item, "Trash")){
// case: selected folders below Trash folder
- String partialUri = GSS.get().getFolders().getPopupTree().constructPartialPath(item);
+ String partialUri = constructPartialPath(item);
GSS.get().updateHistory("Files/trash/" + partialUri, item);
} else
// case: home folders are selected
String newPath = getParentURI().substring(apiPath.lastIndexOf("/"));
GSS.get().updateHistory("Files"+ newPath + getName(), item);
}
- else if(GSS.get().getFolders().getPopupTree().containsFolder(item, "My Shared")){
+ else if(containsFolder(item, "My Shared")){
// case: selected folders below My Shared folder
- String partialUri = GSS.get().getFolders().getPopupTree().constructPartialPath(item);
+ String partialUri = constructPartialPath(item);
GSS.get().updateHistory("Files/shared/" + partialUri, item);
- }else if(GSS.get().getFolders().getPopupTree().containsFolder(item, "Other's Shared")){
+ }else if(containsFolder(item, "Other's Shared")){
// case: selected folders below Other's Shared folder
- String partialPath = GSS.get().getFolders().getPopupTree().constructPartialPath(item);
+ String partialPath = constructPartialPath(item);
GSS.get().updateHistory("Files/others/"+ partialPath, item);
}
else{
}
}
+ /**
+ * construct the partial path of the selected TreeItem
+ *
+ * @param selectedItem the selectedItem to check
+ */
+ private String constructPartialPath(TreeItem selectedItem){
+ String result = DisplayHelper.trim(selectedItem.getText());
+ TreeItem parent = selectedItem.getParentItem();
+ while (!(DisplayHelper.trim(parent.getText()).equals("My Shared") || DisplayHelper.trim(parent.getText()).equals("Other's Shared")||DisplayHelper.trim(parent.getText()).equals("Trash"))){
+ result = DisplayHelper.trim(parent.getText()) + "/" + result;
+ if(result.equals("My Shared")||result.equals("Other's Shared")) return result;
+ parent = parent.getParentItem();
+ }
+
+ return result;
+ }
+ /**
+ * examine whether a folder name like "Trash", "My Shared", "Other's Shared" is inside path
+ *
+ * @param selectedItem the selectedTreeItem to check
+ */
+
+ private boolean containsFolder(TreeItem selectedItem, String folderName){
+ TreeItem parent = selectedItem.getParentItem();
+ while (parent != null){
+ String parentItemText = parent.getText();
+ String parentItemTextTr = DisplayHelper.trim(parentItemText);
+ if(parentItemTextTr.equals(folderName)) return true;
+ parent = parent.getParentItem();
+ }
+ return false;
+ }
}
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
* @author kman
public String getLastModifiedSince() {
return null;
}
-
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
public String getLastModifiedSince() {
return null;
}
-
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
-
/**
* @author kman
*/
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
public void setFilesExpanded(boolean newFilesExpanded) {
filesExpanded = newFilesExpanded;
}
-
/**
- * Bugzilla – Bug 371, Add history support for folder navigation
+ * history support for folder navigation
*/
@Override
- public void updateHistoryAbs(TreeItem item, String path){
- try{
- GSS.get().updateHistory("Files/others/"+ getName(), item);
- }catch(Exception e){
- throw new UnsupportedOperationException();
- }
+ public void updateHistory(TreeItem item, String path){
+ GSS.get().updateHistory("Files/others/"+ getName(), item);
}
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
}
/**
- * Bugzilla – Bug 371, Add history support for folder navigation
+ * history support for folder navigation
*/
@Override
- public void updateHistoryAbs(TreeItem item, String path){
- try{
- GSS.get().updateHistory("Files/"+ path.substring(path.lastIndexOf("/")+1) + "others/", item);
- }catch(Exception e){
- throw new UnsupportedOperationException(e);
- }
+ public void updateHistory(TreeItem item, String path){
+ GSS.get().updateHistory("Files/"+ path.substring(path.lastIndexOf("/")+1) + "others/", item);
}
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
public abstract String getLastModifiedSince();
- public abstract void updateHistoryAbs(TreeItem item, String path);
+ public void updateHistory(TreeItem item, String path){
+
+ }
}
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
* @author kman
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
filesExpanded = newFilesExpanded;
}
/**
- * Bugzilla – Bug 371, Add history support for folder navigation
+ * history support for folder navigation
*/
@Override
- public void updateHistoryAbs(TreeItem item, String path){
- try{
- GSS.get().updateHistory("Files/"+ getUri().substring(path.lastIndexOf("/")+1), item);
- }catch(Exception e){
- throw new UnsupportedOperationException(e);
- }
+ public void updateHistory(TreeItem item, String path){
+ GSS.get().updateHistory("Files/"+ getUri().substring(path.lastIndexOf("/")+1), item);
}
}
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
}
/*
- * Copyright 2009 Electronic Business Systems Ltd.
+ * Copyright 2009, 2010 Electronic Business Systems Ltd.
*
* This file is part of GSS.
*
return null;
}
/**
- * Bugzilla – Bug 371, Add history support for folder navigation
+ * history support for folder navigation
*/
- public void updateHistoryAbs(TreeItem item, String path){
- try{
- GSS.get().updateHistory("Files/"+ getUri().substring(path.lastIndexOf("/")+1), item);
- }catch (Exception e){
- throw new UnsupportedOperationException();
- }
+ @Override
+ public void updateHistory(TreeItem item, String path){
+ GSS.get().updateHistory("Files/"+ getUri().substring(path.lastIndexOf("/")+1), item);
}
}
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
-
}
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
* @author kman
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
}
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.user.client.ui.TreeItem;
/**
* A container for the results of a search query for users.
public String getLastModifiedSince() {
return null;
}
- /**
- * Bugzilla – Bug 371, Add history support for folder navigation
- */
- public void updateHistoryAbs(TreeItem item, String path){
- throw new UnsupportedOperationException();
- }
}