final String testName = getTestName();
if(testName==null)
return;
final GalleryUtil galleryUtil = GalleryUtil.getDefaultInstance();
final Test test = galleryUtil.getTestByName(testName);
//new GalleryUtil(null);
final Button button1 = getYUIBinder().getWidget(buttonEl).cast();
final Button acceptButton = getYUIBinder().getWidget(acceptButtonEl).cast();
final Panel panel1 = getYUIBinder().getWidget(panel1El).cast();
button1.on("click", new EventCallback<EventFacade>() {
@Override
public void call(EventFacade e) {
//cannot work directly in panel1.getStdModNode("body") because we cannot call asHTMLPanel() if the node is already inside a GWT Widget.
// test.test(panel1.getStdModNode("body"));
Node p = y.one("body").appendChild("<div></div>");
// p.generateID();
test.test(p);
panel1.setStdModContent("body", p);
// panel1.render();
panel1.show();
}
});
acceptButton.on("click", new EventCallback<EventFacade>() {
@Override
public void call(EventFacade e) {
panel1.hide();
}
});
Node parent = y.one(tabviewEl);//getElement()).appendChild("");
final List<String> headers = new LinkedList<String>();
final List<String> bodies = new LinkedList<String>();
for(final String resName : test.getTestResources().keySet()) {
ResourcePrototype res = test.getTestResources().get(resName);
galleryUtil.getText(res, new ResourceCallback<TextResource>() {
@Override
public void onSuccess(TextResource resource) {
String scapedContent = y.Escape().html(resource.getText().replace("\t", " "));