if (!_addedPackageExplorerListener) { if (PackageExplorerPart.VIEW_ID.equals(partRef.getId())) { IWorkbenchPart part = partRef.getPart(true); if (part instanceof PackageExplorerPart) { PackageExplorerPart packageExplorerPart = (PackageExplorerPart) part; TreeViewer packageExplorerTreeViewer = packageExplorerPart.getTreeViewer(); if (packageExplorerTreeViewer != null) { packageExplorerTreeViewer.addDoubleClickListener(this); _addedPackageExplorerListener = true; } } } }
attachToPartIfNecessary(partRef);
	public void partVisible(IWorkbenchPartReference partRef) {		if (!_addedPackageExplorerListener) {			if (PackageExplorerPart.VIEW_ID.equals(partRef.getId())) {				IWorkbenchPart part = partRef.getPart(true);				if (part instanceof PackageExplorerPart) {					PackageExplorerPart packageExplorerPart = (PackageExplorerPart) part;					TreeViewer packageExplorerTreeViewer = packageExplorerPart.getTreeViewer();					if (packageExplorerTreeViewer != null) {						packageExplorerTreeViewer.addDoubleClickListener(this);						_addedPackageExplorerListener = true;					}				}			}		}	}