Examples of IBeansConfig


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

      else {
        super.elementChanged(event);
      }
    }
    else if (element instanceof IBeansConfig) {
      IBeansConfig config = (IBeansConfig) element;

      // For a changed Spring beans config in the Eclipse Project Explorer
      // refresh all corresponding bean classes
      if (BeansUIPlugin.PROJECT_EXPLORER_CONTENT_PROVIDER_ID.equals(providerID)) {
        refreshBeanClasses(config);
      }

      // In order to refresh the meta data contributions we need refresh
      // the entire project
      refreshViewerForElement(config.getElementParent());
    }
    else {
      super.elementChanged(event);
    }
  }
View Full Code Here

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

      ISelectionService service = (ISelectionService) locator.getService(ISelectionService.class);
      ISelection selection = service.getSelection();
      if (selection instanceof StructuredSelection) {
        Object element = ((StructuredSelection) selection).getFirstElement();
        if (element instanceof IBeansConfig) {
          IBeansConfig config = (IBeansConfig) element;
          IBeansProject beansProject = BeansModelUtils.getProject(config);
          Set<IBeansConfigSet> configSets = beansProject.getConfigSets();
          for (IBeansConfigSet configSet : configSets) {
            if (!configSet.hasConfig(config.getElementName())) {
              IContributionItem contribution = new ActionContributionItem(
                  new AddToConfigSetDynamicAction(configSet, config));
              items.add(contribution);
            }
          }
View Full Code Here

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

    else if (element instanceof IModelElement) {
      return BeansModelLabels.getElementLabel((IModelElement) element, BeansUILabels.APPEND_PATH
          | BeansUILabels.DESCRIPTION);
    }
    if (element instanceof IFile) {
      IBeansConfig config = BeansCorePlugin.getModel().getConfig((IFile) element);
      if (config != null) {
        return BeansModelLabels.getElementLabel(config, BeansUILabels.APPEND_PATH | BeansUILabels.DESCRIPTION);
      }
    }
    else if (element instanceof ZipEntryStorage) {
View Full Code Here

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

        if (!beansProject.isUpdatable()) {
          return Status.CANCEL_STATUS;
        }
        // TODO CD add support for linked project and config sets
        if (resource.getProject().equals(project) && !beansConfigSet.hasConfig(file)) {
          IBeansConfig bc = BeansCorePlugin.getModel().getConfig((IFile) resource);
          // check if resource is already a beans config
          if (bc != null) {
            beansConfigSet.addConfig(bc.getElementName());
          }
          else {
            beansProject.addConfig(file, IBeansConfig.Type.MANUAL);
            bc = beansProject.getConfig(file);
            beansConfigSet.addConfig(bc.getElementName());
          }
          return saveProject(beansProject);
        }
      }
    }
View Full Code Here

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

  private boolean isBeansConfig(IFile file) {
    return BeansCorePlugin.getModel().getConfig(file) != null;
  }

  private boolean isBeansConfig(IType type) {
    IBeansConfig config = null;
    IProject project = type.getJavaProject().getProject();
    IBeansProject beansProject = BeansCorePlugin.getModel().getProject(project);
    if (beansProject != null) {
      config = beansProject.getConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + type.getFullyQualifiedName());
    }
View Full Code Here

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

    selectedItems = new HashSet<IBeansConfig>();
    Object selection = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
    if (selection instanceof StructuredSelection) {
      for (Object element : ((StructuredSelection) selection).toArray()) {
        if (element instanceof IType) {
          IBeansConfig config = getConfigFromType((IType) element);
          if (config != null) {
            selectedItems.add(config);
          }
        } else if (element instanceof IFile) {
          IBeansConfig config = getConfigFromFile((IFile) element);
          if (config != null) {
            selectedItems.add(config);
          }
        } else if (element instanceof IBeansConfig) {
          selectedItems.add((IBeansConfig) element);
View Full Code Here

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

  @Override
  public Set<IBeansConfig> getConfigs() {
    Set<IBeansConfig> configs = new LinkedHashSet<IBeansConfig>();
    for (String configName : configNames) {
      IBeansConfig config = PropertiesConfigFactory.create(this, configName, IBeansConfig.Type.MANUAL);
      if (config != null) {
        configs.add(config);
      }
    }
    return configs;
View Full Code Here

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

    }
    else if (element instanceof IModelElement) {
      return ((IModelElement) element).getElementChildren().length > 0;
    }
    else if (element instanceof IFile) {
      IBeansConfig config = BeansCorePlugin.getModel().getConfig((IFile) element);
      if (config != null) {
        // The single IBeansConfig node is available
        return true;
      }
    }
    else if (element instanceof ZipEntryStorage) {
      IBeansConfig config = BeansModelUtils.getConfig((ZipEntryStorage) element);
      if (config != null) {
        // The single IBeansConfig node is available
        return true;
      }
    }
View Full Code Here

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

        return ((IBeansConfig)parentElement).getComponents().toArray();
      }
      return ((IModelElement) parentElement).getElementChildren();
    }
    else if (parentElement instanceof IFile) {
      IBeansConfig config = BeansCorePlugin.getModel().getConfig((IFile) parentElement);
      if (config != null) {
        return config.getComponents().toArray();
      }
    }
    else if (parentElement instanceof ZipEntryStorage) {
      IResourceModelElement parent = (IResourceModelElement) ((ZipEntryStorage) parentElement)
          .getAdapter(IResourceModelElement.class);
View Full Code Here

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

      if (element instanceof IBeansConfig || element instanceof IBeansProject) {
        return ((IResourceModelElement) element).getElementResource();
      }
    }
    else if (element instanceof IFile) {
      IBeansConfig config = BeansCorePlugin.getModel().getConfig((IFile) element);
      if (config != null) {
        return config.getElementParent();
      }
    }
    else if (element instanceof ZipEntryStorage) {
      IBeansConfig config = BeansCorePlugin.getModel().getConfig(
          ((ZipEntryStorage) element).getFullName());
      if (config != null) {
        return config.getElementParent();
      }
    }
    else if (element instanceof BeanClassReferences) {
      return ((BeanClassReferences) element).getBeanClass();
    }
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.