Package org.eclipse.xtext.common.types

Examples of org.eclipse.xtext.common.types.JvmTypeReference


          boolean _notEquals = (!Objects.equal(_multi, null));
          if (_notEquals) {
            _builder.append("ObservableList<");
          }
        }
        JvmTypeReference _singleType = p.getSingleType();
        String _shortName = this.shortName(_singleType);
        _builder.append(_shortName, "");
        {
          Multiplicity _multi_1 = p.getMulti();
          boolean _notEquals_1 = (!Objects.equal(_multi_1, null));
          if (_notEquals_1) {
            _builder.append(">");
          }
        }
        _builder.append(" ");
        BeanPropertyDecl _property_10 = this.property(p);
        String _name_6 = _property_10.getName();
        _builder.append(_name_6, "");
        _builder.append(") {");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("this.");
        BeanPropertyDecl _property_11 = this.property(p);
        String _name_7 = _property_11.getName();
        _builder.append(_name_7, "  ");
        _builder.append("Property().set(");
        BeanPropertyDecl _property_12 = this.property(p);
        String _name_8 = _property_12.getName();
        _builder.append(_name_8, "  ");
        _builder.append(");");
        _builder.newLineIfNotEmpty();
        _builder.append("}");
        _builder.newLine();
      }
    }
    _builder.newLine();
    _builder.append("public ");
    {
      Multiplicity _multi_2 = p.getMulti();
      boolean _notEquals_2 = (!Objects.equal(_multi_2, null));
      if (_notEquals_2) {
        _builder.append("ObservableList<");
      }
    }
    JvmTypeReference _singleType_1 = p.getSingleType();
    String _shortName_1 = this.shortName(_singleType_1);
    _builder.append(_shortName_1, "");
    {
      Multiplicity _multi_3 = p.getMulti();
      boolean _notEquals_3 = (!Objects.equal(_multi_3, null));
View Full Code Here


      String _plus_4 = (_plus_3 + "(this,\"");
      BeanPropertyDecl _property_1 = this.property(p);
      String _name_1 = _property_1.getName();
      String _plus_5 = (_plus_4 + _name_1);
      String _plus_6 = (_plus_5 + "\",FXCollections.observableArrayList(new ArrayList<");
      JvmTypeReference _singleType = p.getSingleType();
      String _shortName = this.shortName(_singleType);
      String _plus_7 = (_plus_6 + _shortName);
      return (_plus_7 + ">()))");
    }
  }
View Full Code Here

      return (_plus_7 + ">()))");
    }
  }
 
  protected String _propertyCreate(final MapTypeDef p) {
    JvmTypeReference _keyType = p.getKeyType();
    String _plus = ("(ObservableMap<" + _keyType);
    String _plus_1 = (_plus + ",");
    JvmTypeReference _valueType = p.getValueType();
    String _plus_2 = (_plus_1 + _valueType);
    return (_plus_2 + ">)FXCollections.observableHashMap()");
  }
View Full Code Here

 
  protected String _defaultValue(final ValueListTypeDef p) {
    Multiplicity _multi = p.getMulti();
    boolean _equals = Objects.equal(_multi, null);
    if (_equals) {
      JvmTypeReference _singleType = p.getSingleType();
      String _qualifiedName = _singleType.getQualifiedName();
      final String _switchValue = _qualifiedName;
      boolean _matched = false;
      if (!_matched) {
        if (Objects.equal(_switchValue,"int")) {
          _matched=true;
View Full Code Here

    }
    Multiplicity _multi = t.getMulti();
    boolean _notEquals = (!Objects.equal(_multi, null));
    if (_notEquals) {
      String _plus = (ro + "ObjectProperty<ObservableList<");
      JvmTypeReference _singleType = t.getSingleType();
      String _shortName = this.shortName(_singleType);
      String _plus_1 = (_plus + _shortName);
      return (_plus_1 + ">>");
    } else {
      JvmTypeReference _singleType_1 = t.getSingleType();
      String _qualifiedName = _singleType_1.getQualifiedName();
      final String _switchValue = _qualifiedName;
      boolean _matched = false;
      if (!_matched) {
        if (Objects.equal(_switchValue,"java.lang.String")) {
          _matched=true;
          return (ro + "StringProperty");
        }
      }
      if (!_matched) {
        if (Objects.equal(_switchValue,"int")) {
          _matched=true;
          return (ro + "IntegerProperty");
        }
      }
      if (!_matched) {
        if (Objects.equal(_switchValue,"double")) {
          _matched=true;
          return (ro + "DoubleProperty");
        }
      }
      String _plus_2 = (ro + "ObjectProperty<");
      JvmTypeReference _singleType_2 = t.getSingleType();
      String _qualifiedName_1 = _singleType_2.getQualifiedName();
      String _plus_3 = (_plus_2 + _qualifiedName_1);
      return (_plus_3 + ">");
    }
  }
View Full Code Here

      return (_plus_3 + ">");
    }
  }
 
  protected String _propertyDefinition(final MapTypeDef t) {
    JvmTypeReference _keyType = t.getKeyType();
    String _shortName = this.shortName(_keyType);
    String _plus = ("SimpleObjectProperty<ObservableMap<" + _shortName);
    String _plus_1 = (_plus + ",");
    JvmTypeReference _valueType = t.getValueType();
    String _shortName_1 = this.shortName(_valueType);
    String _plus_2 = (_plus_1 + _shortName_1);
    return (_plus_2 + ">>");
  }
