final List<SapphireActionHandler> handlers = action.getActiveHandlers();
final int count = handlers.size();
if( count == 1 )
{
ActionSystemPartBridge bridge = this.cache.get( action );
if( bridge == null )
{
bridge = new ActionBridge( presentation, action );
}
updatedCache.put( action, bridge );
menuManager.add( bridge );
}
else if( count > 1 )
{
final String childMenuText = LabelTransformer.transform( action.getLabel(), CapitalizationType.TITLE_STYLE, true );
final ImageDescriptor childMenuImage = SwtUtil.toImageDescriptor( action.getImage( 16 ) );
final MenuManager childMenuManager = new MenuManager( childMenuText, childMenuImage, action.getId() );
childMenuManager.setParent( menuManager );
menuManager.add( childMenuManager );
for( SapphireActionHandler handler : action.getActiveHandlers() )
{
ActionSystemPartBridge bridge = this.cache.get( handler );
if( bridge == null )
{
bridge = new ActionHandlerBridge( presentation, handler );
}