Package de.innovationgate.eclipse.editors.config

Examples of de.innovationgate.eclipse.editors.config.TMLTagAttribute


                                        charEnd = charStart + attribute.length();
                                    }
                    if (tag.getAttribute(attribute) == null) {                                 
                      MarkerFactory.createErrorMarker(MARKER_ID, file, charStart, charEnd, "Unknown attribute '" + attribute + "'.");
                    } else {
                        TMLTagAttribute attrib  = tag.getAttribute(attribute);
                        if (attrib.isDeprecated()) {
                            MarkerFactory.createWarningMarker(MARKER_ID, file, charStart, charEnd, "Attribute '" + attribute + "' is deprecated. " + attrib.getDeprecated());
                        }
                    }
                  }
                 
                }
View Full Code Here


                    if (versionCompliance != null) {
                        TMLTag tag = TMLTagDefinitions.getInstance(versionCompliance).getTagByName(tagName);
                        if (tag != null) {
                            String attributeAtCursor = tmlInfo.getAttributeAtCursor();
                            if (attributeAtCursor != null) {
                                TMLTagAttribute attribute = tag.getAttribute(attributeAtCursor);
                                if (attribute != null && attribute.isTmlscriptExpression()) {
                                    return _tmlScriptProcessor.getCompletionProposalAutoActivationCharacters();
                                }
                            }
                        }
                    }
View Full Code Here

    Iterator<String> attributes = tmlInfo.getAttributeNames().iterator();
    while (attributes.hasNext()) {
      String attribute = attributes.next();
      String value = tmlInfo.getAttributeValue(attribute);
      if (value != null && !value.trim().startsWith("{") && !value.trim().endsWith("}")) {
        TMLTagAttribute tagAttribute = tag.getAttribute(attribute);
        if (tagAttribute != null && tagAttribute.getValidValues().size() > 0) {
          // only defined attribute values allowed - so check
          if (!tagAttribute.getValidValues().contains(value)) {           
            int charStart = tmlInfo.getDocumentRegion().getOffset();
            int charEnd = tmlInfo.getDocumentRegion().getOffset() + tmlInfo.getDocumentRegion().getLength();
            int valueStart = tmlInfo.getContent().indexOf(value);
            if (valueStart != -1) {
              charStart = charStart + valueStart;
View Full Code Here

    }
    int charStart = partition.getOffset();
    int charEnd = charStart + partition.getLength();
    Iterator<TMLTagAttribute> attributes = tag.getRequiredAttributes().iterator();
    while (attributes.hasNext()) {
      TMLTagAttribute attribute = attributes.next();
      if (!tmlInfo.hasAttribute(attribute.getName())) {
        MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Attribute '" + attribute.getName() + "' is mandatory for tml tag '" + tmlInfo.getTagName() + "'.");                 
      }
    }
    if (tag.getRequiredAttributes().isEmpty() && tag.isAttributeNecessary() && tmlInfo.getAttributeNames().isEmpty()) {
      MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "At least one attribute is necessary on tml tag '" + tmlInfo.getTagName() + "'.");
    }
View Full Code Here

        String typed = search.substring(attributePrefixStartPos, _cursorRelative);
        TMLTag tag = TMLTagDefinitions.getInstance(WGADesignStructureHelper.getWGAVersionCompliance(activeFile)).getTagByName(getTagName());
        if (tag != null) {
          Iterator<TMLTagAttribute> it = tag.getAttributesByPrefix(typed).iterator();
          while (it.hasNext()) {
            TMLTagAttribute attrib = it.next();
            if (!_attributes.containsKey(attrib.getName()) && !attrib.isDeprecated()) {
              String attName  = attrib.getName();
              String display = attName;
              StringBuffer replacement = new StringBuffer();
              replacement.append(attName);
              replacement.append("=\"\"");
              int cursorPosAfterReplace = replacement.toString().length() - 1;
              ContextInformation contextInfo = Plugin.getDefault().getContextInformationProvider().getAttributeInformation(tag.getName(), attrib.getName(), activeFile);
              proposals.add(new TMLCompletionProposal(replacement.toString(), _cursorAbsolute - typed.length(), typed.length(), cursorPosAfterReplace, null, display, contextInfo));
            }
          }
        }
      }
    } else if (getAttributeNameOfValueCursorPosition() != null) {
      // create attribute value proposals
      String attribute = getAttributeNameOfValueCursorPosition();
      String search = _content.substring(0, _cursorRelative);
      int attributeValueStartPos = searchBackwards("\"", search, "=");
      String typed = "";
      if (attributeValueStartPos != -1) {
        typed = _content.substring(attributeValueStartPos + 1, _cursorRelative)
      } else {
        typed = "";
      }     
      TMLTag tag = TMLTagDefinitions.getInstance(WGADesignStructureHelper.getWGAVersionCompliance(activeFile)).getTagByName(getTagName());
      if (tag != null) {
          TMLTagAttribute tagAttribute = tag.getAttribute(attribute);
          if (tagAttribute != null) {
              if (tagAttribute.isTmlscriptExpression()) {
                  // perform tmlscript code completion
                  try {
                            IRegion region = getAttributeValueRegion(attribute);
                            TMLScriptRegion tmlScriptRegion = TMLScriptRegion.parse(region, _document, _cursorAbsolute, WGADesignStructureHelper.getWGAVersionCompliance(activeFile));
                            proposals.addAll(tmlScriptRegion.createProposals());
View Full Code Here

  private int generateAttributeSection(TMLTag tag, StringBuffer section) {
    Iterator<TMLTagAttribute> attribs = tag.getRequiredAttributes().iterator();
    boolean firstAttribute = true;
    int cursorPosFirstAttribute = -1;
    while (attribs.hasNext()) {
      TMLTagAttribute attribute = attribs.next();
      section.append(attribute.getName());
      section.append("=\"\"");
      if (firstAttribute) {
        firstAttribute = false;
        cursorPosFirstAttribute = section.toString().length() - 1;
      }
View Full Code Here

      VersionCompliance versionCompliance = retrieveVersionCompliance(tmlFile);     
    if (value != null) {
      // check if attribute value help is available - otherwise disable value lookup (set value to null)
      TMLTag tag = TMLTagDefinitions.getInstance(versionCompliance).getTagByName(tagname);
      if (tag != null) {
        TMLTagAttribute tagAttribute = tag.getAttribute(attribute);
        if (tagAttribute != null) {
          if (!tagAttribute.isValueHelpEnabled()) {
            value = null;
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.editors.config.TMLTagAttribute

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.