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

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


  @Override
  public IInteractionElement getElement(IEditorInput editorInput) {
    if (editorInput != null && editorInput instanceof IFileEditorInput) {
      IResource resource = ((IFileEditorInput) editorInput).getFile();
      IModelElement modelElement = BeansModelUtils
          .getResourceModelElement(resource);
      String handle = ContextCore.getStructureBridge(
          modelElement).getHandleIdentifier(modelElement);
      return ContextCore.getContextManager().getElement(handle);
    }
View Full Code Here


  }

  @Override
  public void open(IInteractionElement element) {
    String handle = element.getHandleIdentifier();
    IModelElement modelElement = BeansCorePlugin.getModel().getElement(
        handle);
    if (modelElement != null
        && modelElement instanceof IResourceModelElement) {
      BeansUIUtils.openInEditor((IResourceModelElement) modelElement);
    }
View Full Code Here

        IFile resource = SpringUIUtils.getFile(document);
        if (document != null) {
          int startLine = document.getLineOfOffset(node
              .getStartOffset()) + 1;
          int endLine = document.getLineOfOffset(node.getEndOffset()) + 1;
          IModelElement mostspecificElement = BeansModelUtils
              .getMostSpecificModelElement(startLine, endLine,
                  resource, null);
          if (mostspecificElement != null
              && mostspecificElement instanceof IBeansModelElement) {
            return ((IBeansModelElement) mostspecificElement)
View Full Code Here

      List<Object> children = new ArrayList<Object>();
      for (Object element : elements) {
        if (element instanceof IAopReference
            && parentElement instanceof IBeansModelElement) {
          IAopReference reference = (IAopReference) element;
          IModelElement me = BeansCorePlugin.getModel().getElement(
              reference.getTargetBeanId());
          if (me != null) {
            Object child = BeansModelUtils.getChildForElement(
                (IModelElement) parentElement,
                (IModelElement) me);
            if (child instanceof IBeansConfig) {
              child = ((IBeansConfig) child).getElementResource();
            }
            else if (child == null && me instanceof IBean
                && me.equals(parentElement)) {
              child = reference;
            }
            if (child != null && !children.contains(child)) {
              children.add(child);
            }
View Full Code Here

      Object[] elements = result.getElements();
      List<IModelElement> projects = new ArrayList<IModelElement>();
      for (Object element : elements) {
        if (element instanceof IAopReference) {
          IAopReference reference = (IAopReference) element;
          IModelElement me = BeansCorePlugin.getModel().getElement(
              reference.getTargetBeanId());
          if (me != null) {
            IModelElement project = BeansModelUtils
                .getChildForElement(BeansCorePlugin.getModel(),
                    (IModelElement) me);
            if (!projects.contains(project)) {
              projects.add(project);
            }
View Full Code Here

*/
public class PointcutMatcherScope {

  private static void addToList(IAdaptable adaptable,
      List<IModelElement> elements, boolean isProjectsList) {
    IModelElement element = (IModelElement) adaptable
        .getAdapter(IModelElement.class);
    if (element == null) {
      IResource resource = (IResource) adaptable
          .getAdapter(IResource.class);
      if (resource instanceof IProject) {
View Full Code Here

        isProjectsSelection);
    String description;
    if (isProjectsSelection) {
      StringBuffer text = new StringBuffer();
      for (int i = 0; i < elements.length; i++) {
        IModelElement element = elements[i];
        text.append("'");
        text.append(element.getElementName());
        text.append("'");
        if (i < (elements.length - 1)) {
          text.append(", ");
        }
      }
View Full Code Here

  @Override
  public String toString() {
    StringBuffer text = new StringBuffer(description);
    text.append(" [");
    for (int i = 0; i < modelElements.length; i++) {
      IModelElement element = modelElements[i];
      text.append(element);
      if (i < (modelElements.length - 1)) {
        text.append(", ");
      }
    }
View Full Code Here

  }

  @Override
  public boolean canFilter(Object obj) {
    if (obj instanceof IModelElement) {
      IModelElement modelElement = (IModelElement) obj;

      // not necessary, context propagation will make all parent elements interesting
      // IModelElement[] children = modelElement.getElementChildren();
      // for (IModelElement child : children) {
      // IInteractionElement node = ContextCore.getContextManager().getElement(
View Full Code Here

      if (parentBridge != null && parentBridge instanceof ResourceStructureBridge) {
        return parentBridge.getHandleIdentifier(((ISpringProject) obj).getProject());
      }
    }
    else if (obj != null && obj instanceof IModelElement) {
      IModelElement parent = ((IModelElement) obj).getElementParent();
      if (parent != null) {
        return parent.getElementID();
      }
    }
    else {
      AbstractContextStructureBridge parentBridge = ContextCore.getStructureBridge(parentContentType);
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.