MultiStatus status= new MultiStatus(JavaUI.ID_PLUGIN, IStatus.OK, ActionMessages.OpenAction_multistatus_message, null);  for (int i= 0; i < elements.length; i++) { Object element= elements[i]; try { element= getElementToOpen(element); boolean activateOnOpen= fEditor != null ? true : OpenStrategy.activateOnOpen(); IEditorPart part= EditorUtility.openInEditor(element, activateOnOpen); if (part != null && element instanceof IJavaElement) JavaUI.revealInEditor(part, (IJavaElement)element); } catch (CoreException e) { String message= Messages.format(ActionMessages.OpenAction_error_problem_opening_editor, new String[] { new JavaUILabelProvider().getText(element), e.getStatus().getMessage() }); status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.ERROR, message, null)); JavaPlugin.log(e);
try { IJavaElement[] elements= SelectionConverter.codeResolveForked(fEditor, false); if (elements == null || elements.length == 0) { IEditorStatusLine statusLine= (IEditorStatusLine) fEditor.getAdapter(IEditorStatusLine.class); if (statusLine != null) statusLine.setMessage(true, ActionMessages.OpenAction_error_messageBadSelection, null); getShell().getDisplay().beep(); return;
	public void run(Object[] elements) {		if (elements == null)			return;				MultiStatus status= new MultiStatus(JavaUI.ID_PLUGIN, IStatus.OK, ActionMessages.OpenAction_multistatus_message, null);				for (int i= 0; i < elements.length; i++) {			Object element= elements[i];			try {				element= getElementToOpen(element);				boolean activateOnOpen= fEditor != null ? true : OpenStrategy.activateOnOpen();				IEditorPart part= EditorUtility.openInEditor(element, activateOnOpen);				if (part != null && element instanceof IJavaElement)					JavaUI.revealInEditor(part, (IJavaElement)element);				} catch (CoreException e) {				String message= Messages.format(ActionMessages.OpenAction_error_problem_opening_editor, new String[] { new JavaUILabelProvider().getText(element), e.getStatus().getMessage() });				status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.ERROR, message, null));				JavaPlugin.log(e);			}		}		if (!status.isOK()) {			IStatus[] children= status.getChildren();			ErrorDialog.openError(getShell(), getDialogTitle(), ActionMessages.OpenAction_erro_message, children.length == 1 ? children[0] : status);		}	}