Examples of IModelSourceLocation


Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

    for (IBeanProperty property : properties) {
      propertyValues.add(property.getElementName(), property.getValue());
    }
    beanDefinition.setPropertyValues(propertyValues);

    setElementSourceLocation(new IModelSourceLocation() {

      public int getEndLine() {
        // TODO Auto-generated method stub
        return 0;
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

      }
      else {
        name.append("!!!invalid name!!!");
      }
    }
    IModelSourceLocation location = ModelUtils.getSourceLocation(definition);
    if (location != null) {
      name.append(BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR);
      name.append(config.getElementParent().getElementName());
      name.append(BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR);

      // Make sure file name actually comes from the correct resource and always from the
      // passed config. Important in case of imported beans configs.
      name.append(generateFilename(config, location));

      name.append(BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR);
      name.append(location.getStartLine());
    }

    return name.toString();
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

  }
 
  private URI getLocation(IResourceModelElement element) {
    if (element instanceof AbstractSourceModelElement) {
      AbstractSourceModelElement sourceElement = (AbstractSourceModelElement) element;
      IModelSourceLocation sourceLocation = sourceElement.getElementSourceLocation();
      if (sourceLocation instanceof XmlSourceLocation) {
        XmlSourceLocation xmlSourceLocation = (XmlSourceLocation) sourceLocation;
        Resource resource = xmlSourceLocation.getResource();
        try {
          File file = resource.getFile();
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

    super(parentBean, new PropertyValue(getElementName(propNode), getElementValue(propNode)));
    this.parentBean = parentBean;
    this.file = file;
    this.propNode = propNode;

    setElementSourceLocation(new IModelSourceLocation() {

      public int getEndLine() {
        // TODO Auto-generated method stub
        return 0;
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

    }
    if (javaElement != null) {
      SpringUIUtils.openInEditor(javaElement);
    }
    if (element instanceof IModelSourceLocation) {
      IModelSourceLocation location = (IModelSourceLocation) element;
      SpringUIUtils.openInEditor(((FileResource) ((IModelSourceLocation) element).getResource()).getRawFile(), location.getStartLine(), true);
    }
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

   */
  public int getElementStartLine() {
    // Lazily initialization of this config
    readConfig();

    IModelSourceLocation location = ModelUtils.getSourceLocation(defaults);
    return (location != null ? location.getStartLine() : -1);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

    setImageDescriptor(MetadataUIImages.DESC_OBJS_JAVA_FILE);
  }

  @Override
  public void run() {
    IModelSourceLocation sourceLocation = null;
    IStructuredSelection selection = getStructuredSelection();
    Object obj = selection.getFirstElement();

    if (obj instanceof RequestMappingAnnotationMetadata) {
      RequestMappingAnnotationMetadata annotation = (RequestMappingAnnotationMetadata) obj;
      sourceLocation = annotation.getElementSourceLocation();
    } else if (obj instanceof RequestMappingMethodToClassMap) {
      RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) obj)
          .getMethodMetadata();
      sourceLocation = annotation.getElementSourceLocation();
    }

    if (sourceLocation != null) {
      SpringUIUtils.openInEditor(((FileResource) sourceLocation
          .getResource()).getRawFile(),
          sourceLocation.getStartLine(), true);
    }
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

  /**
   * Returns the namespace URI for the given {@link BeanMetadataElement} or
   * <code>"http://www.springframework.org/schema/beans"</code> if no namespace URI found.
   */
  public static String getNameSpaceURI(BeanMetadataElement element) {
    IModelSourceLocation location = ModelUtils.getSourceLocation(element);
    if (location instanceof XmlSourceLocation) {
      String namespaceURI = ((XmlSourceLocation) location).getNamespaceURI();
      if (namespaceURI != null) {
        return namespaceURI;
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.IModelSourceLocation

    // Validate bean class and constructor arguments - skip child beans and
    // class names with placeholders
    if (className != null && !SpringCoreUtils.hasPlaceHolder(className) && !ignorableClasses.contains(className)) {
      IType type = JdtUtils.getJavaType(BeansModelUtils.getProject(bean).getProject(), className);
      try {
        IModelSourceLocation sourceLocation = bean.getElementSourceLocation();
        if (type != null) {
          if (!bean.isAbstract() && !(sourceLocation instanceof JavaModelSourceLocation)) {
            if (type.isInterface()) {
              context.warning(bean, "CLASS_NOT_CLASS", "Class '" + className + "' is an interface",
                  new ValidationProblemAttribute("CLASS", className),
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.