return getHead(true);
}
private CharSequence getHead(boolean rebind) {
// load the css template we created form the res package
PackagedTextTemplate template = new PackagedTextTemplate(
DnDSortableBehavior.class,
DnDSortableBehavior.class.getSimpleName() + (rebind ? "-rebind.tmpl" : "-head.tmpl")
);
// create a variable subsitution map
CharSequence itemSelector = "." + options_.get("accept");
CharSequence handleSelector = (CharSequence) options_.get("handle");
if (handleSelector == null) {
//only for CSS
handleSelector = itemSelector;
}
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("containerSelector", "." + getContainerCSSClass());
params.put("helperclass", options_.get("helperclass", "").toString());
params.put("handleSelector", handleSelector);
params.put("itemSelector", itemSelector);
params.put("options", options_.toString(true));
params.put("callbackUrl", getCallbackUrl());
params.put("dndHandlerStart", getJSFunctionName4Start());
params.put("dndHandlerStop", getJSFunctionName4Stop());
// params.put("startOnLoad", options_.get("startOnLoad", "true").toString());
// perform subsitution and return the result
return template.asString(params);
}