return deleteDiv;
}
/** Create a delete or restart control at the top of a table. It applies to whichever requests are checked in the table below. */
private HTMLNode createDeleteControl(PageMaker pageMaker, ToadletContext ctx, boolean isDownloadToTemp, boolean canRestart, boolean disableFilterChecked, boolean isUpload, String mimeType, boolean isCompleted) {
HTMLNode deleteDiv = new HTMLNode("div", "class", "request-delete");
if(isDownloadToTemp) {
deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "delete_request", l10n("deleteFilesFromTemp") });
} else {
deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_request", l10n("removeFilesFromList") });
if (isUpload && isCompleted) deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_finished_uploads_request", l10n("removeFinishedUploads") });
}
if(canRestart) {
deleteDiv.addChild("br");
// FIXME: Split stuff with a permanent redirect to a separate grouping and use QueueToadlet.follow here?
String restartName = NodeL10n.getBase().getString(/*followRedirect ? "QueueToadlet.follow" : */ isUpload ? "QueueToadlet.restartUploads" : "QueueToadlet.restartDownloads");
deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "restart_request", restartName });
if(mimeType != null) {
HTMLNode input = deleteDiv.addChild("input", new String[] { "type", "name", "value" }, new String[] {"checkbox", "disableFilterData", "disableFilterData" });
if(disableFilterChecked) {
input.addAttribute("checked", "checked");
}
deleteDiv.addChild("#", l10n("disableFilter", "type", mimeType));
}
}
return deleteDiv;