Examples of IFXCtrlClass


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

    if (structuredDocumentRegion.isDeleted()) {
      return;
    }

    ITextRegionList textRegions = structuredDocumentRegion.getRegions();
    IFXCtrlClass fxCtrl = null;
    for (int i = 0; i < textRegions.size(); i++) {
      ITextRegion textRegion = textRegions.get(i);
      if (textRegion.getType() == DOMRegionContext.XML_TAG_OPEN) {
        IndexedRegion treeNode = getNode(document, structuredDocumentRegion.getStartOffset(textRegion));
        if (treeNode == null) {
          return;
        }

        IDOMNode node = (IDOMNode) treeNode;
       
        if (fxCtrl == null) {
          fxCtrl = getController(node);
        }
       
        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();
                FXMLValidationMessage message = new FXMLValidationMessage(IMessage.ERROR_AND_WARNING, "FXMLValidator.unknownControllerField", fxCtrl.getSimpleName(), fielname);
                IDOMAttr domAttr = (IDOMAttr) attribute;
                message.setLength(getAttributeLength(structuredDocumentRegion, domAttr));
                message.setOffset(domAttr.getStartOffset());

                UnknownControllerFieldQuickAssist processor = new UnknownControllerFieldQuickAssist(fielname, type, fxCtrl);
                message.setAttribute(IQuickAssistProcessor.class.getName(), processor);
                reporter.addMessage(this, message);
              }
            } else {
              IFXProperty p = props.get(attribute.getNodeName());
              if (p instanceof IFXEventHandlerProperty) {
                IFXCtrlEventMethod evtMethod = fxCtrl.getAllEventMethods().get(attribute.getNodeValue().substring(1));
                if (evtMethod == null) {
                  String methodName = nnm.item(j).getNodeValue().substring(1);
                  FXMLValidationMessage message = new FXMLValidationMessage(IMessage.HIGH_SEVERITY, "FXMLValidator.unknownControllerMethod", fxCtrl.getSimpleName(), methodName);
                  IDOMAttr domAttr = (IDOMAttr) attribute;

                  message.setLength(getAttributeLength(structuredDocumentRegion, domAttr));
                  message.setOffset(domAttr.getStartOffset());
View Full Code Here

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

    Element e = d.getDocumentElement();
    Attr a = e.getAttributeNodeNS("http://javafx.com/fxml", "controller");
    if (a != null) {
      IType t = Util.findType(a.getValue(), d);
      if (t != null) {
        IFXCtrlClass ctrlClass = FXPlugin.getClassmodel().findCtrlClass(t.getJavaProject(), t);
        if (ctrlClass != null) {

          for (IFXCtrlEventMethod ctrlMethod : ctrlClass.getAllEventMethods().values()) {
            StyledString s = null;
            if (!ctrlMethod.hasArgument()) {
              s = new StyledString(ctrlMethod.getName() + "()");
            } else {
              if (at.bestsolution.efxclipse.tooling.model.Util.assignable(p.getEventType(), ctrlMethod.getArgumentType())) {
                s = new StyledString(ctrlMethod.getName() + "(" + p.getEventTypeAsString(false) + ")");
              }
            }

            if (s != null) {
              s.append(" - " + ctrlClass.getSimpleName(), StyledString.QUALIFIER_STYLER);
              Image img = null;

              switch (ctrlMethod.getVisibility()) {
              case PUBLIC:
                img = IconKeys.getIcon(IconKeys.METHOD_PUBLIC_KEY);
View Full Code Here

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

                IFXProperty ownerProperty = fxOwnerClazz.getProperty(property.getName());
               
                if( ownerProperty instanceof IFXEventHandlerProperty ) {
                  IFXEventHandlerProperty p = (IFXEventHandlerProperty) ownerProperty;
                  IType ctrlType = javaProject.findType(m.getComponentDef().getController().getQualifiedName());
                  IFXCtrlClass ctrlClass = FXPlugin.getClassmodel().findCtrlClass(javaProject, ctrlType);
                  for( IFXCtrlEventMethod ctrlMethod : ctrlClass.getAllEventMethods().values() ) {
                    StyledString s = null;
                    if( ! ctrlMethod.hasArgument() ) {
                      s = new StyledString(ctrlMethod.getName()+"()");
                    } else {
                      if( Util.assignable(p.getEventType(), ctrlMethod.getArgumentType()) ) {
                        s = new StyledString(ctrlMethod.getName() + "("+p.getEventTypeAsString(false)+")");
                      }
                    }
                   
                    if( s != null ) {
                      s.append(" - " + ctrlClass.getSimpleName(), StyledString.QUALIFIER_STYLER);
                      Image img = null;
                     
                      switch (ctrlMethod.getVisibility()) {
                      case PUBLIC:
                        img = IconKeys.getIcon(IconKeys.METHOD_PUBLIC_KEY);
View Full Code Here

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

            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(currentNode.getText());
                    if( fxp != null ) {
                      HyperlinkImpl h = new HyperlinkImpl(region, fxp.getJavaElement());
                      if( links == null || links.length == 0 ) {
                        return new IHyperlink[] { h };
                      } else {
View Full Code Here

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

        Element e = d.getDocumentElement();
        Attr a = e.getAttributeNodeNS("http://javafx.com/fxml", "controller");
        if (a != null) {
          IType t = Util.findType(a.getValue(), d);
          if( t != null ) {
            IFXCtrlClass cl = FXPlugin.getClassmodel().findCtrlClass(t.getJavaProject(), t);
             IFXCtrlEventMethod method = cl.getAllEventMethods().get(attribute.getNodeValue().substring(1));
             if( method != null ) {
               return method.getJavaElement();
             }
          }
        }
View Full Code Here

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

          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 ) {
                    IType enumType = ((IFXEnumProperty) fxp).getEnumType();
                    try {
                      for (IField f : enumType.getFields()) {
                        if (Flags.isEnum(f.getFlags())) {
View Full Code Here

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

    return rv;
  }
 
  @Override
  public IFXCtrlClass findCtrlClass(IJavaProject javaProject, IType type) {
    IFXCtrlClass rv = fxCtrlClassCache.get(type.getFullyQualifiedName());
   
    if( rv == null ) {
      FXCtrlClass c = new FXCtrlClass(javaProject, type);
      fxCtrlClassCache.put(c.getFQN(), c);
      rv = c;
View Full Code Here

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

    if( controller != null && element.getName() != null ) {
      IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
     
      try {
        IType type = javaProject.findType(controller.getQualifiedName());
        IFXCtrlClass fxClazz = FXPlugin.getClassmodel().findCtrlClass(javaProject, type);
        if( fxClazz != null ) {
          IFXCtrlField f = fxClazz.getAllFields().get(element.getName());
          if( f == null ) {
            // Defines should not lead to a warning because it is referenced later on
            if( !(element.eContainer() instanceof Define) ) {
              warning("The controller '"+type.getElementName()+"' has no field '"+element.getName()+"'", FXGraphPackage.Literals.ELEMENT__NAME, UNKNOWN_CONTROLLER_FIELD, element.getName(), controller.getQualifiedName(), element.getType().getQualifiedName());             
            }
View Full Code Here

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

        IType ctrlType = javaProject.findType(controller.getQualifiedName());
        Property propertyModel = (Property) element.eContainer();
        Element elementModel = (Element)propertyModel.eContainer();
        IType elType = javaProject.findType(elementModel.getType().getQualifiedName());
       
        IFXCtrlClass fxCtrlClazz = FXPlugin.getClassmodel().findCtrlClass(javaProject, ctrlType);
        IFXClass fxElClass = FXPlugin.getClassmodel().findClass(javaProject, elType);
       
        IFXProperty fxProp = fxElClass.getAllProperties().get(propertyModel.getName());
       
        if( !(fxProp instanceof IFXEventHandlerProperty) ) {
          error("Property is not an event property", propertyModel, FXGraphPackage.Literals.PROPERTY__NAME, -1);
          return;
        }
       
        if( fxCtrlClazz != null ) {
          IFXCtrlEventMethod m = fxCtrlClazz.getAllEventMethods().get(element.getMethodname());
          if( m == null ) {
            warning("The controller '"+ ctrlType.getElementName() +"' has no event method '"+element.getMethodname()+"'", FXGraphPackage.Literals.CONTROLLER_HANDLED_VALUE_PROPERTY__METHODNAME,UNKNOWN_CONTROLLER_METHOD, element.getMethodname(), controller.getQualifiedName(), ((IFXEventHandlerProperty)fxProp).getEventType().getFullyQualifiedName());
          }
        }
      } catch (JavaModelException e) {
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.