/******************************************************************************* * Copyright (c) 2008, 2014 Spring IDE Developers * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Spring IDE Developers - initial API and implementation *******************************************************************************/ package org.springframework.ide.eclipse.beans.core.internal.model.validation; import java.util.List; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResourceDelta; import org.springframework.ide.eclipse.core.internal.model.validation.ValidatorDefinition; import org.springframework.ide.eclipse.core.java.typehierarchy.TypeHierarchyEngine; import org.springframework.ide.eclipse.core.project.IProjectContributionEventListener; import org.springframework.ide.eclipse.core.project.IProjectContributorState; import org.springframework.ide.eclipse.core.project.ProjectBuilderDefinition; import org.springframework.ide.eclipse.core.project.ProjectContributionEventListenerAdapter; /** * {@link IProjectContributionEventListener} implementation that prepares and registers a {@link BeansTypeHierachyState}to make complex class -> bean dependency calculations accessible for subsequent requests. * * @author Christian Dupuis * @since 2.2.0 */ public class BeansTypeHierachyProjectContributionEventListener extends ProjectContributionEventListenerAdapter { /** * Register an instance of {@link BeansTypeHierachyState} with the given <code>state</code> instance. */ @Override public void start(int kind, IResourceDelta delta, List<ProjectBuilderDefinition> builderDefinitions, List<ValidatorDefinition> validatorDefinitions, IProjectContributorState state, IProject project) { // System.out.println("new beans type hierarchy state created"); TypeHierarchyEngine typeEngine = state.get(TypeHierarchyEngine.class); state.hold(new BeansTypeHierachyState(typeEngine)); } }