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

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


  public void completeReferenceValueProperty_Reference(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if( ! model.eResource().getContents().isEmpty() ) {
      Model m = (Model) model.eResource().getContents().get(0);
      if( m.getComponentDef() != null) {
        for( Define d : m.getComponentDef().getDefines() ) {
          Element element = d.getElement();
          boolean includeType = false;
          if( element == null ) {
            element = d.getIncludeElement().getSource().getRootNode();
            includeType = true;
          }
            IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
            try {
              IType defType = javaProject.findType(element.getType().getQualifiedName());
              ReferenceValueProperty rp = (ReferenceValueProperty) model;
             
              IType targetType = null;
              if( rp.eContainer() instanceof Property ) {
                Property p = (Property) rp.eContainer();
                if( p.eContainer() instanceof Element ) {
                  Element e = (Element) p.eContainer();
                  IType ownerType = javaProject.findType(e.getType().getQualifiedName());
                  IFXClass ownerClass = FXPlugin.getClassmodel().findClass(javaProject, ownerType);
                  IFXProperty ownerProp = ownerClass.getProperty(p.getName());
                  if( ownerProp instanceof IFXObjectProperty ) {
                    targetType = ((IFXObjectProperty) ownerProp).getElementType();
                  }
                }
              } else if( rp.eContainer() instanceof StaticCallValueProperty ) {
                LOGGER.warn("Unable to extract type for " + rp.eContainer());
              } else if( rp.eContainer() instanceof ListValueProperty ) {
                ListValueProperty lvp = (ListValueProperty) rp.eContainer();
                if( lvp.eContainer() instanceof Property ) {
                  Property p = (Property) lvp.eContainer();
                  if( p.eContainer() instanceof Element ) {
                    Element e = (Element) p.eContainer();
                    IType ownerType = javaProject.findType(e.getType().getQualifiedName());
                    IFXClass ownerClass = FXPlugin.getClassmodel().findClass(javaProject, ownerType);
                    IFXProperty ownerProp = ownerClass.getProperty(p.getName());
                    if( ownerProp instanceof IFXCollectionProperty ) {
                      targetType = ((IFXCollectionProperty) ownerProp).getElementType();
                    }
View Full Code Here


    return _builder;
  }
 
  public CharSequence componentDefinition(final ComponentDefinition definition, final ImportManager importManager, final LanguageManager languageManager, final boolean preview, final boolean skipController, final boolean skipIncludes) {
    StringConcatenation _builder = new StringConcatenation();
    final Element element = definition.getRootNode();
    _builder.newLineIfNotEmpty();
    {
      boolean _isDynamicRoot = definition.isDynamicRoot();
      if (_isDynamicRoot) {
        _builder.append("<fx:root xmlns:fx=\"http://javafx.com/fxml\" type=\"");
        JvmTypeReference _type = element.getType();
        String _shortName = this.shortName(_type, importManager);
        _builder.append(_shortName, "");
        _builder.append("\"");
        String _fxElementAttributes = this.fxElementAttributes(element, importManager, skipController);
        _builder.append(_fxElementAttributes, "");
        {
          boolean _and = false;
          JvmTypeReference _controller = definition.getController();
          boolean _notEquals = (!Objects.equal(_controller, null));
          if (!_notEquals) {
            _and = false;
          } else {
            boolean _not = (!skipController);
            _and = (_notEquals && _not);
          }
          if (_and) {
            _builder.append(" fx:controller=\"");
            JvmTypeReference _controller_1 = definition.getController();
            String _qualifiedName = _controller_1.getQualifiedName();
            _builder.append(_qualifiedName, "");
            _builder.append("\"");
          }
        }
        {
          boolean _hasAttributeProperties = this.hasAttributeProperties(element, preview);
          if (_hasAttributeProperties) {
            EList<Property> _properties = element.getProperties();
            StringBuilder _elementAttributes = this.elementAttributes(_properties, preview, skipController);
            _builder.append(_elementAttributes, "");
            EList<StaticValueProperty> _staticProperties = element.getStaticProperties();
            StringBuilder _elementStaticAttributes = this.elementStaticAttributes(_staticProperties, importManager, preview, skipController);
            _builder.append(_elementStaticAttributes, "");
            EList<StaticCallValueProperty> _staticCallProperties = element.getStaticCallProperties();
            StringBuilder _elementStaticCallAttributes = this.elementStaticCallAttributes(_staticCallProperties, importManager, preview, skipController);
            _builder.append(_elementStaticCallAttributes, "");
          }
        }
        _builder.append(">");
        _builder.newLineIfNotEmpty();
      } else {
        _builder.append("<");
        JvmTypeReference _type_1 = element.getType();
        String _shortName_1 = this.shortName(_type_1, importManager);
        _builder.append(_shortName_1, "");
        _builder.append(" xmlns:fx=\"http://javafx.com/fxml\"");
        String _fxElementAttributes_1 = this.fxElementAttributes(element, importManager, skipController);
        _builder.append(_fxElementAttributes_1, "");
        {
          boolean _and_1 = false;
          JvmTypeReference _controller_2 = definition.getController();
          boolean _notEquals_1 = (!Objects.equal(_controller_2, null));
          if (!_notEquals_1) {
            _and_1 = false;
          } else {
            boolean _not_1 = (!skipController);
            _and_1 = (_notEquals_1 && _not_1);
          }
          if (_and_1) {
            _builder.append(" fx:controller=\"");
            JvmTypeReference _controller_3 = definition.getController();
            String _qualifiedName_1 = _controller_3.getQualifiedName();
            _builder.append(_qualifiedName_1, "");
            _builder.append("\"");
          }
        }
        {
          boolean _hasAttributeProperties_1 = this.hasAttributeProperties(element, preview);
          if (_hasAttributeProperties_1) {
            EList<Property> _properties_1 = element.getProperties();
            StringBuilder _elementAttributes_1 = this.elementAttributes(_properties_1, preview, skipController);
            _builder.append(_elementAttributes_1, "");
            EList<StaticValueProperty> _staticProperties_1 = element.getStaticProperties();
            StringBuilder _elementStaticAttributes_1 = this.elementStaticAttributes(_staticProperties_1, importManager, preview, skipController);
            _builder.append(_elementStaticAttributes_1, "");
            EList<StaticCallValueProperty> _staticCallProperties_1 = element.getStaticCallProperties();
            StringBuilder _elementStaticCallAttributes_1 = this.elementStaticCallAttributes(_staticCallProperties_1, importManager, preview, skipController);
            _builder.append(_elementStaticCallAttributes_1, "");
          }
        }
        _builder.append(">");
        _builder.newLineIfNotEmpty();
      }
    }
    {
      EList<Define> _defines = definition.getDefines();
      int _size = _defines.size();
      boolean _greaterThan = (_size > 0);
      if (_greaterThan) {
        _builder.append("\t");
        _builder.append("<fx:define>");
        _builder.newLine();
        {
          EList<Define> _defines_1 = definition.getDefines();
          for(final Define define : _defines_1) {
            {
              Element _element = define.getElement();
              boolean _notEquals_2 = (!Objects.equal(_element, null));
              if (_notEquals_2) {
                _builder.append("\t");
                _builder.append("\t");
                Element _element_1 = define.getElement();
                CharSequence _elementContent = this.elementContent(_element_1, importManager, preview, skipController, skipIncludes);
                _builder.append(_elementContent, "    ");
                _builder.newLineIfNotEmpty();
              } else {
                IncludeValueProperty _includeElement = define.getIncludeElement();
View Full Code Here

                      _builder.append(">");
                      _builder.newLineIfNotEmpty();
                      _builder.append("\t");
                      _builder.append("<fx:copy source=\"");
                      ValueProperty _value_18 = prop.getValue();
                      Element _reference = ((CopyValueProperty) _value_18).getReference();
                      String _name_17 = _reference.getName();
                      _builder.append(_name_17, "  ");
                      _builder.append("\" />");
                      _builder.newLineIfNotEmpty();
                      _builder.append("</");
                      String _name_18 = prop.getName();
View Full Code Here

                          _builder.append(">");
                          _builder.newLineIfNotEmpty();
                          _builder.append("\t");
                          _builder.append("<fx:copy source=\"");
                          ValueProperty _value_18 = prop.getValue();
                          Element _reference = ((CopyValueProperty) _value_18).getReference();
                          String _name_17 = _reference.getName();
                          _builder.append(_name_17, "  ");
                          _builder.append("\" />");
                          _builder.newLineIfNotEmpty();
                          _builder.append("</");
                          JvmTypeReference _type_18 = prop.getType();
View Full Code Here

                          _builder.append(">");
                          _builder.newLineIfNotEmpty();
                          _builder.append("\t");
                          _builder.append("<fx:copy source=\"");
                          ValueProperty _value_18 = prop.getValue();
                          Element _reference = ((CopyValueProperty) _value_18).getReference();
                          String _name_17 = _reference.getName();
                          _builder.append(_name_17, "  ");
                          _builder.append("\" />");
                          _builder.newLineIfNotEmpty();
                          _builder.append("</");
                          JvmTypeReference _type_18 = this.type(prop);
View Full Code Here

    while (_while) {
      {
        EObject _eContainer_1 = el.eContainer();
        if ((_eContainer_1 instanceof Element)) {
          EObject _eContainer_2 = el.eContainer();
          final Element e = ((Element) _eContainer_2);
          return e.getType();
        }
        EObject _eContainer_3 = el.eContainer();
        el = _eContainer_3;
      }
      EObject _eContainer_1 = el.eContainer();
View Full Code Here

                      if ((_value_20 instanceof BindValueProperty)) {
                        String _name_8 = p.getName();
                        String _plus_32 = (" " + _name_8);
                        String _plus_33 = (_plus_32 + "=\"${");
                        ValueProperty _value_21 = p.getValue();
                        Element _elementReference = ((BindValueProperty) _value_21).getElementReference();
                        String _name_9 = _elementReference.getName();
                        String _plus_34 = (_plus_33 + _name_9);
                        String _plus_35 = (_plus_34 + ".");
                        ValueProperty _value_22 = p.getValue();
                        String _attribute = ((BindValueProperty) _value_22).getAttribute();
                        String _plus_36 = (_plus_35 + _attribute);
View Full Code Here

                        String _plus_49 = (_plus_48 + ".");
                        String _name_8 = p.getName();
                        String _plus_50 = (_plus_49 + _name_8);
                        String _plus_51 = (_plus_50 + "=\"${");
                        ValueProperty _value_21 = p.getValue();
                        Element _elementReference = ((BindValueProperty) _value_21).getElementReference();
                        String _name_9 = _elementReference.getName();
                        String _plus_52 = (_plus_51 + _name_9);
                        String _plus_53 = (_plus_52 + ".");
                        ValueProperty _value_22 = p.getValue();
                        String _attribute = ((BindValueProperty) _value_22).getAttribute();
                        String _plus_54 = (_plus_53 + _attribute);
View Full Code Here

                        String _plus_49 = (_plus_48 + ".");
                        String _name_8 = p.getName();
                        String _plus_50 = (_plus_49 + _name_8);
                        String _plus_51 = (_plus_50 + "=\"${");
                        ValueProperty _value_21 = p.getValue();
                        Element _elementReference = ((BindValueProperty) _value_21).getElementReference();
                        String _name_9 = _elementReference.getName();
                        String _plus_52 = (_plus_51 + _name_9);
                        String _plus_53 = (_plus_52 + ".");
                        ValueProperty _value_22 = p.getValue();
                        String _attribute = ((BindValueProperty) _value_22).getAttribute();
                        String _plus_54 = (_plus_53 + _attribute);
View Full Code Here

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