setBodyBorder(false);
addListener(Events.Adopt, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
if(getParent() != null && getParent() instanceof TabItem) {
TabItem t = (TabItem) getParent();
t.setHideMode(entry.getHideMode());
}
}
});
TabItem demo = new TabItem();
demo.setScrollMode(Scroll.AUTO);
if (entry.isFill()) {
demo.setLayout(new FitLayout());
demo.setScrollMode(Scroll.NONE);
}
demo.setHideMode(entry.getHideMode());
demo.setText("Demo");
demo.add(entry.getExample());
add(demo);
if (entry.isClosable()) {
TabItem source = new TabItem();
source.setText("Source");
source.setUrl(entry.getSourceUrl());
add(source);
}
}