Object selectedPart = lst.get( 0 ); if ( selectedPart instanceof DrawerEditPart && ( (DrawerEditPart) selectedPart ).canBePinned( ) ) { menu.appendToGroup( GEFActionConstants.MB_ADDITIONS, new PinDrawerAction( (DrawerEditPart) selectedPart ) ); }
					public void buildContextMenu( IMenuManager menu )					{						GEFActionConstants.addStandardActionGroups( menu );						List lst = getPaletteViewer( ).getSelectedEditParts( );						if ( lst.size( ) == 0 )						{							return;						}						Object selectedPart = lst.get( 0 );						if ( selectedPart instanceof DrawerEditPart								&& ( (DrawerEditPart) selectedPart ).canBePinned( ) )						{							menu.appendToGroup( GEFActionConstants.MB_ADDITIONS,									new PinDrawerAction( (DrawerEditPart) selectedPart ) );						}						menu.appendToGroup( GEFActionConstants.GROUP_VIEW,								new LayoutAction( getPaletteViewer( ).getPaletteViewerPreferences( ) ) );						if ( getPaletteViewer( ).getCustomizer( ) != null )						{							menu.appendToGroup( GEFActionConstants.GROUP_REST,									new CustomizeAction( getPaletteViewer( ) ) );						}						final PaletteViewer paletteViewer = getPaletteViewer( );						menu.appendToGroup( GEFActionConstants.GROUP_REST,								new SettingsAction( paletteViewer ) {									public void run( )									{										final PaletteViewerPreferences prefs = paletteViewer.getPaletteViewerPreferences( );										Dialog settings = new PaletteSettingsDialog( paletteViewer.getControl( )												.getShell( ),												prefs ) {											protected Control createLayoutSettings(													Composite parent )											{												Composite composite = new Composite( parent,														SWT.NONE );												composite.setFont( parent.getFont( ) );												GridLayout layout = new GridLayout( 1,														false );												composite.setLayout( layout );												Control layoutOptions = createLayoutOptions( composite );												GridData data = new GridData( GridData.VERTICAL_ALIGN_BEGINNING );												layoutOptions.setLayoutData( data );												handleLayoutSettingChanged( prefs.getLayoutSetting( ) );												return composite;											}											protected void handleLayoutSettingChanged(													int newSetting )											{												prefs.setLayoutSetting( newSetting );											}										};										settings.open( );									}								} );					}