/**\r
* The table widget with the file list.\r
*/\r
- private Grid table;// = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8);\r
+ private Grid table;\r
\r
/**\r
* The navigation bar for paginating the results.\r
/**\r
* The number of files in the search results\r
*/\r
- int folderFileCount;\r
+ private int folderFileCount;\r
\r
/**\r
* Total search results size\r
*/\r
- long folderTotalSize;\r
-\r
+ private long folderTotalSize;\r
\r
/**\r
* A cache of the files in the list.\r
*/\r
private List<FileResource> files;\r
\r
-\r
/**\r
* The widget's image bundle.\r
*/\r
public SearchResults(final Images _images) {\r
images = _images;\r
table = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8){\r
+\r
+ @Override\r
public void onBrowserEvent(Event event) {\r
if (files == null || files.size() == 0)\r
return;\r
table.addTableListener(this);\r
\r
// Create the 'navigation' bar at the upper-right.\r
- final HorizontalPanel innerNavBar = new HorizontalPanel();\r
+ HorizontalPanel innerNavBar = new HorizontalPanel();\r
innerNavBar.setStyleName("gss-ListNavBar");\r
innerNavBar.setSpacing(8);\r
innerNavBar.add(prevButton);\r
}\r
}\r
\r
-\r
-\r
/**\r
* Retrieve the root folder for the current user.\r
*\r
return DONE;\r
}\r
\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see com.google.gwt.user.client.ui.TableListener#onCellClicked(com.google.gwt.user.client.ui.SourcesTableEvents,\r
- * int, int)\r
- */\r
- public void onCellClicked(@SuppressWarnings("unused") SourcesTableEvents sender, int row, @SuppressWarnings("unused") int cell) {\r
+ public void onCellClicked(SourcesTableEvents sender, int row, int cell) {\r
// Select the row that was clicked (-1 to account for header row).\r
if (row > folderFileCount)\r
return;\r
}\r
prevButton.setVisible(false);\r
nextButton.setVisible(false);\r
-\r
}\r
\r
/**\r
}\r
selectedRows.add(startIndex + row);\r
styleRow(row, true);\r
-\r
}\r
else {\r
clearSelectedRows();\r
GSS.get().setCurrentSelection(getSelectedFiles());\r
//contextMenu.setFiles(getSelectedFiles());\r
table.setWidget(row + 1, 0, contextMenu);\r
-\r
}\r
}\r
\r
\r
/**\r
* Update the file cache with data from the server.\r
- *\r
- * @param userId the ID of the current user\r
*/\r
- public void updateFileCache( String query) {\r
+ public void updateFileCache(String query) {\r
clearSelectedRows();\r
sortingProperty = "name";\r
clearLabels();\r
} else{\r
searchResults.setHTML("Search results for " + query);\r
\r
- ExecuteGet<SearchResource> eg = new ExecuteGet<SearchResource>(SearchResource.class, GSS.GSS_REST_PATH+"search/"+URL.encodeComponent(query)){\r
+ ExecuteGet<SearchResource> eg = new ExecuteGet<SearchResource>(SearchResource.class,\r
+ GSS.GSS_REST_PATH+"search/"+URL.encodeComponent(query)){\r
\r
@Override\r
public void onComplete() {\r
update();\r
}\r
\r
+ @Override\r
public void onError(Throwable t) {\r
if(t instanceof RestException)\r
GSS.get().displayError("Unable to perform search:"+((RestException)t).getHttpStatusText());\r
* @param _files\r
* @param filePaths the files to set\r
*/\r
- void setFiles(final List<FileResource> _files) {\r
+ private void setFiles(List<FileResource> _files) {\r
files = _files;\r
Collections.sort(files, new Comparator<FileResource>() {\r
\r
public int compare(FileResource arg0, FileResource arg1) {\r
return arg0.getName().compareTo(arg1.getName());\r
-\r
}\r
\r
});\r
$doc.body.onselectstart = null;\r
}-*/;\r
\r
- /**\r
- *\r
- */\r
public void selectAllRows() {\r
clearSelectedRows();\r
int count = folderFileCount;\r
GSS.get().setCurrentSelection(getSelectedFiles());\r
//contextMenu.setFiles(getSelectedFiles());\r
table.setWidget(i - 1, 0, contextMenu);\r
-\r
}\r
\r
}\r