Package org.objectstyle.wolips.bindings.api

Examples of org.objectstyle.wolips.bindings.api.Wo


        String name = folder.getName();
        if (name.endsWith(".wo")) {
          String componentName = name.substring(0, name.lastIndexOf('.'));
          boolean inline = true;
          inserter = new ComponentInserter(_componentEditor, componentName, inline);
          Wo wo = inserter.getWo();
          if (wo != null) {
            selectRange = wo.isComponentContent();
          }
        }
      }
    }
View Full Code Here


    }

    IApiBinding selectedBinding = (IApiBinding) ((IStructuredSelection) _bindingsTableViewer.getSelection()).getFirstElement();
    if (_wodElement != null && selectedBinding != null) {
      String selectedBindingName = selectedBinding.getName();
      Wo api = _bindingsContentProvider.getApi();
      if (api != null) {
        IApiBinding newBinding = api.getBinding(selectedBindingName);
        if (newBinding != null) {
          _bindingsTableViewer.setSelection(new StructuredSelection(newBinding));
        }
      }
    }
View Full Code Here

    _menu.dispose();
  }

  public boolean showMenuAtLocation(IWodElement wodElement, String droppedKeyPath, Point location, BindingsDragHandler dragHandler) throws Exception {
    boolean showMenu = false;
    Wo api = wodElement.getApi(_cache.getJavaProject(), WodParserCache.getTypeCache());
    if (api != null) {
      IApiBinding[] apiBindings = wodElement.getApiBindings(api);
      if (apiBindings != null && apiBindings.length > 0) {
        Set<IApiBinding> keyBindings = new TreeSet<IApiBinding>();
        Set<IApiBinding> actionBindings = new TreeSet<IApiBinding>();
View Full Code Here

   * This method will return the Wo file from which parsed information can be
   * derived about components to be inserted. Otherwise it will reutrn null.
   * </P>
   */
  protected Wo getWo(String componentName) {
    Wo wo = null;
    if (componentName != null) {
      TemplateEditor te = getTemplateEditor();
      if (null != te) {
        IFileEditorInput input = (IFileEditorInput) te.getEditorInput();
        IFile file = input.getFile();
View Full Code Here

    return javaProject;
  }

  protected List<Binding> getRequiredBindings(String componentName) {
    List<Binding> requiredBindings = null;
    Wo wo = getWo(componentName);
    if (wo != null) {
      requiredBindings = wo.getRequiredBindings();
    }
    return requiredBindings;
  }
View Full Code Here

        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("name", ics.getComponentInstanceName());
        ics.setAttributes(attributes);
      }

      Wo wo = getWo(ics.getComponentName());
      if (wo != null) {
        ics.setComponentContent(wo.isComponentContent());
      }
    } else {
      ics = null;
    }
View Full Code Here

            LocalizedComponentsLocateResult componentsLocateResults = LocatePlugin.getDefault().getLocalizedComponentsLocateResult(type.getJavaProject().getProject(), wodElement.getElementType());
            IFile htmlFile = componentsLocateResults.getFirstHtmlFile();
            if (htmlFile != null) {
              WodParserCache nestedCache = WodParserCache.parser(htmlFile);
              if (nestedCache != null) {
                Wo apiModel = ApiUtils.findApiModelWo(type, WodParserCache.getTypeCache().getApiCache(cache.getJavaProject()));
                if (apiModel != null) {
                  String preview = apiModel.getPreview();
                  if (preview != null) {
                    StringBuffer previewBuffer = new StringBuffer();
                    Pattern bindingPattern = Pattern.compile("\\$([a-zA-Z0-9_]+)");
                    Matcher matcher = bindingPattern.matcher(preview);
                    while (matcher.find()) {
View Full Code Here

    List<WodProblem> problems = new LinkedList<WodProblem>();
    IApiBinding apiBinding = null;
    IWodElement element = null;
    if (elementType != null) {
      element = new SimpleWodElement("_temp", elementType);
      Wo wo = element.getApi(javaFileType.getJavaProject(), typeCache);
      if (wo != null) {
        apiBinding = wo.getBinding(getName());
      }
    }
    fillInBindingProblems(element, apiBinding, javaFileType.getJavaProject(), javaFileType, problems, new TypeCache(), htmlCache);
    return problems;
  }
View Full Code Here

          IResource resource = (IResource) selectedObjects[i];
          WodParserCache cache = WodParserCache.parser(resource);
          List<BindingValueKey> bindingKeys = BindingReflectionUtils.getBindingKeys(cache.getJavaProject(), cache.getComponentType(), "", false, BindingReflectionUtils.MUTATORS_ONLY, false, WodParserCache.getTypeCache());
          IFile apiFile = cache.getApiFile();
          ApiModel apiModel = new ApiModel(apiFile);
          Wo wo = apiModel.getWo();
          for (BindingValueKey binding : bindingKeys) {
            if (!BindingReflectionUtils.isSystemBindingValueKey(binding, true)) {
              String bindingName = binding.getBindingName();
              wo.createBinding(bindingName);
            }
          }
          apiModel.saveChanges();
        }
      }
View Full Code Here

    String partialToken = WodCompletionUtils.partialToken(token, tokenOffset, offset);
    boolean showReflectionBindings = true;

    // API files:
    try {
      Wo wo = ApiUtils.findApiModelWo(elementType, cache.getApiCache(project));
      if (wo != null) {
        String lowercasePartialToken = partialToken.toLowerCase();
        List<Binding> bindings = wo.getBindings();
        for (Binding binding : bindings) {
          String bindingName = binding.getName();
          String lowercaseBindingName = bindingName.toLowerCase();
          if (lowercaseBindingName.startsWith(lowercasePartialToken)) {
            WodCompletionProposal completionProposal;
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.bindings.api.Wo

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.