Examples of IWodBinding


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

public class WOStringTagDelegate extends TagDelegate {
  private boolean _cssAdded;
 
  @Override
  public void renderNode(IWodElement wodElement, FuzzyXMLElement xmlElement, RenderContext renderContext, StringBuffer htmlBuffer, StringBuffer cssBuffer, Stack<WodParserCache> caches, Stack<FuzzyXMLNode> nodes) {
    IWodBinding valueBinding = wodElement.getBindingNamed("value");
    if (valueBinding.isKeyPath()) {
      htmlBuffer.append("<span class = \"wodclipse_WOString\">[" + valueBinding.getValue() + "]</span>");
    } else {
      htmlBuffer.append(valueBinding.getValue());
    }
   
    if (!_cssAdded) {
      cssBuffer.append("span.wodclipse_WOString {");
      cssBuffer.append("  color: red;");
View Full Code Here

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

public class WORepetitionTagDelegate extends TagDelegate {
  private boolean _cssAdded;

  @Override
  public void renderNode(IWodElement wodElement, FuzzyXMLElement xmlElement, RenderContext renderContext, StringBuffer htmlBuffer, StringBuffer cssBuffer, Stack<WodParserCache> caches, Stack<FuzzyXMLNode> nodes) {
    IWodBinding listBinding = wodElement.getBindingNamed("list");
    String listName;
    if (listBinding != null) {
      listName = listBinding.getValue();
    } else {
      listName = "WORepetition";
    }
    htmlBuffer.append("<span class = \"wodclipse_block wodclipse_WORepetition\"><span class = \"wodclipse_tag wodclipse_open_tag\">[loop " + listName + "]</span>");
    xmlElement.toXMLString(renderContext, htmlBuffer);
View Full Code Here

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

    int endOffset = _endOffset;
    if (endOffset == -1) {
      endOffset = _elementType.getTokenEndOffset();
      Iterator<IWodBinding> bindingsIter = getBindings().iterator();
      while (bindingsIter.hasNext()) {
        IWodBinding binding = bindingsIter.next();
        endOffset = Math.max(endOffset, binding.getEndOffset());
      }
    }
    return endOffset;
  }
View Full Code Here

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

    }
  }

  public static WodBindingValueHyperlink toBindingValueHyperlink(IWodElement wodElement, String bindingName, WodParserCache cache) throws JavaModelException, CoreException, LocateException {
    WodBindingValueHyperlink hyperlink = null;
    IWodBinding wodBinding = wodElement.getBindingNamed(bindingName);
    if (wodBinding != null && wodBinding.isKeyPath()) {
      Position valuePosition = wodBinding.getValuePosition();
      if (valuePosition != null) {
        Region elementRegion = new Region(valuePosition.getOffset(), valuePosition.getLength());
        IType componentType = cache.getComponentType();
        if (componentType != null) {
          hyperlink = new WodBindingValueHyperlink(wodElement, wodBinding, elementRegion, wodBinding.getValue(), componentType, WodParserCache.getTypeCache());
        }
      }
    }
    return hyperlink;
  }
View Full Code Here

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

      renderBuffer.append("<div class = \"summary\" onclick = \"window.status = 'select:" + nodeID + "'\">");

      // ... a simple string tag
      if (woSimpleString) {
        IWodBinding valueBinding = wodElement.getBindingNamed("value");
        String text = valueBinding.getValue();
        String textClassName;
        if (valueBinding.isLiteral()) {
          //text = text.replaceAll("^\"([^\"]+)\"", "$1");
          textClassName = "text literal";
        }
        else if (valueBinding.isOGNL()) {
          textClassName = "text ognl";
        }
        else {
          textClassName = "text keypath";
        }
        renderBuffer.append("<div class = \"title\"></div> <div class = \"" + textClassName + "\">[" + text + "]</div>");
      }
      // ... a WO tag
      else if (woTag) {
        if (wodElement != null) {
          if (WodHtmlUtils.isInline(nodeName)) {

            String summaryName = wodElement.getElementType();
            renderBuffer.append("<div class = \"title\"><span class = \"nodeName verbose\">" + summaryName + "</span></div>");

            // Special case for the compact display of a conditional
            if ("WOConditional".equals(summaryName)) {
              String conditionValue = wodElement.getBindingValue("condition");
              if (conditionValue != null) {
                summaryName = conditionValue;
                boolean negated = false;
                IWodBinding negateBinding = wodElement.getBindingNamed("negate");
                if (negateBinding != null) {
                  if (negateBinding.isTrueValue()) {
                    negated = true;
                  }
                }
                else if (nodeName.equals("wo:not")) {
                  negated = true;
                }

                if (negated) {
                  summaryName = "<span class = \"negate\">not</span> " + summaryName;
                }
                else if (negateBinding != null) {
                  summaryName = summaryName + " <span class = \"negate\">not = " + negateBinding.getValue() + "</span>";
                }
              }
            }
            // Special case for the compact display of a string
            else if ("WOString".equals(summaryName)) {
View Full Code Here

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

  public void reset() {
    // DO NOTHING
  }

  public static void appendHtmlBindings(StringBuffer htmlBuffer, IWodElement wodElement) {
    IWodBinding idBinding = wodElement.getBindingNamed("id");
    if (idBinding != null && !idBinding.isKeyPath()) {
      htmlBuffer.append(" id = \"" + idBinding.getValue() + "\"");
    }

    IWodBinding classBinding = wodElement.getBindingNamed("class");
    if (classBinding != null && !classBinding.isKeyPath()) {
      htmlBuffer.append(" class = \"" + classBinding.getValue() + "\"");
    }

    IWodBinding styleBinding = wodElement.getBindingNamed("style");
    if (styleBinding != null && !styleBinding.isKeyPath()) {
      htmlBuffer.append(" style = \"" + styleBinding.getValue() + "\"");
    }
  }
View Full Code Here

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

    }
  }

  public static String getResourceUrl(String frameworkBindingName, String filenameBindingName, String hrefBindingName, IWodElement wodElement, Stack<WodParserCache> caches) {
    String resourceUrl;
    IWodBinding hrefBinding = wodElement.getBindingNamed(hrefBindingName);
    if (hrefBinding != null && !hrefBinding.isKeyPath()) {
      resourceUrl = hrefBinding.getValue();
    } else {
      resourceUrl = TagDelegate.getResourceUrl(frameworkBindingName, filenameBindingName, wodElement, caches);
    }
    return resourceUrl;
  }
View Full Code Here

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

    return resourceUrl;
  }

  public static String getResourceUrl(String frameworkBindingName, String filenameBindingName, IWodElement wodElement, Stack<WodParserCache> caches) {
    File webserverResourcesFolder = null;
    IWodBinding frameworkBinding = wodElement.getBindingNamed(frameworkBindingName);
    String framework = null;
    if (frameworkBinding == null) {
      framework = "app";
    }
    else if (!frameworkBinding.isKeyPath()) {
      framework = frameworkBinding.getValue();
    }
    if (framework != null) {
      framework = framework.replaceAll("\"", "");

      IJavaProject javaProject = caches.peek().getJavaProject();
      if ("app".equals(framework)) {
        webserverResourcesFolder = new File(javaProject.getProject().getLocation().toFile(), "WebServerResources");
      }
      else {
        try {
          IClasspathEntry[] classpathEntries = javaProject.getResolvedClasspath(true);
          for (IClasspathEntry classpathEntry : classpathEntries) {
            if ((classpathEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT || classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) && classpathEntry.getPath().segment(0).equals(framework)) {
              File projectFolder = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), classpathEntry.getPath().segment(0));
              webserverResourcesFolder = new File(projectFolder, "WebServerResources");
            }
          }
        } catch (JavaModelException e) {
          e.printStackTrace();
        }
      }
    }
   
    String resourceUrl = null;
    if (webserverResourcesFolder != null) {
      File webserverResourceFile = null;
      IWodBinding filenameBinding = wodElement.getBindingNamed(filenameBindingName);
      if (filenameBinding != null && !filenameBinding.isKeyPath()) {
        String filename = filenameBinding.getValue().replaceAll("\"", "");
        webserverResourceFile = new File(webserverResourcesFolder, filename);
      }

      if (webserverResourceFile != null) {
        try {
View Full Code Here

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

    }
  }

  public static WodBindingNameHyperlink toBindingNameHyperlink(IWodElement wodElement, String bindingName, WodParserCache cache) {
    WodBindingNameHyperlink hyperlink = null;
    IWodBinding wodBinding = wodElement.getBindingNamed(bindingName);
    if (wodBinding != null) {
      Position namePosition = wodBinding.getNamePosition();
      if (namePosition != null) {
        Region elementRegion = new Region(namePosition.getOffset(), namePosition.getLength());
        String elementTypeName = wodElement.getElementType();
        if (elementTypeName != null) {
          hyperlink = new WodBindingNameHyperlink(elementRegion, bindingName, cache.getJavaProject(), elementTypeName, WodParserCache.getTypeCache());
View Full Code Here

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

                    StringBuffer previewBuffer = new StringBuffer();
                    Pattern bindingPattern = Pattern.compile("\\$([a-zA-Z0-9_]+)");
                    Matcher matcher = bindingPattern.matcher(preview);
                    while (matcher.find()) {
                      String bindingName = matcher.group(1);
                      IWodBinding binding = wodElement.getBindingNamed(bindingName);
                      if (binding == null) {
                        matcher.appendReplacement(previewBuffer, "");
                      } else {
                        matcher.appendReplacement(previewBuffer, binding.getValue());
                      }
                    }
                    matcher.appendTail(previewBuffer);
 
                    nestedCache = nestedCache.cloneCache();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.