Package org.objectstyle.wolips.bindings.wod

Examples of org.objectstyle.wolips.bindings.wod.SimpleWodBinding


    if (te != null && we != null && ics != null) {
      SimpleWodElement wodElement = new SimpleWodElement(ics.getComponentInstanceName(), ics.getComponentName());
      List<Binding> bindings = ics.getRequiredBindings();
      if (bindings != null) {
        for (Binding binding : bindings) {
          wodElement.addBinding(new SimpleWodBinding(null, binding.getName(), "", true));
        }
      }

      // If the component name is blank, then this is an HTML tag
      if (ics.getComponentName() == null || ics.getComponentName().length() == 0) {
        wodElement.setTagName(ics.getTagName());
      }

      SimpleWodElement htmlElement;
      if (ics.isInline()) {
        htmlElement = wodElement;
      } else {
        htmlElement = new SimpleWodElement("", "");
        htmlElement.setTagName(ics.getTagName());
      }

      Map<String, String> htmlAttributes = ics.getHtmlAttributes();
      if (htmlAttributes != null) {
        for (Map.Entry<String, String> htmlAttribute : htmlAttributes.entrySet()) {
          htmlElement.addBinding(new SimpleWodBinding(null, htmlAttribute.getKey(), htmlAttribute.getValue(), true));
        }
      }

      IDocument teDoc = te.getHtmlEditDocument();
      IDocument weDoc = we.getWodEditDocument();
View Full Code Here


          htmlCacheEntry.getHtmlElementCache().addHtmlElement(elementName);

          if (wodModel != null) {
            IWodElement wodElement = wodModel.getElementNamed(woElementName);
            if (wodElement == null) {
              WodProblem undefinedElement = new WodBindingValueProblem(wodElement, new SimpleWodBinding(null, "name", null), "name", "The element '" + woElementName + "' is not defined in " + wodFile.getName(), null, -1, false);
              inlineProblems.add(new InlineWodProblem(woElement, undefinedElement, _cache));
            }
          }
        }
View Full Code Here

      _wodElement.removeBinding(existingBinding);
    }
  }

  public RefactoringWodBinding addBindingValueNamed(String value, String namespace, String name) throws CoreException, InvocationTargetException, InterruptedException {
    SimpleWodBinding binding = new SimpleWodBinding(namespace, name, value);
    _wodElement.addBinding(binding);
    RefactoringWodBinding refactoringBinding = new RefactoringWodBinding(_wodElement, binding, _cache);
    refactoringBinding._setValue(value);
    return refactoringBinding;
  }
View Full Code Here

  private WodParserCache _cache;

  public RefactoringWodBinding(IWodElement element, IWodBinding binding, WodParserCache cache) {
    _cache = cache;
    _wodElement = element;
    _wodBinding = new SimpleWodBinding(binding);
    _propertyChange = new PropertyChangeSupport(this);
  }
View Full Code Here

    setInline(true);

    if (matchingTagShortcut != null) {
      for (Map.Entry<String, String> shortcutAttribute : matchingTagShortcut.getAttributes().entrySet()) {
        BindingValue value = WodHtmlUtils.toBindingValue(shortcutAttribute.getValue(), buildProperties.getInlineBindingPrefix(), buildProperties.getInlineBindingSuffix());
        SimpleWodBinding wodBinding = new SimpleWodBinding(null, shortcutAttribute.getKey(), value.getValue());
        addBinding(wodBinding);
      }
    }

    FuzzyXMLAttribute[] attributes = element.getAttributes();
    for (FuzzyXMLAttribute attribute : attributes) {
      String namespace = attribute.getNamespace();
      String name = attribute.getName();
      String originalValue = attribute.getValue();
      BindingValue value = WodHtmlUtils.toBindingValue(originalValue, buildProperties.getInlineBindingPrefix(), buildProperties.getInlineBindingSuffix());
      Position valuePosition;
      Position valueNamespacePosition = null;
      if (value.getValueNamespace() != null) {
        int valueNamespaceOffset = originalValue.indexOf(value.getValueNamespace());
        valueNamespacePosition = new Position(element.getOffset() + attribute.getValueDataOffset() + valueNamespaceOffset + 1, value.getValueNamespace().length());
        int valueOffset = originalValue.indexOf(value.getValue(), valueNamespaceOffset + value.getValueNamespace().length());
        valuePosition = new Position(valueNamespacePosition.offset + valueOffset, attribute.getValueDataLength() - valueOffset);
      }
      else {
        valuePosition = new Position(element.getOffset() + attribute.getValueDataOffset() + 1, attribute.getValueDataLength());
      }
     
      SimpleWodBinding wodBinding = new SimpleWodBinding(namespace, name, value.getValueNamespace(), value.getValue(), new Position(attribute.getNamespaceOffset(), attribute.getNamespaceLength()), new Position(attribute.getNameOffset(), attribute.getNameLength()), valueNamespacePosition, valuePosition, -1);
      wodBinding.setStartOffset(attribute.getOffset());
      wodBinding.setEndOffset(attribute.getOffset() + attribute.getLength());
      addBinding(wodBinding);
    }
   
    setStartOffset(element.getOffset());
    setEndOffset(element.getOffset() + element.getOpenTagLength() + 2);
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.bindings.wod.SimpleWodBinding

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.