/** * Computes the input for this view based on the given elements * * @param part the part that triggered the current element update, or <code>null</code> * @param selection the new selection, or <code>null</code> * @param element the new java element that will be displayed, or <code>null</code> * @param monitor a progress monitor * @return the input or <code>null</code> if the input was not computed successfully * @since 3.4 */ protected Object computeInput(IWorkbenchPart part, ISelection selection, IJavaElement element, IProgressMonitor monitor) { return computeInput(element); }
/** * Computes the input for this view based on the given elements * * @param part the part that triggered the current element update, or <code>null</code> * @param selection the new selection, or <code>null</code> * @param element the new java element that will be displayed, or <code>null</code> * @param monitor a progress monitor * @return the input or <code>null</code> if the input was not computed successfully * @since 3.4 */ protected Object computeInput(IWorkbenchPart part, ISelection selection, IJavaElement element, IProgressMonitor monitor) { return computeInput(element); }
public void run() { if (currentCount != fComputeCount) return; final IJavaElement je= findSelectedJavaElement(part, selection); if (isIgnoringNewInput(je, part, selection)) return; // The actual computation final Object input= computeInput(je); if (input == null) return; Shell shell= getSite().getShell(); if (shell.isDisposed()) return; Display display= shell.getDisplay(); if (display.isDisposed()) return; display.asyncExec(new Runnable() { /* * @see java.lang.Runnable#run() */ public void run() { if (fComputeCount != currentCount || getViewSite().getShell().isDisposed()) return; fCurrentViewInput= je; doSetInput(input); } }); } };
final Object input= computeInput(part, selection, je, computeProgressMonitor); if (input == null && !resetIfInvalid && fCurrentViewInput != null) { IJavaElement oldElement= fCurrentViewInput; Object oldInput= computeInput(null, null, oldElement, computeProgressMonitor); if (oldInput != null) {
final Object input= computeInput(part, selection, je, computeProgressMonitor); if (input == null && !resetIfInvalid && fCurrentViewInput != null) { IJavaElement oldElement= fCurrentViewInput; Object oldInput= computeInput(null, null, oldElement, computeProgressMonitor); if (oldInput != null) {