Package at.bestsolution.efxclipse.tooling.fxgraph.fXGraph

Examples of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.Element


      eo = model.eContainer()
    } else {
      eo = model;
    }
   
    Element target = null;
    Element propertyTarget = (Element) (eo instanceof Element ? eo : null);
   
    while( eo.eContainer() != null ) {
      if( eo.eContainer() instanceof Element ) {
        target = (Element) eo.eContainer();
        break;
View Full Code Here


    } else {
      staticProperty = (StaticValueProperty) model;
    }
   
    EObject eo = staticProperty.eContainer();
    Element target = null;
   
    while( eo.eContainer() != null ) {
      if( eo.eContainer() instanceof Element ) {
        target = (Element) eo.eContainer();
        break;
      }
      eo = eo.eContainer();
    }
       
    if( target == null ) {
      return;
    }
   
    try {
      IJavaProject javaProject = projectProvider.getJavaProject(staticProperty.eResource().getResourceSet());
      IType type = javaProject.findType(target.getType().getQualifiedName());
     
      if (type != null) {
        IFXClass fxClazz = FXPlugin.getClassmodel().findClass(javaProject, type);
        if (fxClazz != null) {
          IFXProperty fxProp = fxClazz.getStaticProperty(staticProperty.getName());
View Full Code Here

  }
 
  @Override
  public IInformationControlCreatorProvider getHoverInfo(EObject object, ITextViewer viewer, IRegion region) {
    if( object instanceof Element ) {
      Element e = (Element) object;
      if( e.getType() != null ) {
        IType t = getJDTType(e.getType().getType());
        if( t != null ) {
          return createHover(t, object, viewer, region);
        }
      }
    } else if( object instanceof Property ) {
      Property p = (Property) object;
      if( p.eContainer() instanceof Element ) {
        Element e = (Element) p.eContainer();
        if( e.getType() != null ) {
          IType t = getJDTType(e.getType().getType());
          if( t != null ) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
            if( fxClass != null ) {
              IFXProperty fxp = fxClass.getProperty(p.getName());
              if( fxp != null ) {
                return createHover(fxp.getJavaElement(), object, viewer, region);
              }
            }
          }
        }
      }
    } else if( object instanceof StaticCallValueProperty ) {
      StaticCallValueProperty sp = (StaticCallValueProperty) object;
      if( sp.getType() != null ) {
        IType t = getJDTType(sp.getType().getType());
        if( t != null ) {
          IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
          if( fxClass != null ) {
            IFXProperty fxp = fxClass.getStaticProperty(sp.getName());
            if( fxp != null ) {
              return createHover(fxp.getJavaElement(), object, viewer, region);
            }
          }
        }
      }
    } else if( object instanceof StaticValueProperty ) {
      StaticValueProperty sp = (StaticValueProperty) object;
     
      EObject eo = sp.eContainer();
      Element target = null;
     
      while( eo.eContainer() != null ) {
        if( eo.eContainer() instanceof Element ) {
          target = (Element) eo.eContainer();
          break;
        }
        eo = eo.eContainer();
      }
         
      if( target != null ) {
        if( target.getType() != null ) {
          IType t = getJDTType(target.getType().getType());
          if( t != null ) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
            if( fxClass != null ) {
              IFXProperty fxp = fxClass.getStaticProperty(sp.getName());
              if( fxp != null ) {
                return createHover(fxp.getJavaElement(), object, viewer, region);
              }
            }
          }
        }
      }
    } else if( object instanceof ValueProperty ) {
      if( object instanceof ControllerHandledValueProperty ) {
        ControllerHandledValueProperty cp = (ControllerHandledValueProperty) object;
       
        Model m = (Model) object.eResource().getContents().get(0);
       
        if( m != null ) {
          ComponentDefinition def = m.getComponentDef();
          if( def != null ) {
            if( def.getController() != null && def.getController().getType() != null) {
              IType t = getJDTType(def.getController().getType());
              if( t != null ) {
                IFXCtrlClass fxClass = FXPlugin.getClassmodel().findCtrlClass(t.getJavaProject(), t);
                if( fxClass != null ) {
                  IFXCtrlEventMethod fxp = fxClass.getAllEventMethods().get(cp.getMethodname());
                  if( fxp != null ) {
                    return createHover(fxp.getJavaElement(), object, viewer, region);
                  }
                }
              }
            }
          }
        }
      } else if( object instanceof SimpleValueProperty ) {
        SimpleValueProperty sp = (SimpleValueProperty) object;
        if( sp.eContainer() instanceof Property && sp.getStringValue() != null ) {
          Property p = (Property) sp.eContainer();
         
          if( p.eContainer() instanceof Element ) {
            Element e = (Element) p.eContainer();
            if( e.getType() != null ) {
              IType t = getJDTType(e.getType().getType());
              if( t != null ) {
                IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
                if( fxClass != null ) {
                  IFXProperty fxp = fxClass.getProperty(p.getName());
                  if( fxp instanceof IFXEnumProperty ) {
View Full Code Here

  }

  @Override
  public void completeElement_DefaultChildren(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    try {
      Element el = (Element) model;

      // Happens when we are in the default section and user typed
      // something
      if ("void".equals(el.getType().getQualifiedName())) {
        if (!(model.eContainer() instanceof Element)) {
          return;
        }

        el = (Element) model.eContainer();
      }

      IJavaProject javaProject = projectProvider.getJavaProject(el.eResource().getResourceSet());
      IType type = javaProject.findType(el.getType().getQualifiedName());

      if (type != null) {
        IFXClass fxClazz = FXPlugin.getClassmodel().findClass(javaProject, type);
        if (fxClazz != null) {
          IFXProperty prop = fxClazz.getDefaultProperty();
View Full Code Here

  }

  @Override
  public void completeElement_Properties(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    try {
      Element el = (Element) model;
      // Happens when we are in the default section and user typed
      // something
      if ("void".equals(el.getType().getQualifiedName())) {
        if (!(model.eContainer() instanceof Element)) {
          return;
        }

        el = (Element) model.eContainer();
      }

      Element propertyTarget = el;
      {
        IJavaProject javaProject = projectProvider.getJavaProject(el.eResource().getResourceSet());
        IType type = javaProject.findType(el.getType().getQualifiedName());
        if (type != null) {
          IFXClass fxClazz = FXPlugin.getClassmodel().findClass(javaProject, type);
View Full Code Here

    } else {
      return;
    }
   
    if (prop.eContainer() instanceof Element) {
      Element el = (Element) prop.eContainer();

      try {
        IJavaProject javaProject = projectProvider.getJavaProject(el.eResource().getResourceSet());
        IType type = javaProject.findType(el.getType().getQualifiedName());

        if (type != null) {
          IFXClass fxClazz = FXPlugin.getClassmodel().findClass(javaProject, type);
          IFXProperty fxProp = fxClazz.getProperty(prop.getName());
          if (fxProp != null) {
View Full Code Here

  public void completeBindValueProperty_ElementReference(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    TreeIterator<EObject> it = model.eResource().getAllContents();
    while (it.hasNext()) {
      EObject o = it.next();
      if (o instanceof Element) {
        Element e = (Element) o;
        if (e.getName() != null && e.getName().trim().length() > 0) {
          StyledString s = new StyledString(e.getName());
          s.append(" - " + e.getType().getQualifiedName(), StyledString.DECORATIONS_STYLER);
          acceptor.accept(createCompletionProposal(e.getName(), s, IconKeys.getIcon(IconKeys.CLASS_KEY), context));
        }
      }
    }
  }
View Full Code Here

  @Override
  public void completeBindValueProperty_Attribute(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    BindValueProperty b = (BindValueProperty) model;
    if (b.getElementReference() != null && b.getElementReference().getType() != null) {
      Property property = (Property) b.eContainer();
      Element targetClass = (Element) property.eContainer();
      Element element = b.getElementReference();
     
      try {
        IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
        IType sourceType = javaProject.findType(element.getType().getQualifiedName());
        IType targetType = javaProject.findType(targetClass.getType().getQualifiedName());
       
        IFXClass fxSourceClazz = FXPlugin.getClassmodel().findClass(javaProject, sourceType);
        IFXClass fxTargetClass = FXPlugin.getClassmodel().findClass(javaProject, targetType);
        IFXProperty targetProperty = fxTargetClass.getProperty(property.getName());
View Full Code Here

    if( listProp != null ) {
      if( listProp.eContainer() instanceof Property ) {
        Property property = (Property) listProp.eContainer();
        if( property.eContainer() instanceof Element ) {
          try {
            Element element = (Element) property.eContainer();
            IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
            IType ownerType = javaProject.findType(element.getType().getQualifiedName());
            IFXClass fxOwnerClazz = FXPlugin.getClassmodel().findClass(javaProject, ownerType);
            IFXProperty ownerProperty = fxOwnerClazz.getProperty(property.getName());
           
            if (ownerProperty instanceof IFXCollectionProperty) {
              IFXCollectionProperty cp = (IFXCollectionProperty) ownerProperty;
View Full Code Here

        if( m.getComponentDef().getController() != null ) {
          if( model.eContainer() instanceof Property ) {
            Property property = (Property) model.eContainer();
            if( property.eContainer() instanceof Element ) {
              try {
                Element element = (Element) property.eContainer();
                IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
                IType ownerType = javaProject.findType(element.getType().getQualifiedName());
                IFXClass fxOwnerClazz = FXPlugin.getClassmodel().findClass(javaProject, ownerType);
                IFXProperty ownerProperty = fxOwnerClazz.getProperty(property.getName());
               
                if( ownerProperty instanceof IFXEventHandlerProperty ) {
                  IFXEventHandlerProperty p = (IFXEventHandlerProperty) ownerProperty;
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.Element

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.