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

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


    }
  }
 
  @Override
  public void completeBindValueProperty_Attribute(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    BindValueProperty b = (BindValueProperty) model;
    if (b.getElementReference() != null && b.getElementReference().getType() != null) {
      Property property = (Property) b.eContainer();
      Element targetClass = (Element) property.eContainer();
      Element element = b.getElementReference();
     
      try {
        IJavaProject javaProject = projectProvider.getJavaProject(element.eResource().getResourceSet());
        IType sourceType = javaProject.findType(element.getType().getQualifiedName());
        IType targetType = javaProject.findType(targetClass.getType().getQualifiedName());
View Full Code Here


      formattedValue = "rstring \"" + p.getValue().getValue() + "\"";
    } else if (value instanceof LocationValueProperty) {
      LocationValueProperty p = (LocationValueProperty) value;
      formattedValue = "location \"" + p.getValue() + "\"";
    } else if (value instanceof BindValueProperty) {
      BindValueProperty p = (BindValueProperty) value;
      formattedValue = "bind " + p.getElementReference().getName() + "#"
          + p.getAttribute();
    } else if (value instanceof ControllerHandledValueProperty) {
      formattedValue = "controllermethod "
          + ((ControllerHandledValueProperty) value).getMethodname();
    } else if (value instanceof ScriptHandlerHandledValueProperty) {
      formattedValue = "scriptmethod "
          + ((ScriptHandlerHandledValueProperty) value)
              .getFunctionname();
    } else if (value instanceof ScriptValueExpression) {
      formattedValue = "scriptexpression "
          + ((ScriptValueExpression) value).getSourcecode();
    } else if (value instanceof ScriptValueReference) {
      formattedValue = "scriptvalue "
          + ((ScriptValueReference) value).getReference();

    } else if (value instanceof StaticValueProperty) {
      StaticValueProperty p = (StaticValueProperty) value;
      StringBuffer sb = new StringBuffer();
      if (p.getModifier() != null) {
        sb.append(p.getModifier() + " ");
      }
      sb.append("static " + p.getName() + " : ");
      sb.append(new ValuePropertyFormatter(p.getValue())
          .getFormattedValue());
      formattedValue = sb.toString();
    } else if (value instanceof StaticCallValueProperty) {
      StaticCallValueProperty p = (StaticCallValueProperty) value;
      StringBuffer sb = new StringBuffer();
      if (p.getModifier() != null) {
        sb.append(p.getModifier() + " ");
      }
      sb.append("call " + p.getType().getSimpleName() + " # "
          + p.getName() + " : ");
      sb.append(new ValuePropertyFormatter(p.getValue())
          .getFormattedValue());
      formattedValue = sb.toString();
    } else if (value instanceof ConstValueProperty) {
      ConstValueProperty p = (ConstValueProperty) value;
      StringBuffer sb = new StringBuffer();
      sb.append("const " + p.getType().getSimpleName() + "#"
          + p.getField());
      formattedValue = sb.toString();
    } else if (value instanceof IncludeValueProperty) {
      IncludeValueProperty inc = (IncludeValueProperty) value;
      formattedValue = "include " + "source=" + inc.getSource()
          + " name=" + inc.getName(); // TODO
View Full Code Here

        return cp;
      }
      // static call
      else if (value != null && value.startsWith("${")
          && value.endsWith("}")) {
        BindValueProperty s = FXGraphFactory.eINSTANCE
            .createBindValueProperty();
        // format is ${field.text}
        String[] split = value.replaceFirst("[$]", "")
            .replaceFirst("[{]", "").split("[.]");
        if (split.length != 2) {
          throw new IllegalArgumentException(
              "could not resolve binding \"" + value + "\"");
        }
        s.setElementReference(elements.get(split[0]));
        s.setAttribute(split[1].replaceFirst("[}]", ""));
        return s;
      } else if (value != null && value.startsWith("$")) {
        String valueName = value.replaceFirst("[$]", "");
        if (elements.containsKey(valueName)) {
          return createReferenceValueProperty(valueName);
        } else {
          ScriptValueReference s = FXGraphFactory.eINSTANCE
              .createScriptValueReference();
          s.setReference(valueName);
          return s;
        }
      } else if (value != null && value.startsWith("@")) {
        LocationValueProperty l = FXGraphFactory.eINSTANCE
            .createLocationValueProperty();
View Full Code Here

TOP

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

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.