Examples of IBeansConfig


Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

  @Test
  public void testInnerClassJavaConfigAddedHandler() throws Exception {
    IType configClass = javaProject.findType("org.test.spring.OuterConfigurationClass$InnerConfigurationClass");
    beansProject.addConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + "org.test.spring.OuterConfigurationClass$InnerConfigurationClass", IBeansConfig.Type.MANUAL);
    IBeansConfig config = beansProject.getConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + "org.test.spring.OuterConfigurationClass$InnerConfigurationClass");
   
    ResourceChangeEventHandler handler = this.model.new ResourceChangeEventHandler();
    IResource resource = configClass.getResource();
    handler.configAdded((IFile)resource, IResourceChangeEvent.POST_BUILD, IBeansConfig.Type.MANUAL);
   
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

      IBeansModel beansModel = BeansCorePlugin.getModel();
      if (beansModel == null) {
        return 0;
      }

      IBeansConfig beansConfig = beansModel.getConfig((IFile) marker.getResource(), false);
      String beanName = beanElement.getAttribute("id");
      IBean bean = BeansModelUtils.getBean(beanName, beansConfig);
      if (bean != null && bean.getConstructorArguments() != null) {
        return bean.getConstructorArguments().size();
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

    } else if (receiver instanceof IBean && "isInfrstructureBean".equals(property)) {
      boolean isInfrstructureBean = ((IBean) receiver).isInfrastructure();
      return expectedValue == null ? isInfrstructureBean : isInfrstructureBean == ((Boolean) expectedValue)
          .booleanValue();
    } else if (receiver instanceof IBeansConfig && "canAddToConfigSet".equals(property)) {
       IBeansConfig config = (IBeansConfig) receiver;
       boolean canAddToConfigSet = hasAvailableConfigSet(config);
       return expectedValue == null ? canAddToConfigSet : canAddToConfigSet == ((Boolean) expectedValue);
    } else if (receiver instanceof IBeansConfigSet && "isEmptyConfigSet".equals(property)) {
      IBeansConfigSet configSet = (IBeansConfigSet) receiver;
      boolean isEmpty = configSet.getConfigs().isEmpty();
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

          }
        }
      }
    }
    else if (BeansCoreUtils.isBeansConfig(resource, true)) {
      IBeansConfig bc = BeansCorePlugin.getModel().getConfig((IFile) resource, true);
      // Resources are loaded by isBeansConfig from the top; so the resourceChanged check here is not sufficient
      if (bc.resourceChanged()) {
        if (bc instanceof IImportedBeansConfig) {
          propagateToConfigsFromConfigSet(BeansModelUtils.getParentOfClass(bc, IBeansConfig.class), false);
        }
        else {
          propagateToConfigsFromConfigSet(bc, false);
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

   
    Set<IBeansConfig> beans = BeansModelUtils.getConfigsByContainingTypes(resource, typeEngine, null);
    assertEquals(1, beans.size());
   
    Iterator<IBeansConfig> iterator = beans.iterator();
    IBeansConfig config = iterator.next();
    assertEquals(beansProject.getConfig("basic-bean-config.xml"), config);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

   
    Set<IBeansConfig> beans = BeansModelUtils.getConfigsByContainingTypes(resource, typeEngine, null);
    assertEquals(1, beans.size());
   
    Iterator<IBeansConfig> iterator = beans.iterator();
    IBeansConfig config = iterator.next();
    assertEquals(beansProject.getConfig("basic-bean-config.xml"), config);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

   
    Set<IBeansConfig> beans = BeansModelUtils.getConfigsByContainingTypes(resource, typeEngine, null);
    assertEquals(1, beans.size());
   
    Iterator<IBeansConfig> iterator = beans.iterator();
    IBeansConfig config = iterator.next();
    assertEquals(beansProject.getConfig("basic-bean-config.xml"), config);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

   
    Set<IBeansConfig> beans = BeansModelUtils.getConfigsByContainingTypes(resource, typeEngine, null);
    assertEquals(2, beans.size());
   
    Iterator<IBeansConfig> iterator = beans.iterator();
    IBeansConfig config1 = iterator.next();
    IBeansConfig config2 = iterator.next();

    IBeansConfig realConfig1 = beansProject.getConfig("basic-bean-config.xml");
    IBeansConfig realConfig2 = beansProject.getConfig("basic-bean-config-2.xml");
   
    assertTrue(realConfig1 == config1 || realConfig1 == config2);
    assertTrue(realConfig2 == config1 || realConfig2 == config2);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

      IFile file = BeansEditorUtils.getFile(document);
      String className = BeansEditorUtils.getClassNameForBean(file, node.getOwnerDocument(), parentNode);
      if (file != null && file.exists()) {
        IType type = JdtUtils.getJavaType(file.getProject(), className);
        if (type != null) {
          IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
          if (config != null && parentNode instanceof Element) {
            IModelElement element = BeansModelUtils.getModelElement((Element) parentNode, config);
            int argIndex = getArgumentIndex(node);
            if (argIndex >= 0) {
              if (element instanceof IBean) {
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

      Set<IBeansConfig> configs = BeansCorePlugin.getModel().getConfigs((IFile) resource, true);
      if (configs != null && configs.size() > 0) {
        for (IBeansConfig beansConfig : configs) {
          // Resolve imported config files to their root importing one
          if (beansConfig instanceof IImportedBeansConfig) {
            IBeansConfig importingConfig = BeansModelUtils.getParentOfClass(beansConfig, IBeansConfig.class);
            if (importingConfig != null) {
              resources.add(importingConfig.getElementResource());
              addBeans(importingConfig);
            }
          }
          else {
            resources.add(resource);
            addBeans(beansConfig);
          }
        }

        // Add resources that are in a config set with the changed resources
        propagateChangedResourceToConfigSets(resources);

      }
      else if (BeansResourceChangeListener.requiresRefresh((IFile) resource)) {
        propagateChangedResourceToProject(resource, resources);
      }
      else if (kind != IncrementalProjectBuilder.FULL_BUILD) {

        // Now check for bean classes and java structure
        TypeStructureState structureState = getProjectContributorState().get(TypeStructureState.class);
        BeansTypeHierachyState hierachyState = getProjectContributorState().get(BeansTypeHierachyState.class);

        if (structureState == null
            || structureState.hasStructuralChanges(resource, ITypeStructureCache.FLAG_ANNOTATION
                | ITypeStructureCache.FLAG_ANNOTATION_VALUE | ITypeStructureCache.FLAG_TAB_BITS)) {

          // Capture removal of java source files
          if (deltaKind == IResourceDelta.REMOVED
              && resource.getName().endsWith(JdtUtils.JAVA_FILE_EXTENSION)) {
            propagateChangedResourceToProject(resource, resources);
          }
          else {
            for (IBean bean : hierachyState.getBeansByContainingTypes(resource)) {
              IBeansConfig beansConfig = BeansModelUtils.getConfig(bean);
              // Resolve imported config files to their root importing one
              if (beansConfig instanceof IImportedBeansConfig) {
                IBeansConfig importingConfig = BeansModelUtils.getParentOfClass(beansConfig,
                    IBeansConfig.class);
                if (importingConfig != null) {
                  resources.add(importingConfig.getElementResource());
                  affectedBeans.add(bean.getElementID());
                }
              }
              else {
                resources.add(beansConfig.getElementResource());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.