Package org.springframework.ide.eclipse.beans.core.model

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


    }
  }

  private void addChangesForUpdatedReferences(RenameIdType descriptor, CompositeChange compositeChange, IProgressMonitor pm)
      throws CoreException {
    IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
    if (config != null) {
      Set<IBeansConfig> visitedResources = new HashSet<IBeansConfig>();
      visitedResources.add(config);
     
      // rename id in imported configs
      for (IBeansImport import_ : config.getImports()) {
        for (IBeansConfig bc : import_.getImportedBeansConfigs()) {
          addChangesForUpdateReferences(bc, descriptor,
              compositeChange, visitedResources, pm);
        }
      }
     
      // rename id in configs that import this one
      IBeansConfig importingBeansConfig = BeansModelUtils.getImportingBeansConfig(config);
      if (importingBeansConfig != null) {
        addChangesForUpdateReferences(importingBeansConfig, descriptor, compositeChange,
            visitedResources, pm);
      }
     
View Full Code Here


    int offset = getOffset(valueRegion, beanNode);
    int length = getLength(valueRegion, false);

    BeansProject beanProject = (BeansProject) BeansCorePlugin.getModel().getProject(project);
    IBeansConfigSet configSet = beanProject.getConfigSet("AddToConfigSetTest");
    IBeansConfig config = beanProject.getConfig(file);

    assertFalse("Expects config file to not be in config set", configSet.getConfigs().contains(config));

    AddToConfigSetQuickFixProposal proposal = new AddToConfigSetQuickFixProposal(offset, length, false, file,
        configSet, beanProject);
View Full Code Here

        foundError |= hasError((IDOMNode) childNodes.item(i), attrName, checkChildren);
      }
      return foundError;
    }

    IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
    Set<IResourceModelElement> contextElements = getContextElements(config);
    for (IResourceModelElement contextElement : contextElements) {
      if (namespaceValidator.validateAttributeWithConfig(config, contextElement, attr, node, reporter, true,
          validator)) {
        return true;
View Full Code Here

    int offset = getOffset(valueRegion, beanNode);
    int length = getLength(valueRegion, false);

    IFile configFile = (IFile) project.findMember(importFilePath);
    IBeansConfig config = BeansCorePlugin.getModel().getConfig(configFile);
    IBean importBean = BeansModelUtils.getBean(parentAttr.getValue(), config);

    IBeansProject beanProject = BeansCorePlugin.getModel().getProject(project);

    CreateImportQuickFixProposal proposal = new CreateImportQuickFixProposal(offset, length, false, importBean,
View Full Code Here

  private boolean hasMethodError(String beanName, BeanValidator beanValidator) {
    NodeList children = beansNode.getChildNodes();
    IDOMNode beanNode = QuickfixTestUtil.getNode(BeansSchemaConstants.ELEM_BEAN, beanName, children);
    AttrImpl attr = (AttrImpl) beanNode.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_FACTORY_METHOD);

    IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
    Set<IResourceModelElement> contextElements = getContextElements(config);
    for (IResourceModelElement contextElement : contextElements) {
      if (beanValidator.validateAttributeWithConfig(config, contextElement, attr, beanNode, reporter, true,
          validator)) {
        return true;
View Full Code Here

    AttrImpl classAttr = (AttrImpl) node.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_CLASS);

    String className = classAttr.getNodeValue();

    IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
    Set<IResourceModelElement> contextElements = getContextElements(config);
    for (IResourceModelElement contextElement : contextElements) {
      if (classAttrValidator.validateAttributeWithConfig(config, contextElement, file, classAttr, node, reporter,
          true, validator, className)) {
        return true;
View Full Code Here

    // BeansProject beansProject = createBeansProject();
    beansProject.addConfig(xmlFile, IBeansConfig.Type.MANUAL);
    project.waitForAutoBuild();

    IBeansConfig beansConfig = beansProject.getConfig(xmlFile);
    assertNotNull("No sample config in model", beansConfig);

    // there's an apparent bug whereby the validation
    // of the xml file isn't done when the file is added
    // to the list of config files, but only after the
View Full Code Here

        }
      }

    }
    else if (BeansCoreUtils.isBeansConfig(resource, true)) {
      IBeansConfig beansConfig = (IBeansConfig) BeansModelUtils.getResourceModelElement(resource);
      if (beansConfig instanceof IImportedBeansConfig) {
        beansConfig = BeansModelUtils.getParentOfClass(beansConfig, IBeansConfig.class);
      }
      configs.add(beansConfig);
     
View Full Code Here

  public static Set<IResource> getAffectedFilesFromBeansConfig(Set<IResource> files) {
    Set<IResource> newResources = new LinkedHashSet<IResource>();
    for (IResource resource : files) {
      // add confis from config set
      IBeansProject project = BeansCorePlugin.getModel().getProject(resource.getProject());
      IBeansConfig beansConfig = project.getConfig((IFile) resource);
      if (project != null) {
        Set<IBeansConfigSet> configSets = project.getConfigSets();
        for (IBeansConfigSet configSet : configSets) {
          if (configSet.getConfigs().contains(beansConfig)) {
            Set<IBeansConfig> bcs = configSet.getConfigs();
View Full Code Here

        if (includeImports && Display.getCurrent() != null && project instanceof ILazyInitializedModelElement
            && !((ILazyInitializedModelElement) project).isInitialized()) {
          // skip: it's too expensive to load the model on the UI thread
          includeImports = false;
        }
        IBeansConfig bc = project.getConfig(configFile, includeImports);
        if (bc != null) {
          return bc;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.model.IBeansConfig

Copyright © 2018 www.massapicom. 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.