Bug 48501 Merge undo, redo, move and rename with Platform UI [refactoring]
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
update(selection);
		
		fLastElement= INIT;
	}
	public void dispose() {
		ISelectionProvider provider= fPart.getSite().getSelectionProvider();
		provider.removeSelectionChangedListener(this);
		super.dispose();
	}
	
	
	
	public void selectionChanged(SelectionChangedEvent event) {
		fRenameResourceAction.selectionChanged(event);
		fMoveResourceAction.selectionChanged(event);
		IStructuredSelection selection= (IStructuredSelection)event.getSelection();
		update(selection);
	}
	private void update(IStructuredSelection selection) {
		int size= selection.size();
		Object element= selection.getFirstElement();
		IActionBars actionBars= fPart.getViewSite().getActionBars();
		if (size == 1 && element instanceof IResource) {
			if (fLastElement != RESOURCE) {		
				actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), fRenameResourceAction);
				actionBars.setGlobalActionHandler(ActionFactory.MOVE.getId(), fMoveResourceAction);
				actionBars.updateActionBars();
				fLastElement= RESOURCE;
			}
		} else {