Package org.objectstyle.wolips.bindings.wod

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


    }
    return doc;
  }

  public IWodElement getSelectedElement(boolean resolveWodElement, boolean refreshModel) throws Exception {
    IWodElement wodElement = null;
    WodParserCache cache = getParserCache();
    if (getSelectionProvider() != null) {
      ISelection realSelection = getSelectionProvider().getSelection();
      if (realSelection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection) realSelection;
View Full Code Here


  public StyledText getWOEditorControl() {
    return getViewer().getTextWidget();
  }

  public IWodElement getWodElementAtPoint(Point point, boolean resolveWodElement, boolean refreshModel) throws Exception {
    IWodElement wodElement = null;
    FuzzyXMLElement element = getElementAtPoint(point, refreshModel);
    if (WodHtmlUtils.isWOTag(element)) {
      WodParserCache cache = getParserCache();
      BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
      wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
View Full Code Here

            String tagName = stackElement.getName();
            boolean isWOTag = WodHtmlUtils.isWOTag(tagName);
            String displayName = null;
            if (isWOTag) {
              BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
              IWodElement wodElement = WodHtmlUtils.getWodElement(stackElement, buildProperties, true, cache);
              if (wodElement != null) {
                displayName = wodElement.getElementType();
              }
              data = new FuzzyXMLElementWithWodElement(stackElement, wodElement);
            }
            else {
              displayName = tagName;
View Full Code Here

  public static void renameWodSelection(int offset, ITextViewer htmlViewer, ITextViewer wodViewer, WodParserCache cache) throws Exception {
    IWodModel wodModel = cache.getWodEntry().getModel();
    if (wodModel != null) {
      IWodUnit wodUnit = wodModel.getWodUnitAtIndex(offset);
      if (wodUnit != null && wodUnit instanceof IWodElement) {
        IWodElement wodElement = (IWodElement) wodUnit;
        Position elementNamePosition = wodElement.getElementNamePosition();
        if (elementNamePosition != null && elementNamePosition.includes(offset)) {
          String elementName = wodElement.getElementName();
          if (elementName != null) {
            QuickRenameRefactoring.renameElement(elementName, htmlViewer, wodViewer, cache, false);
          }
        }
      }
View Full Code Here

  }

  protected static int linkWod(String woElementName, IDocument wodDocument, LinkedPositionGroup linkedGroup, WodParserCache cache, int sequence) throws Exception {
    LinkedModeModel.closeAllModels(wodDocument);
    IWodModel wodModel = cache.getWodEntry().getModel();
    IWodElement wodElement = wodModel.getElementNamed(woElementName);
    if (wodElement != null) {
      Position namePosition = wodElement.getElementNamePosition();
      if (namePosition != null) {
        linkedGroup.addPosition(new LinkedPosition(wodDocument, namePosition.getOffset(), namePosition.getLength(), sequence++));
      }
    }
    return sequence;
View Full Code Here

   * @param cache the WodParserCache
   * @return an IWodElement corresponding to the node
   * @throws Exception
   */
  public static IWodElement getWodElement(FuzzyXMLElement element, BuildProperties buildProperties, boolean resolveWodElement, WodParserCache cache) throws Exception {
    IWodElement wodElement;
    if (WodHtmlUtils.isWOTag(element)) {
      if (WodHtmlUtils.isInline(element.getName()) || !resolveWodElement) {
        wodElement = new FuzzyXMLWodElement(element, buildProperties);
      }
      else {
View Full Code Here

          String wodErrorsInHtmlSeverity = Activator.getDefault().getPluginPreferences().getString(PreferenceConstants.WOD_ERRORS_IN_HTML_SEVERITY_KEY);
          if (!PreferenceConstants.IGNORE.equals(wodErrorsInHtmlSeverity)) {
            // We create HTML markers for WOD problems so that you can have the
            // wod view closed and still see errors
            if (createHtmlMarkers && wodProblem instanceof IWodElementProblem) {
              IWodElement element = ((IWodElementProblem) wodProblem).getElement();
              if (element != null) {
                List<HtmlElementName> htmlElementNames = htmlElementCache.getHtmlElementNames(element.getElementName());
                if (htmlElementNames != null) {
                  for (HtmlElementName htmlElementName : htmlElementNames) {
                    int lineNumber = WodHtmlUtils.getLineAtOffset(cache.getHtmlEntry().getContents(), htmlElementName.getStartOffset());
                    WodElementProblem htmlProblem = new WodElementProblem(element, "In the WOD, " + wodProblem.getMessage(), new Position(htmlElementName.getStartOffset(), htmlElementName.getEndOffset() - htmlElementName.getStartOffset() + 1), lineNumber, wodProblem.isWarning() || PreferenceConstants.WARNING.equals(wodErrorsInHtmlSeverity));
                    WodModelUtils.createMarker(htmlFile, htmlProblem);
View Full Code Here

  public void run(IProgressMonitor monitor) throws InvocationTargetException {
    try {
      int referenceCount = 0;

      if (WodHtmlUtils.isWOTag(_element) && !WodHtmlUtils.isInline(_element)) {
        IWodElement wodElement = WodHtmlUtils.getWodElement(_element, _buildProperties, true, _cache);
        if (wodElement != null) {
          String elementName = wodElement.getElementName();
          List<HtmlElementName> htmlElementNames = _cache.getHtmlEntry().getHtmlElementCache().getHtmlElementNames(elementName);
          if (htmlElementNames != null) {
            referenceCount = htmlElementNames.size();
          }
         
View Full Code Here

TOP

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

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.