@Inject public OverviewWidgetViewImpl( final BusyIndicatorView busyIndicatorView, final DiscussionWidgetPresenter discussionArea, final VersionHistoryPresenter versionHistory) { this.metadata = new MetadataWidget(busyIndicatorView); this.discussionArea = discussionArea; this.versionHistory = versionHistory; versionHistory.setOnCurrentVersionRefreshed( new ParameterizedCommand<VersionRecord>() { @Override public void execute(VersionRecord record) { metadata.setNote(record.comment()); setLastModified(record.author(), record.date()); } }); initWidget(uiBinder.createAndBindUi(this)); final TabPane versionHistoryPane = new TabPane() { { add(versionHistory); } }; final TabPane metadataPane = new TabPane() { { add(metadata); } }; tabContent.add(versionHistoryPane); tabContent.add(metadataPane); navTabs.add( new TabListItem(MetadataConstants.INSTANCE.VersionHistory()) { { addStyleName("uf-dropdown-tab-list-item"); setDataTargetWidget(versionHistoryPane); setActive(true); } }); navTabs.add( new TabListItem(MetadataConstants.INSTANCE.Metadata()) { { addStyleName("uf-dropdown-tab-list-item"); setDataTargetWidget(metadataPane); } }); navTabs.getElement().setAttribute("data-uf-lock", "false"); showVersionHistory(); }
@Override public void showVersionHistory() { ((TabListItem) navTabs.getWidget(VERSION_HISTORY_TAB)).setActive(true); }