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

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


                alreadyCreated = true;
                break;
              }
            }
            if (!alreadyCreated) {
              Property p = createProperty(localName,
                  FXGraphFactory.eINSTANCE
                      .createMapValueProperty());
              elementStack.peek().getProperties().add(p);
            }
          } else {
            if (!isContainer(localName)) {
              thePropertyIDontWantToForget = localName;
            }
          }
        } else {
          if (!localName.contains(".")) {
            if (checkConstant(localName, attributes)) {
              ConstValueProperty c = createConstValueProperty(
                  localName, attributes);
              boolean found = false;
              for (Property p : elementStack.peek()
                  .getProperties()) {
                if (p.getName().equals(getStructuralParent())) {
                  found = true;
                  p.setValue(c);
                }
              }
              if (!found) {
                Property p = createProperty(
                    getStructuralParent(), c);
                elementStack.peek().getProperties().add(p);
                if (getStructuralParent().equals(
                    thePropertyIDontWantToForget)) {
                  thePropertyIDontWantToForget = null;
                }
              }
            } else {
              Element e = createElement(localName, attributes);
              // root element
              if (model.getComponentDef().getRootNode() == null) {
                model.getComponentDef().setRootNode(e);
              } else {
                // Factory values
                if (elementStack.peek().getFactory() != null) {
                  // is it a constant or an element
                  if (attributes.getLength() == 1
                      && "fx:value".equals(attributes
                          .getQName(0))) {
                    SimpleValueProperty sp = FXGraphFactory.eINSTANCE
                        .createSimpleValueProperty();
                    sp.setStringValue(attributes
                        .getValue(0));
                    elementStack.peek().getValues().add(sp);
                  } else {
                    elementStack.peek().getValues().add(e);
                  }
                }
                // child elements
                else if ("children"
                    .equals(getStructuralParent())) {
                  elementStack.peek().getDefaultChildren()
                      .add(e);
                } else if (isContainer(getStructuralParent())) {
                  Element parent = elementStack.peek();
                  Property p = null;
                  for (Property existingP : parent
                      .getProperties()) {
                    if (getStructuralParent().equals(
                        existingP.getName())) {
                      p = existingP;
                      break;
                    }
                  }
                  if (p == null) {
                    p = createProperty(
                        getStructuralParent(),
                        FXGraphFactory.eINSTANCE
                            .createListValueProperty());
                  }
                  if (p.getValue() instanceof ListValueProperty) {
                    ListValueProperty list = (ListValueProperty) p
                        .getValue();
                    list.getValue().add(e);
                  } else if ((p.getValue() instanceof ListValueProperty)) {
                    System.err.println("TODO");
                  }
                  parent.getProperties().add(p);
                } else if ("fx:define"
                    .equals(getStructuralParent())) {
                  Define d = FXGraphFactory.eINSTANCE
                      .createDefine();
                  d.setElement(e);
                  model.getComponentDef().getDefines().add(d);
                } else {
                  if (!isSpecial(getStructuralParent())) {
                    Property p = createProperty(
                        getStructuralParent(), e);
                    elementStack.peek().getProperties()
                        .add(p);
                    if (getStructuralParent().equals(
                        thePropertyIDontWantToForget)) {
View Full Code Here


                MapValueProperty prop = (MapValueProperty) p
                    .getValue();
                SimpleValueProperty e = FXGraphFactory.eINSTANCE
                    .createSimpleValueProperty();
                e.setStringValue(value);
                Property mapval = createProperty(localName, e);
                prop.getProperties().add(mapval);
                attached = true;
                break;
              }
            }
            if (!attached) {
              System.err.println("TODO could not attach value");
            }
          } else {
            if (elementStack.peek().getFactory() == null) {
              System.err
                  .println("TODO value found, structural parent is "
                      + getStructuralParent());
            }
          }
        } else if ("fx:factory".equals(qName)) {
          element.setFactory(value);
        } else if ("fx:controller".equals(qName)) {
          JvmParameterizedTypeReference c = createJvmParameterizedTypeReference(value);
          model.getComponentDef().setController(c);
        } else if ("fx:id".equals(qName)) {
          element.setName(value);
          elements.put(value, element);
        } else {
          Property p = createProperty(name);
          p.setValue(createValueProperty(p, qName, value));
          element.getProperties().add(p);
        }
      }
      return element;
    }
View Full Code Here

            model.getComponentDef().getScripts().add(s);
          }
        } else if (!"children".equals(localName)) {
          if (Character.isUpperCase(localName.charAt(0))) {
            if (localName.contains(".")) {
              Property p = FXGraphFactory.eINSTANCE
                  .createProperty();
              p.setValue(createStaticCallProperty(p, localName,
                  richtTextContent.toString()));
              elementStack.peek().getProperties().add(p);
            } else if (constant) {
              // nothing here
            } else {
View Full Code Here

      }
      return vp;
    }

    private Property createProperty(String name) {
      Property p = FXGraphFactory.eINSTANCE.createProperty();
      p.setName(name);
      return p;
    }
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.Property

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.