if (!(selection instanceof IStructuredSelection)) return false; IStructuredSelection ss = (IStructuredSelection)selection; if(ss.size() != 1) return false; currentSelection = getLogEntry(ss); return true;
return selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1;
    private Action getContextMenuAction(String title, final IWorkspaceRunnable action) {            return new Action(title) {            public void run() {                try {                    if (resource == null) return;                    ISelection selection = getSelection();                    if (!(selection instanceof IStructuredSelection)) return;                    IStructuredSelection ss = (IStructuredSelection)selection;                    currentSelection = getLogEntry(ss);                    PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {                        public void run(IProgressMonitor monitor) throws InvocationTargetException {                            try {                                               action.run(monitor);                            } catch (CoreException e) {                                throw new InvocationTargetException(e);                            }                        }                    });                } catch (InvocationTargetException e) {                    SVNUIPlugin.openError(getViewSite().getShell(), null, null, e, SVNUIPlugin.LOG_NONTEAM_EXCEPTIONS);                } catch (InterruptedException e) {                    // Do nothing                }            }                        // we don't allow multiple selection            public boolean isEnabled() {                ISelection selection = getSelection();                if (!(selection instanceof IStructuredSelection)) return false;                IStructuredSelection ss = (IStructuredSelection)selection;                if(ss.size() != 1) return false;                currentSelection = getLogEntry(ss);                return true;            }        };    }