Package at.bestsolution.efxclipse.tooling.model

Examples of at.bestsolution.efxclipse.tooling.model.IFXClass


       
        if( fxCtrl == null ) {
          continue;
        }
       
        IFXClass e = computeTagNameHelp(node);

        if (e != null) {
          NamedNodeMap nnm = node.getAttributes();
          Map<String, IFXProperty> props = e.getAllProperties();
          for (int j = 0; j < nnm.getLength(); j++) {
            Node attribute = nnm.item(j);
            if (attribute.getNodeName().equals("fx:id")) {
              IFXCtrlField f = fxCtrl.getAllFields().get(attribute.getNodeValue());
              IType type = e.getType();
             
              if( f != null ) {
               
              } else {
                String fielname = attribute.getNodeValue();
View Full Code Here


        return;
      }

      IType type = findType(typeName, contentAssistRequest, context);
      if (type != null) {
        IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
       
        if( fxClass.getValueOf() != null ) {
          FXMLCompletionProposal cp = createAttributeProposal(contentAssistRequest, context, "fx:value=\"\"", new StyledString("fx:valueOf").append(" - " + fxClass.getSimpleName(), StyledString.QUALIFIER_STYLER), IconKeys.getIcon(IconKeys.FIELD_KEY), DEFAULT_PRIORITY+10, MATCHER);
          if (cp != null) {
            cp.setAdditionalProposalInfo(EcoreFactory.eINSTANCE.createEClass());
            cp.setHover(new HoverImpl(fxClass.getValueOf()));

            contentAssistRequest.addProposal(cp);
          }
        }
       
        for (IFXProperty property : fxClass.getAllProperties().values()) {
          if( ! existingAttributes.contains(property.getName()) ) {
            createAttributeNameProposal(contentAssistRequest, context, property)
          }
        }

        if (parent.getParentNode() != null) {
          Node n = null;
         
          if (Character.isUpperCase(parent.getParentNode().getNodeName().charAt(0)) || "fx:root".equals(parent.getParentNode().getNodeName())) {
            n = parent.getParentNode();
          } else if (parent.getParentNode().getParentNode() != null) {
            if (Character.isUpperCase(parent.getParentNode().getParentNode().getNodeName().charAt(0)) || "fx:root".equals(parent.getParentNode().getParentNode().getNodeName())) {
              n = parent.getParentNode().getParentNode();
            }
          }
         
          if (n != null) {
            IType containerType;
            if( "fx:root".equals(n.getNodeName()) ) {
              containerType = Util.findType(n.getAttributes().getNamedItem("type").getNodeValue(), parent.getOwnerDocument());
            } else {
              containerType = Util.findType(n.getNodeName(), parent.getOwnerDocument())
            }
           
            if (containerType != null) {
              IFXClass fxclass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), containerType);
              if (fxclass != null) {
                for (IFXProperty property : fxclass.getAllStaticProperties().values()) {
                  if( ! existingAttributes.contains(property.getFXClass().getSimpleName() + "." +property.getName()) ) {
                    createAttributeNameProposal(contentAssistRequest, context, property)
                  }
                }
              }
View Full Code Here

    if (parent.getNodeType() == Node.ELEMENT_NODE) {
      if (parent.getNodeName().contains(".")) {
        String[] parts = parent.getNodeName().split("\\.");
        IType ownerType = Util.findType(parts[0], parent.getOwnerDocument());
        if (ownerType != null) {
          IFXClass fxClass = FXPlugin.getClassmodel().findClass(ownerType.getJavaProject(), ownerType);
          if (fxClass != null) {
            IFXProperty p = fxClass.getStaticProperty(parts[1]);
            if (p != null) {
              if (p instanceof IFXObjectProperty) {
                IFXObjectProperty op = (IFXObjectProperty) p;
                createSubtypeProposals(contentAssistRequest, context, op.getElementType());
              } else if (p instanceof IFXCollectionProperty) {
                IFXCollectionProperty cp = (IFXCollectionProperty) p;
                createSubtypeProposals(contentAssistRequest, context, cp.getElementType());
              }
            }
          }
        }
      } else if (Character.isUpperCase(parent.getNodeName().charAt(0)) || "fx:root".equals(parent.getNodeName())) {
        if (!contentAssistRequest.getMatchString().isEmpty() && Character.isUpperCase(contentAssistRequest.getMatchString().charAt(0))) {
          // TODO This means we are static?
          // IJavaProject jproject =
          // findProject(contentAssistRequest);
          // try {
          // IType superType =
          // jproject.findType("javafx.scene.Parent");
          // if( superType != null ) {
          // createSubtypeProposals(contentAssistRequest, context,
          // superType);
          // }
          // } catch (JavaModelException e) {
          // // TODO Auto-generated catch block
          // e.printStackTrace();
          // }
        } else {
         
          if (parent.getParentNode() != null) {
            Node n = null;
           
            if( "fx:root".equals(parent.getNodeName()) ) {
              n = parent;
            } else if (Character.isUpperCase(parent.getParentNode().getNodeName().charAt(0)) || "fx:root".equals(parent.getParentNode().getNodeName())) {
              n = parent.getParentNode();
            } else if (parent.getParentNode().getParentNode() != null) {
              if (Character.isUpperCase(parent.getParentNode().getParentNode().getNodeName().charAt(0)) || "fx:root".equals(parent.getParentNode().getParentNode().getNodeName())) {
                n = parent.getParentNode().getParentNode();
              }
            }

            if (n != null) {
              IType type;
              if( "fx:root".equals(n.getNodeName()) ) {
                type = Util.findType(n.getAttributes().getNamedItem("type").getNodeValue(), parent.getOwnerDocument());
              } else {
                type = Util.findType(n.getNodeName(), parent.getOwnerDocument())
              }
             
              if (type != null) {
                IFXClass fxclass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
                if (fxclass != null) {
                  for (IFXProperty p : fxclass.getAllStaticProperties().values()) {
                    String proposalValue = fxclass.getSimpleName() + "." + p.getName() + ">" + "</" + fxclass.getSimpleName() + "." + p.getName() + ">";
                    String sType;

                    if (p instanceof IFXPrimitiveProperty) {
                      IFXPrimitiveProperty pp = (IFXPrimitiveProperty) p;
                      sType = pp.getType() == Type.STRING ? "String" : pp.getType().jvmType();
                    } else if (p instanceof IFXObjectProperty) {
                      IFXObjectProperty op = (IFXObjectProperty) p;
                      sType = op.getElementTypeAsString(false);
                    } else if (p instanceof IFXEnumProperty) {
                      IFXEnumProperty ep = (IFXEnumProperty) p;
                      sType = ep.getEnumTypeAsString(false);
                    } else {
                      sType = "<unknown>";
                    }

                    FXMLCompletionProposal cp = createElementProposal(contentAssistRequest, context, proposalValue,
                        new StyledString().append("(static) ", StyledString.COUNTER_STYLER).append(p.getFXClass().getSimpleName() + "." + p.getName()).append(" - " + sType, StyledString.QUALIFIER_STYLER), true, PRIORITY_LOWER_1, null, STATIC_ELEMENT_MATCHER);
                    if (cp != null) {
                      cp.setAdditionalProposalInfo(EcoreFactory.eINSTANCE.createEClass());
                      cp.setHover(new HoverImpl(p.getJavaElement()));
                      contentAssistRequest.addProposal(cp);
                    }
                  }
                }
              }
            }
          }
          IType type;
         
          if( "fx:root".equals(parent.getNodeName()) ) {
            type = Util.findType(parent.getAttributes().getNamedItem("type").getNodeValue(), parent.getOwnerDocument());
          } else {
            type = Util.findType(parent.getNodeName(), parent.getOwnerDocument())
          }

          if (type != null) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
            if (fxClass != null) {
              for (IFXProperty property : fxClass.getAllProperties().values()) {
                createPropertyElementNameProposal(contentAssistRequest, context, property);
              }
            }
          }
        }

        IType type;
       
        if( "fx:root".equals(parent.getNodeName()) ) {
          type = Util.findType(parent.getAttributes().getNamedItem("type").getNodeValue(), parent.getOwnerDocument());
        } else {
          type = Util.findType(parent.getNodeName(), parent.getOwnerDocument())
        }
       
        if (type != null) {
          IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
          if (fxClass != null) {
            IFXProperty p = fxClass.getDefaultProperty();
            if (p instanceof IFXObjectProperty) {
              createSubtypeProposals(contentAssistRequest, context, ((IFXObjectProperty) p).getElementType());
            } else if (p instanceof IFXCollectionProperty) {
              createSubtypeProposals(contentAssistRequest, context, ((IFXCollectionProperty) p).getElementType());
            }
View Full Code Here

    } else {
      type = findType(elementType.getNodeName(), contentAssistRequest, context);
    }
   
    if (type != null) {
      IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
      if (fxClass != null) {
        IFXProperty p = fxClass.getProperty(propertyType.getNodeName());
        if (p instanceof IFXObjectProperty) {
          IFXObjectProperty op = (IFXObjectProperty) p;
          createSubtypeProposals(contentAssistRequest, context, op.getElementType());
        } else if (p instanceof IFXCollectionProperty) {
          IFXCollectionProperty cp = (IFXCollectionProperty) p;
View Full Code Here

        } else if (attribute.getNodeName().contains(".")) {
          String[] parts = attribute.getNodeName().split("\\.");

          IType type = findType(parts[0], contentAssistRequest, context);
          if (type != null) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
            if (fxClass != null) {
              IFXProperty p = fxClass.getStaticProperty(parts[1]);
              if (p instanceof IFXPrimitiveProperty) {
                createAttributeValuePrimitiveProposals(contentAssistRequest, context, (IFXPrimitiveProperty) p);
              } else if (p instanceof IFXEnumProperty) {
                createAttributeValueEnumProposals(contentAssistRequest, context, (IFXEnumProperty) p);
              } else if (p instanceof IFXObjectProperty) {
                createAttributeValueObjectProposals(contentAssistRequest, context, (IFXObjectProperty) p);
              }
            }
          }
        } else {
          IType type = findType(n.getNodeName(), contentAssistRequest, context);
          if (type != null) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(type.getJavaProject(), type);
            if (fxClass != null) {
              IFXProperty p = fxClass.getProperty(attribute.getNodeName());
              if (p instanceof IFXPrimitiveProperty) {
                createAttributeValuePrimitiveProposals(contentAssistRequest, context, (IFXPrimitiveProperty) p);
              } else if (p instanceof IFXEnumProperty) {
                createAttributeValueEnumProposals(contentAssistRequest, context, (IFXEnumProperty) p);
              } else if (p instanceof IFXObjectProperty) {
View Full Code Here

      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();
          if (prop != null) {
            completeElement_DefaultChildrenProposals(prop, el, context, FXGraphPackage.Literals.ELEMENT__DEFAULT_CHILDREN, acceptor);
          }
        }
      }
View Full Code Here

      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);

          if (fxClazz != null) {
            Map<String, IFXProperty> map = fxClazz.getAllProperties();
            for (IFXProperty p : map.values()) {
//              // The id-attribute is defined through the id keyword
//              if (!"id".equals(p.getName())) {
                completeElement_PropertiesProposals(p, el, context, FXGraphPackage.Literals.ELEMENT__PROPERTIES, acceptor, propertyTarget, FXGraphPackage.Literals.ELEMENT__PROPERTIES);
//              }
            }
          }
        }       
      }
     
     
      EObject o = el;
      el = null;
     
      while( o.eContainer() != null ) {
        if( o.eContainer() instanceof Element ) {
          el = (Element) o.eContainer();
          break;
        }
        if( o.eContainer() instanceof MapValueProperty ) {
          el = null;
          break;
        }
        o = o.eContainer();
      }
     
      if( el instanceof Element) {
        el = (Element) 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);

          if (fxClazz != null) {
            Map<String, IFXProperty> map = fxClazz.getAllStaticProperties();
            for (IFXProperty p : map.values()) {
              completeElement_PropertiesProposals(p, el, context, FXGraphPackage.Literals.ELEMENT__STATIC_PROPERTIES, acceptor, propertyTarget, FXGraphPackage.Literals.ELEMENT__STATIC_PROPERTIES);
            }
          }
        }
View Full Code Here

      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) {
            completeProperty_ValueProposals(fxProp, model, context, FXGraphPackage.Literals.PROPERTY__VALUE, acceptor);
          }
        }
View Full Code Here

      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());
       
        if( targetProperty instanceof IFXPrimitiveProperty ) {
          IFXPrimitiveProperty pp = (IFXPrimitiveProperty) targetProperty;
          for( IFXProperty sourceProp: fxSourceClazz.getAllProperties().values() ) {
            if( sourceProp instanceof IFXEventHandlerProperty ) {
View Full Code Here

        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;
              String type = cp.getElementType().getElementName();
              if( "String".equals(type) ) {
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.tooling.model.IFXClass

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.