/** * Set the selection of this action to the given selection * * @param selection the selection */ public void selectionChanged(ISelection selection) { if (selection instanceof IStructuredSelection) { super.selectionChanged((IStructuredSelection) selection); } else { super.selectionChanged(StructuredSelection.EMPTY); } }
/* (non-Javadoc) * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection) */ @Override protected boolean updateSelection(IStructuredSelection selection) { super.updateSelection(selection); return isEnabledForSelection(selection); }