} else if (selectedProj != null) {  boolean justOpened = currentProj.isOpen() && !isOpen; if(justOpened) { notifyChangeListeners(); } isOpen = currentProj.isOpen();
	public synchronized void selectionChanged(IWorkbenchPart action, ISelection selection) {		IResource res;		IProject selectedProj;		IPreferenceStore store = AspectJUIPlugin.getDefault().getPreferenceStore();		if (!triedToOpenXRefView) { // only try this once			String workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();			if (!store.getBoolean(AspectJPreferences.DONE_AUTO_OPEN_XREF_VIEW + workspaceLocation)			        && !store.getBoolean(workspaceLocation)) {		        // open xref view in perspective if we haven't opened the xref view before.				Job job = new UIJob(UIMessages.AJDTPrefConfigWizardPage_workbench_openXRefView) {					public IStatus runInUIThread(IProgressMonitor monitor) {						try {			                AspectJUIPlugin.getDefault().getActiveWorkbenchWindow()								.getActivePage().showView(XReferenceView.ID);			                return Status.OK_STATUS;				        } catch (PartInitException e) {				            AspectJUIPlugin.getDefault().getErrorHandler().handleError(UIMessages.AJDTPrefConfigWizardPage_ErrorOpeningXRefView, e);				            return Status.OK_STATUS;				        }					}				};			    job.schedule();		        store.setValue(AspectJPreferences.DONE_AUTO_OPEN_XREF_VIEW + workspaceLocation, true);		    }			triedToOpenXRefView = true;					}		if (action instanceof IEditorPart) {			res = (IResource) ((IEditorPart) action).getEditorInput()					.getAdapter(IResource.class);			if (res != null) {				selectedProj = res.getProject();			} else {				selectedProj = null;			}		} else {			selectedProj = getProjectFromSelection(selection);		}		if ((selectedProj != currentProj) && (selectedProj != null)) {			fileList = null;			currentProj = selectedProj;			if (canManage(currentProj)){								PropertyPageManager.unregisterJDTPropertyPage();			} else {				if (currentProj.isOpen())					PropertyPageManager.registerJDTPropertyPage();			}			notifyChangeListeners();		}	}