Package de.innovationgate.eclipse.editors.tml

Examples of de.innovationgate.eclipse.editors.tml.TMLRegion


    try {
      ITypedRegion[] partitions = document.computePartitioning(0, document.getLength());
      for (ITypedRegion partition : partitions) {
        if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
          try {
            TMLRegion tmlInfo = TMLRegion.parse(partition, document);
            TMLTagDefinitions tagDef = TMLTagDefinitions.getInstance(_versionCompliance);
            if (tagDef != null) {
                TMLTag tag = tagDef.getTagByName(tmlInfo.getTagName());
                if (tag != null) {
                  List<String> tmpAttributes = new ArrayList<String>();
                  tmpAttributes.addAll(tmlInfo.getAttributeNames());
                  tmpAttributes.addAll(tmlInfo.getValuelessAttributes());
                 
                  Iterator<String> attributes = tmpAttributes.iterator();
                  while (attributes.hasNext()) {
                    String attribute = attributes.next();
                    if (tag.getName().equals("include") || tag.getName().equals("portlet")) {
                      if (attribute.startsWith("o_")) {
                        // attributes starting with "o_" mean implicit options - do not validate
                        continue;
                      }
                    }
                    int charStart = partition.getOffset();
                                    int charEnd = charStart + partition.getLength();
                                    int attributeStart = tmlInfo.getContent().indexOf(attribute);
                                    if (attributeStart != -1) {
                                        charStart = charStart + attributeStart;
                                        charEnd = charStart + attribute.length();
                                    }
                    if (tag.getAttribute(attribute) == null) {                                 
View Full Code Here


    try {
      ITypedRegion[] partitions = document.computePartitioning(0, document.getLength());
      for (ITypedRegion partition : partitions) {
        if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
          try {
            TMLRegion tmlInfo = TMLRegion.parse(partition, document);
            if (!tmlInfo.isTagKnown(_versionCompliance)) {
              int charStart = partition.getOffset();
              int charEnd = charStart + partition.getLength();
              MarkerFactory.createErrorMarker(MARKER_ID, file, charStart, charEnd, "Unknown TML-Tag '" + tmlInfo.getTagName() + "'.");
            } else {
                TMLTagDefinitions tagDef = TMLTagDefinitions.getInstance(_versionCompliance);
                if (tagDef != null) {
                    TMLTag tag = tagDef.getTagByName(tmlInfo.getTagName());
                    if (tag.isDeprecated()) {
                        int charStart = partition.getOffset();
                                int charEnd = charStart + partition.getLength();
                                MarkerFactory.createWarningMarker(MARKER_ID, file, charStart, charEnd, "TML-Tag '" + tmlInfo.getTagName() + "' is deprecated. " + tag.getDeprecated());
                    }
                }
            }
          } catch (ParseException e) {
          }
View Full Code Here

     
      ITypedRegion[] partitions = document.computePartitioning(0, document.getLength());
      for (ITypedRegion partition : partitions) {
        if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
          try {           
            TMLRegion tmlInfo = TMLRegion.parse(partition, document);
            TMLTag tag = TMLTagDefinitions.getInstance(versionCompliance).getTagByName(tmlInfo.getTagName());
            if (tag != null) {
              executeValidators(file, document, partition, tmlInfo, tag, versionCompliance);             
            }
          } catch (ParseException e) {
          }         
View Full Code Here

      for (ITypedRegion partition : partitions) {
        if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START) || partition.getType().equals(TMLPartitionScanner.TML_TAG_STOP)) {
          if (!TMLRegion.isTMLPartitionClosed(partition, document)) {
            int charStart = partition.getOffset();
            int charEnd = charStart + partition.getLength();
            TMLRegion tmlInfo = null;
            try {
              tmlInfo = TMLRegion.parse(partition, document);             
            } catch (ParseException e) {
            }
            // create markers only for known tags
            if (tmlInfo != null && tmlInfo.isTagKnown(_versionCompliance)) {
              String message = null;
              if (tmlInfo != null) {
                if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
                  message = "Missing close tag '" + tmlInfo.getTagName() + "'.";
                } else {
                  message = "Missing start tag '" + tmlInfo.getTagName() + "'.";
                }
              } else {
                message = "Unclosed tag.";
              }
              MarkerFactory.createErrorMarker(MARKER_ID, file, charStart, charEnd, message);
View Full Code Here

    }

    if (region.getType().equals(TMLPartitionScanner.TML_TAG_START)) {

      try {
        TMLRegion tmlRegion = TMLRegion.parse(region, _doc, textSelection.getOffset());

        if (tmlRegion.isCursorInAttributeValue()) {
          tmlLabelTag = "{label(\'" + key + "\')}";
        }

        if (tmlRegion.isCursorInTagName()) {

          selectString(key,true);
          return null;
        }
View Full Code Here

   
    try {
      ITypedRegion[] partitions = document.computePartitioning(0, document.getLength());
      for (ITypedRegion partition : partitions) {
        if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
          TMLRegion unknownRegion;
          try {
            unknownRegion = TMLRegion.parse(partition, document);       
            if (unknownRegion.getTagName() != null && unknownRegion.getTagName().equals("action")) {
              String actionId = unknownRegion.getAttributeValue("id");
              if (actionId != null && !actionId.trim().equals("")) {
                actionIds.add(actionId);
              }
            }
          } catch (ParseException e) {
View Full Code Here

        }
       
        if (_region.getOffset() > 0) {
            if (_document.getContentType(_region.getOffset() - 1).equals(TMLPartitionScanner.TML_TAG_START)) {
                try {
                    TMLRegion region = TMLRegion.parse(_document.getPartition(_region.getOffset() - 1), _document);
                    if (region.getTagName().equals("action")) {
                        _envFlags = _envFlags | ReflectionManager.ENV_ACTION;
                    } else if (region.getTagName().equals("eventscript")) {
                        _envFlags = _envFlags | ReflectionManager.ENV_EVENTSCRIPT;
                    }
                }
                catch (ParseException e) {
                    Plugin.getDefault().logWarning("Unable to define environment flags for tml script region", e);
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.editors.tml.TMLRegion

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.