menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); IAction addAction = new AddSelectedLibToCurrentReportDesignAction( treeViewer ); if ( addAction.isEnabled( ) )
ISelectionProvider struViewer = (ISelectionProvider) getViewer( ); IStructuredSelection selection = (IStructuredSelection) struViewer.getSelection( ); LibraryHandle library = getSelectedLibrary( ); if ( selection == null || selection.getFirstElement( ) == null )
	public void buildContextMenu( IMenuManager menu )	{		TreeViewer treeViewer = (TreeViewer) getViewer( );		if ( Policy.TRACING_MENU_SHOW )		{			System.out.println( "Menu(for Views) >> Shows for library" ); //$NON-NLS-1$		}		menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );		IAction addAction = new AddSelectedLibToCurrentReportDesignAction( treeViewer );		if ( addAction.isEnabled( ) )		{			menu.add( addAction );		}		IAction refreshAction = new RefreshLibExplorerAction( treeViewer );		if ( refreshAction.isEnabled( ) )		{			menu.add( refreshAction );		}		IAction addLibraryAction = new AddLibraryAction( );		menu.add( addLibraryAction );				IAction removeLibraryAction = new RemoveLibraryAction( treeViewer );		if ( removeLibraryAction.isEnabled( ) )		{			menu.add( removeLibraryAction );		}	}