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

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


              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) {
                    IBean bean = (IBean) element;
                    int count = bean.getConstructorArguments().size();
                    if (count > 0) {
                      IMethod method = null;
                      Set<IMethod> methods = Introspector.getConstructors(type, count, false);
                      if (methods.size() == 1) {
                        IMethod[] array = methods.toArray(new IMethod[]{});
View Full Code Here


  }

  public void validate(IBeanProperty property, IBeansValidationContext context, IProgressMonitor monitor) {
    TypeHierarchyEngine typeEngine = getTypeHierarchyEngine(context);
   
    IBean bean = (IBean) property.getElementParent();
    BeanDefinition mergedBd = BeansModelUtils.getMergedBeanDefinition(bean, context.getContextElement());
    String mergedClassName = mergedBd.getBeanClassName();
    IType type = ValidationRuleUtils.extractBeanClass(mergedBd, bean, mergedClassName, context);

    // Before checking for properties check that type is not a groovy type; groovy can dynamically add getters and
View Full Code Here

    if (!foundLocal) {
      Set<IBean> beansList = BeansEditorUtils.getBeansFromConfigSets(file);
      Iterator<IBean> iterator = beansList.iterator();
      while (iterator.hasNext()) {
        IBean bean = iterator.next();
        if (id != null && id.equals(bean.getElementName())) {
          return BeansModelUtils.getBeanClass(bean, null);
        }
      }
    }
View Full Code Here

      }
      if (!foundLocal) {
        Set<IBean> beansList = BeansEditorUtils.getBeansFromConfigSets(file);
        Iterator<IBean> iterator = beansList.iterator();
        while (iterator.hasNext()) {
          IBean bean = iterator.next();
          if (parentId.equals(bean.getElementName())) {
            getClassNamesOfBeans(file, document, bean.getElementName(),
                BeansModelUtils.getBeanClass(bean, null), bean.getParentName(), classNames, beans);
            break;
          }
        }
      }
    }
View Full Code Here

    viewer.addFilter(filter);
    viewer.setComparator(new ViewerComparator() {

      @Override
      public int compare(Viewer viewer, Object e1, Object e2) {
        IBean t1 = getCorrespondingTask(e1);
        IBean t2 = getCorrespondingTask(e2);
        boolean isInHistory1 = historyList.contains(t1);
        boolean isInHistory2 = historyList.contains(t2);

        // Being on task history takes precedence...
        if (isInHistory1 && !isInHistory2) {
View Full Code Here

  protected void handleSelectionChanged() {
    validateCurrentSelection();
    if (!viewer.getSelection().isEmpty()) {
      ISelection sel = viewer.getSelection();
      if (sel instanceof IStructuredSelection) {
        IBean bean = (IBean) ((IStructuredSelection) sel).getFirstElement();
        fLabel.setImage(labelProvider.getImage(bean.getElementParent()));
        fLabel.setText(bean.getElementResource().getFullPath().toString().substring(1));
      }
    }
    else {
      fLabel.setImage(null);
      fLabel.setText(null);
View Full Code Here

    public boolean select(Viewer viewer, Object parentElement, Object element) {
      if (matcher == null) {
        return beanActivationHistory.contains(element);
      }
      if (element instanceof IBean) {
        IBean bean = (IBean) element;
        if (matcher.match(bean.getElementName())) {
          return true;
        }
        if (matcher.match(bean.getClassName())) {
          return true;
        }
        String[] aliases = bean.getAliases();
        if (aliases != null) {
          for (String alias : aliases) {
            if (matcher.match(alias)) {
              return true;
            }
          }
        }
        if (isUpperCasePattern) {
          if (SearchPattern.camelCaseMatch(filterText, StringUtils.capitalize(bean.getElementName()))) {
            return true;
          }
          String className = bean.getClassName();
          if (className != null) {
            int i = className.lastIndexOf('.');
            if (i > 0 && i < className.length()) {
              if (SearchPattern.camelCaseMatch(filterText, 0, filterText.length(), className, i + 1,
                  className.length())) {
View Full Code Here

    allowedRefs.put("testBean", new Integer[] { 70 });
    allowedRefs.put("testBean2", new Integer[] { 110 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertTrue(references.size() == 1);
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

    allowedRefs.put("xy", new Integer[] { 135, 153, 236 });
    allowedRefs.put("beanFactory", new Integer[] { 140 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertTrue(references.size() == 2);
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

    allowedRefs.put("xy", new Integer[] { 135, 153 });
    allowedRefs.put("beanFactory", new Integer[] { 140 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

   
    assertTrue(references.size() == 1);
    assertTrue(references.containsKey(bean));
View Full Code Here

TOP

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

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.