Examples of IBeansConfig


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

    assertEquals("basic-bean-config.xml", config.getElementName());
  }
 
  @Test
  public void testCreateBeansJavaConfig() throws Exception {
    IBeansConfig config = BeansConfigFactory.create(beansProject, "java:org.test.spring.SimpleConfigurationClass", IBeansConfig.Type.MANUAL);
    assertTrue(config instanceof BeansJavaConfig);
    assertEquals("java:org.test.spring.SimpleConfigurationClass", config.getElementName());
   
    IType type = javaProject.findType("org.test.spring.SimpleConfigurationClass");
    assertEquals(type, ((BeansJavaConfig)config).getConfigClass());
  }
View Full Code Here

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

    assertEquals(type, ((BeansJavaConfig)config).getConfigClass());
  }
 
  @Test
  public void testCreateBeansJavaConfigTypeError() throws Exception {
    IBeansConfig config = BeansConfigFactory.create(beansProject, "java:org.test.spring.SimpleConfigurationClassError", IBeansConfig.Type.MANUAL);
    assertTrue(config instanceof BeansJavaConfig);
    assertNull(((BeansJavaConfig)config).getConfigClass());
    assertEquals("org.test.spring.SimpleConfigurationClassError", ((BeansJavaConfig)config).getConfigClassName());
  }
View Full Code Here

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

   * @return <code>IBean</code> or <code>null</code> if bean not found
   * @throws IllegalArgumentException if unsupported context specified
   */
  public static IBean getBean(String name, IModelElement context) {
    if (context instanceof IBeansConfig) {
      IBeansConfig config = (IBeansConfig) context;
      IBean bean = config.getBean(name);
      if (bean == null) {
        IBeanAlias alias = config.getAlias(name);
        if (alias != null) {
          bean = config.getBean(alias.getBeanName());
        }
      }
      if (bean == null) {
        for (IBeansComponent component : config.getComponents()) {
          bean = getBean(name, component);
          if (bean != null) {
            return bean;
          }
        }
View Full Code Here

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

          }
        }
      }
    }
    else if (element instanceof ISourceModelElement) {
      IBeansConfig bc = getConfig(element);
      for (IBeansProject beansProject : BeansCorePlugin.getModel().getProjects()) {
        Set<IBeansConfigSet> css = beansProject.getConfigSets();
        for (IBeansConfigSet cs : css) {
          if (cs.getConfigs().contains(bc)) {
            configSets.add(cs);
View Full Code Here

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

      if (monitor == null) {
        monitor = new NullProgressMonitor();
      }

      IBeansConfig beansConfig = BeansCorePlugin.getModel().getConfig(resource, true);
      ModelElementDetermingModelVisitor v = new ModelElementDetermingModelVisitor(startLine, endLine, resource);
      beansConfig.accept(v, monitor);
      return v.getElement();
    }
    return null;
  }
View Full Code Here

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

    IModelElement context = BeansCorePlugin.getModel().getElement(contextId);

    // Prepare name and tooltip for given element and context
    if (element instanceof IBeansConfig) {
      String toolTipPrefix = BeansGraphPlugin.getResourceString("ShowGraphAction.name.config");
      IBeansConfig config = (IBeansConfig) element;
      IResource resource = config.getElementResource();
      if (resource != null) {
        if (config.isElementArchived()) {
          ZipEntryStorage storage = new ZipEntryStorage(config);
          name = storage.getName();
          toolTip = toolTipPrefix + storage.getFile().getProjectRelativePath().toString() + " - "
              + storage.getFullPath().toString();
        }
View Full Code Here

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

            .getDocument(), context.getParentNode());
        if (file != null && file.exists()) {
          IType type = JdtUtils.getJavaType(file.getProject(), className);
          if (type != null) {
            try {
              IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
              if (config != null && context.getParentNode() instanceof Element) {
                IModelElement element = BeansModelUtils.getModelElement((Element) context.getParentNode(), config);
                int argIndex = getArgumentIndex(context.getNode());
                if (argIndex >= 0) {
                  if (element instanceof IBean) {
View Full Code Here

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

    if (file != null && file.exists()) {
      IBeansProject project = BeansCorePlugin.getModel().getProject(file.getProject());
      Set<IBeansConfig> allConfigs = BeansCorePlugin.getModel().getConfigs(file, true);
      for (IBeansConfig config : allConfigs) {
        if (config instanceof IImportedBeansConfig) {
          IBeansConfig rootBeansConfig = BeansModelUtils.getParentOfClass(config, IBeansConfig.class);
          configs.add(rootBeansConfig);
        }
      }

      if (project != null) {
        Set<IBeansConfigSet> configSets = project.getConfigSets();

        for (IBeansConfigSet configSet : configSets) {
          if (configSet.hasConfig(file) || !BeansCoreUtils.isBeansConfig(file)) {
            Set<IBeansConfig> bcs = configSet.getConfigs();
            configs.addAll(bcs);
          }
          Set<IBeansConfig> tempConfigs = new HashSet<IBeansConfig>(configs);
          for (IBeansConfig config : tempConfigs) {
            if (configSet.hasConfig(config.getElementName())) {
              Set<IBeansConfig> bcs = configSet.getConfigs();
              configs.addAll(bcs);
            }
          }
        }
      }
     
      if (BeansCoreUtils.isBeansConfig(file, true)) {
        IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
        if (config instanceof IImportedBeansConfig) {
          configs.add(BeansModelUtils.getParentOfClass(config, IBeansConfig.class));
        }
        else {
          configs.add(config);
View Full Code Here

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

        for (IAdaptable adaptable : elements) {
          if (element.equals(adaptable)) {
            return true;
          }
          else if (adaptable instanceof IFile) {
            IBeansConfig bc = BeansCorePlugin.getModel().getConfig(
                (IFile) adaptable);
            if (element.equals(bc)) {
              return true;
            }
          }
View Full Code Here

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

      if (project instanceof ILazyInitializedModelElement
          && !((ILazyInitializedModelElement) project).isInitialized()) {
        return StructuredSelection.EMPTY;
      }

      IBeansConfig config = BeansCorePlugin.getModel().getConfig(file);
      if (config != null) {
        IEditorPart editor = SpringUIUtils.getActiveEditor();
        if (editor.getEditorInput() == input && editor.getSite() != null
            && editor.getSite().getSelectionProvider() != null) {
          ISelection selection = editor.getSite().getSelectionProvider().getSelection();
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.