Examples of IFXCollectionProperty


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

            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);
                    }
                  }
                }
              }
View Full Code Here

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

        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;
          createSubtypeProposals(contentAssistRequest, context, cp.getElementType());
        }
      }
    }
  }
View Full Code Here

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

            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) ) {
                ICompletionProposal p = createCompletionProposal("\"\"", new StyledString("\"<String>\""), IconKeys.getIcon(IconKeys.CLASS_KEY), context);
             
                if (p instanceof ConfigurableCompletionProposal) {
                  ConfigurableCompletionProposal ccp = (ConfigurableCompletionProposal) p;
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.