this.delegate = createDefaultTabPanel(interactionUnit, eventBus);
}
}
private TabPanelContract createEditorPanel(final InteractionUnit interactionUnit, final EventBus eventBus) {
final DefaultTabLayoutPanel tabLayoutpanel = new DefaultTabLayoutPanel(40, Style.Unit.PX);
tabLayoutpanel.addStyleName("default-tabpanel");
/* tabLayoutpanel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
@Override
public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
QName targetTab = index2tab.get(event.getItem());
if(targetTab!=null)
{
eventBus.fireEventFromSource(
new NavigationEvent(
NavigationEvent.ID,
targetTab
), interactionUnit.getId() //source
);
}
event.cancel();
}
}); */
TabPanelContract tabPanelContract = new TabPanelContract() {
@Override
public void add(InteractionUnit unit, Widget widget) {
final VerticalPanel vpanel = new VerticalPanel();
vpanel.setStyleName("rhs-content-panel");
vpanel.add(widget);
ScrollPanel scroll = new ScrollPanel(vpanel);
tabLayoutpanel.add(scroll, unit.getLabel());
// register tab2index mapping
index2tab.put(tabLayoutpanel.getWidgetCount() - 1, unit.getId());
}
@Override
public Widget as() {
return tabLayoutpanel;