*/
package gr.ebs.gss.client;
-import gr.ebs.gss.client.dnd.DnDSimpleFocusPanel;
+
import gr.ebs.gss.client.rest.GetCommand;
import gr.ebs.gss.client.rest.RestCommand;
import gr.ebs.gss.client.rest.RestException;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HTMLTable.Cell;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
/**
* A composite that displays a list of search results for a particular query on
private ArrayList<Integer> selectedRows = new ArrayList<Integer>();
- /**
- * The context menu for the selected file.
- */
- final DnDSimpleFocusPanel contextMenu;
+
/**
* Specifies that the images available for this composite will be the ones
* available in FileContextMenu.
*/
- public interface Images extends ClientBundle,FileContextMenu.Images, Folders.Images {
+ public interface Images extends ClientBundle,FileContextMenu.Images, CellTreeView.Images {
@Source("gr/ebs/gss/resources/blank.gif")
ImageResource blank();
prevButton.addClickHandler(this);
nextButton.addClickHandler(this);
- contextMenu = new DnDSimpleFocusPanel(new HTML(AbstractImagePrototype.create(images.fileContextMenu()).getHTML()));
- contextMenu.addClickHandler(new FileContextMenu(images, false, false));
- app.getDragController().makeDraggable(contextMenu);
-
+
// Setup the table.
table.setCellSpacing(0);
table.setCellPadding(2);
}
GSS.get().setCurrentSelection(getSelectedFiles());
//contextMenu.setFiles(getSelectedFiles());
- table.setWidget(row, 0, contextMenu);
+ //table.setWidget(row, 0, contextMenu);
} else if (row != -1 && row == firstShift) {
selectedRows.add(row);
selectedRows.add(row - 1);
styleRow(i, true);
}
GSS.get().setCurrentSelection(getSelectedFiles());
- table.setWidget(row, 0, contextMenu);
+ //table.setWidget(row, 0, contextMenu);
//contextMenu.setFiles(getSelectedFiles());
}
else
GSS.get().setCurrentSelection(getSelectedFiles());
//contextMenu.setFiles(getSelectedFiles());
- table.setWidget(row + 1, 0, contextMenu);
+ //table.setWidget(row + 1, 0, contextMenu);
}
}
startIndex = 0;
app.showLoadingIndicator();
if (query == null || query.trim().equals("")) {
- searchResults.setHTML("You must specify a query");
+ searchResults.setHTML("You must specify a query.");
+ setFiles(new ArrayList());
+ update(true);
+ app.hideLoadingIndicator();
+ } else if (!GSS.isValidResourceName(query)) {
+ searchResults.setHTML("The query was invalid. Try to use words that appear in the file's name, contents or tags.");
setFiles(new ArrayList());
update(true);
app.hideLoadingIndicator();
}
GSS.get().setCurrentSelection(getSelectedFiles());
//contextMenu.setFiles(getSelectedFiles());
- table.setWidget(i - 1, 0, contextMenu);
+ //table.setWidget(i - 1, 0, contextMenu);
}
}