package com.onaro.sanscreen.client.view.tabular; import com.onaro.sanscreen.client.view.GroupingDirector; /** * Default implementation, extracting the name from the toolbar */ public class ToolbarContextSubTitleGenerator implements GroupingSubTitleGenerator { /** * Returns the context from the toolbar as the sub title string * @param groupingDirector the generation is delegated to the the toolbar of the groupingDirector * @return sub title text */ public String generateSubTitle(GroupingDirector groupingDirector) { String toolbarContext = groupingDirector.getToolbar().getContextTitle(); return toolbarContext != null ? toolbarContext : groupingDirector.getDescription(); } }