private void run(IJavaElement element) { if (element == null) return; boolean showMembers= JavaPlugin.getDefault().getPreferenceStore().getBoolean(JavaBasePreferencePage.SHOW_CU_CHILDREN); PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { Object selectedElement= element; if (showMembers) { view.selectReveal(new StructuredSelection(element)); selectedElement= ((IStructuredSelection)view.getSite().getSelectionProvider().getSelection()).getFirstElement(); } if (selectedElement != element) { element= getVisibleParent(element); if (element != null) { view.selectReveal(new StructuredSelection(element)); } } return; }
protected void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (element != null) run(element); } catch (JavaModelException e) { JavaPlugin.log(e); String message= ActionMessages.getString("ShowInPackageViewAction.error.message"); ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus()); }
	private void run(IJavaElement element) {		if (element == null)			return;		boolean showMembers= JavaPlugin.getDefault().getPreferenceStore().getBoolean(JavaBasePreferencePage.SHOW_CU_CHILDREN);		PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();		if (view != null) {			Object selectedElement= element;			if (showMembers) {				view.selectReveal(new StructuredSelection(element));				selectedElement= ((IStructuredSelection)view.getSite().getSelectionProvider().getSelection()).getFirstElement();			}			if (selectedElement != element) {				element= getVisibleParent(element);				if (element != null) {					view.selectReveal(new StructuredSelection(element));				}			}			return;		}	}