Examples of LocalizedComponentsLocateResult


Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

  private IFile getGroovyFile() {
    if (_groovyFile != null) {
      return _groovyFile;
    }
    try {
      LocalizedComponentsLocateResult results = locate.getLocalizedComponentsLocateResult(getResource());
      if (results != null) {
        _groovyFile = results.getDotGroovy();
      }
    } catch (CoreException e) {
      e.printStackTrace();
    } catch (LocateException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

      IType type = BindingReflectionUtils.findElementType(_javaProject, _elementType, false, _cache);
      if (type != null) {
        IJavaElement element = type.getPrimaryElement();
        if (element != null) {
          JavaUI.revealInEditor(JavaUI.openInEditor(element), element);
          LocalizedComponentsLocateResult componentsLocateResults = LocatePlugin.getDefault().getLocalizedComponentsLocateResult(element.getResource());
          if (componentsLocateResults != null) {
            IFile wodFile = componentsLocateResults.getFirstWodFile();
            if (wodFile != null) {
              WorkbenchUtilities.open(wodFile, "org.objectstyle.wolips.componenteditor.ComponentEditor");
            }
          }
        }
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(getContainerFullPath().segment(0));

    // This may need to change depending on how we want to deal with localized components in future.
    LocatePlugin locatePlugin = LocatePlugin.getDefault();
    try {
      LocalizedComponentsLocateResult result = locatePlugin.getLocalizedComponentsLocateResult(project, getFileName());
      if (result.getResources().length > 0) {
        setErrorMessage("A component by that name already exists");
        return false;
      }
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

  }

  protected String packageNameForComponent(String componentName) {
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(getContainerFullPath().segment(0));
    try {
      LocalizedComponentsLocateResult result = LocatePlugin.getDefault().getLocalizedComponentsLocateResult(project, componentName);
      IType javaType;
      if (result != null && (javaType = result.getDotJavaType()) != null) {
        return javaType.getPackageFragment().getElementName();
      }
    } catch (CoreException e) {
      e.printStackTrace();
    } catch (LocateException e) {
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

  protected IPath componentPathForPackage(IPackageFragment _selection) {
    try {
      LocatePlugin locate = LocatePlugin.getDefault();
      for (IJavaElement element : _selection.getChildren()) {
        String componentName = locate.fileNameWithoutExtension(element.getElementName());
        LocalizedComponentsLocateResult result = locate.getLocalizedComponentsLocateResult(
            _selection.getJavaProject().getProject(), componentName);
        IFolder[] components = result.getComponents();
        if (components.length > 0) {
          IContainer selectionPath = components[0].getParent();
          return selectionPath.getFullPath();
        }
      }
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

          if (tagDelegate != null) {
            tagDelegate.renderNode(wodElement, element, renderContext, xmlBuffer, _cssBuffer, _caches, _nodes);
          }
          else {
            IType type = BindingReflectionUtils.findElementType(cache.getJavaProject(), elementTypeName, false, WodParserCache.getTypeCache());
            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) {
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

  public static LocatePlugin getDefault() {
    return plugin;
  }

  public LocalizedComponentsLocateResult getLocalizedComponentsLocateResult(IResource resource) throws CoreException, LocateException {
    LocalizedComponentsLocateResult result;
    if (resource == null) {
      result = null;
    }
    else {
      result = getLocalizedComponentsLocateResult(resource.getProject(), LocatePlugin.getDefault().fileNameWithoutExtension(resource));
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

    }
    return result;
  }

  public LocalizedComponentsLocateResult getLocalizedComponentsLocateResult(IProject project, String filenameWithoutExtension) throws CoreException, LocateException {
    LocalizedComponentsLocateResult localizedComponentsLocateResult = componentsLocateCache.getLocalizedComponentsLocateResult(project, filenameWithoutExtension);
    if (localizedComponentsLocateResult != null) {
      return localizedComponentsLocateResult;
    }
    ComponentLocateScope componentLocateScope = ComponentLocateScope.createLocateScope(project, filenameWithoutExtension);
    localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
    Locate locate = new Locate(componentLocateScope, localizedComponentsLocateResult);
    locate.locate();
    if (componentsLocateCache != null) {
      componentsLocateCache.addToCache(project, filenameWithoutExtension, localizedComponentsLocateResult);
    }
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

        IRule rule = rulePosition.getRule();
        if (rule instanceof ElementTypeRule) {
          String elementTypeName = rulePosition.getText();
          ComponentLocateScope componentLocateScope = new ComponentLocateScope(project, elementTypeName, true);
          LocalizedComponentsLocateResult localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
          Locate locate = new Locate(componentLocateScope, localizedComponentsLocateResult);
          locate.locate();

          IFile wodFile = localizedComponentsLocateResult.getFirstWodFile();
          if (wodFile != null) {
            WorkbenchUtilities.open(wodFile, "org.objectstyle.wolips.componenteditor.ComponentEditor");
          }
        }
      } catch (Throwable e) {
View Full Code Here

Examples of org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult

      String fileName = _resource.getName();
      String extension = _resource.getFileExtension();
      int length = fileName.length() - extension.length() - 1;
      if (length > 0) {
        fileName = fileName.substring(0, length);
        LocalizedComponentsLocateResult results = LocatePlugin.getDefault().getLocalizedComponentsLocateResult(_resource);
        list.addAll(Arrays.asList(results.getResources()));
        if (results.getFirstHtmlFile() != null) {
          list.add(results.getFirstHtmlFile());
        }
        if (results.getFirstWodFile() != null) {
          list.add(results.getFirstWodFile());
        }
        if (results.getFirstWooFile() != null) {
          list.add(results.getFirstWooFile());
        }
      }
    } catch (Exception e) {
      CorePlugin.getDefault().log(e);
    }
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.