View Full Code Here

 
  protected String _propertyDefinition(final ValueListTypeDef t) {
    Multiplicity _multi = t.getMulti();
    boolean _equals = Objects.equal(_multi, null);
    if (_equals) {
      JvmTypeReference _singleType = t.getSingleType();
      String _qualifiedName = _singleType.getQualifiedName();
      final String _switchValue = _qualifiedName;
      boolean _matched = false;
      if (!_matched) {
        if (Objects.equal(_switchValue,"java.lang.String")) {
          _matched=true;
          return "SimpleStringProperty";
        }
      }
      if (!_matched) {
        if (Objects.equal(_switchValue,"int")) {
          _matched=true;
          return "SimpleIntegerProperty";
        }
      }
      if (!_matched) {
        if (Objects.equal(_switchValue,"double")) {
          _matched=true;
          return "SimpleDoubleProperty";
        }
      }
      JvmTypeReference _singleType_1 = t.getSingleType();
      String _shortName = this.shortName(_singleType_1);
      String _plus = ("SimpleObjectProperty<" + _shortName);
      return (_plus + ">");
    } else {
      JvmTypeReference _singleType_2 = t.getSingleType();
      String _shortName_1 = this.shortName(_singleType_2);
      String _plus_1 = ("SimpleObjectProperty<ObservableList<" + _shortName_1);
      return (_plus_1 + ">>");
    }
  }
View Full Code Here

    }
  }
 
  @Check
  public void validate(Element element) {
    JvmTypeReference controller = ((Model)element.eResource().getContents().get(0)).getComponentDef().getController();
    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());             
            }
          } else {
            IType fromType = javaProject.findType(element.getType().getQualifiedName());
            IType toType = f.getType();
            if( ! Util.assignable(fromType, toType) ) {
              error("The type '"+fromType.getElementName()+"' is not assignable to the controller fields type '"+toType.getElementName()+"'", FXGraphPackage.Literals.ELEMENT__NAME, CONTROLLER_FIELD_NOT_ASSIGNABLE, element.getName(), controller.getQualifiedName(), element.getType().getQualifiedName());
            }
          }
        }
      } catch (JavaModelException e) {
        // TODO Auto-generated catch block
View Full Code Here

    }
  }
 
  @Check
  public void validate(ControllerHandledValueProperty element) {
    JvmTypeReference controller = ((Model)element.eResource().getContents().get(0)).getComponentDef().getController();
    if( controller != null && element.getMethodname() != null ) {
      IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
      try {
        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) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

      }
    }
    _builder.append("component ");
    String _name = cd.getName();
    _builder.append(_name, "");
    JvmTypeReference _controller = cd.getController();
    CharSequence _generateController = this.generateController(_controller);
    _builder.append(_generateController, "");
    EList<String> _previewCssFiles = cd.getPreviewCssFiles();
    CharSequence _generateStyle = this.generateStyle(_previewCssFiles);
    _builder.append(_generateStyle, "");
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.common.types.JvmTypeReference

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.