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

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


    if (element instanceof BeanMetadataNode) {
      return ((BeanMetadataNode) element).getImage();
    }
    else if (element instanceof ISourceModelElement) {
      INamespaceLabelProvider provider = NamespaceUtils.getLabelProvider((ISourceModelElement) element);
      IModelElement context = (parentElement instanceof IModelElement ? (IModelElement) parentElement : null);
      if (provider != null) {
        image = provider.getImage((ISourceModelElement) element, context, isDecorating());
      }
      else {
        image = DEFAULT_NAMESPACE_LABEL_PROVIDER.getImage((ISourceModelElement) element, context,
View Full Code Here


    if (element instanceof BeanMetadataNode) {
      return ((BeanMetadataNode) element).getLabel();
    }
    else if (element instanceof ISourceModelElement) {
      INamespaceLabelProvider provider = NamespaceUtils.getLabelProvider((ISourceModelElement) element);
      IModelElement context = (parentElement instanceof IModelElement ? (IModelElement) parentElement : null);
      if (provider != null) {
        return provider.getText((ISourceModelElement) element, context, isDecorating());
      }
      else {
        return DEFAULT_NAMESPACE_LABEL_PROVIDER.getText((ISourceModelElement) element, context, isDecorating());
View Full Code Here

     }
    return null;
  }

  public void elementChanged(ModelChangeEvent event) {
    IModelElement element = event.getElement();

    // For events of type ADDED or REMOVED refresh the parent of the changed
    // model element
    if (event.getType() == Type.CHANGED) {
      refreshViewerForElement(element);
    }
    else {
      refreshViewerForElement(element.getElementParent());
    }
  }
View Full Code Here

    private IResourceModelElement getResourceModelElementFromNode(Node n) {
      if (n instanceof IDOMNode) {
        IDOMNode domNode = ((IDOMNode) n);
        int startLine = domNode.getStructuredDocument().getLineOfOffset(domNode.getStartOffset()) + 1;
        int endLine = domNode.getStructuredDocument().getLineOfOffset(domNode.getStartOffset()) + 1;
        IModelElement modelElement = BeansModelUtils.getMostSpecificModelElement(startLine, endLine,
            (IFile) beansConfig.getElementResource(), null);
        if (modelElement instanceof IResourceModelElement) {
          return (IResourceModelElement) modelElement;
        }
      }
View Full Code Here

   * Returns a corresponding instance of <code>IPropertySource</code> for
   * the given model element ID or null.
   * @param id the model element ID
   */
  public static IPropertySource getPropertySource(String id) {
    IModelElement element = BeansCorePlugin.getModel().getElement(id);
    return (element != null ? getPropertySource(element) : null);
  }
View Full Code Here

    Set<IModelElement> configs = new HashSet<IModelElement>();
    try {
      r.lock();
      if (beansConfigs != null) {
        for (String configName : this.beansConfigs) {
          IModelElement config = model.getElement(configName);
          if (config != null) {
            configs.add(config);
          }
        }
View Full Code Here

    IResource resource = getResourceFromDropTarget(dropTargetEvent);

    // handle drag'n drop from resource
    if (SpringCoreUtils.isSpringProject(resource) && resource instanceof IFile) {
      IFile file = (IFile) resource;
      IModelElement parent = getWebflowModelElementFromTarget(resource, target);
      // handle resource drop to project or IWorkspaceRoot
      if (parent instanceof WebflowProject) {
        WebflowProject webflowProject = (WebflowProject) parent;
        // check if target project is actually the parent of resource
        IProject project = getProject(parent);
View Full Code Here

      return rootElement;
    }

    public void init(IResource resource) {
      ICompilationUnit cu = getCompilationUnit(resource);
      IModelElement parent = new SpringProject(SpringCore.getModel(),
          resource.getProject());
      String name = resource.getName();
      rootElement = new CompilationUnit(cu, parent, name);
    }
View Full Code Here

                  .getStructuredDocument().getLineOfOffset(node.getStartOffset()) + 1;
              endLine = ((IDOMDocument) node.getOwnerDocument())
                  .getStructuredDocument().getLineOfOffset(node.getEndOffset()) + 1;
            }

            IModelElement mostspecificElement = BeansModelUtils
                .getMostSpecificModelElement(startLine, endLine, file, null);
            if (mostspecificElement != null) {
              super.handleElementSelection(part, mostspecificElement,
                  contributeToContext);
            }
View Full Code Here

            IEditorInput editorInput = editor.getEditorInput();
            if (editorInput != null
                && editorInput instanceof IFileEditorInput) {
              IResource resource = ((IFileEditorInput) editorInput)
                  .getFile();
              IModelElement modelElement = BeansModelUtils
                  .getResourceModelElement(resource);
              if (modelElement != null
                  && element.getHandleIdentifier().equals(
                      modelElement.getElementID())) {
                editor.dispose();
              }
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.core.model.IModelElement

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.