• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DOMRegionContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.wst.xml.core.internal.regions.DOMRegionContext的典型用法代码示例。如果您正苦于以下问题:Java DOMRegionContext类的具体用法?Java DOMRegionContext怎么用?Java DOMRegionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DOMRegionContext类属于org.eclipse.wst.xml.core.internal.regions包,在下文中一共展示了DOMRegionContext类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: consumesElement

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private List<Position> consumesElement(IStructuredDocumentRegion region) {
	List<Position> positions = null;
	ITextRegionList regionList = region.getRegions();
	for (int i = 0; i < regionList.size(); i++) {
		ITextRegion textRegion = regionList.get(i);
		if (textRegion.getType().equals(DOMRegionContext.XML_TAG_NAME)) {
			Position position = new Position(
					region.getStartOffset(textRegion),
					textRegion.getLength());
			if (positions == null) {
				positions = new ArrayList<Position>();
			}
			positions.add(position);
		}
	}
	return positions;
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:18,代码来源:DirectiveSemanticHighlighting.java


示例2: computeRegionHelp

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
protected String computeRegionHelp(IndexedRegion treeNode,
		IDOMNode parentNode, IStructuredDocumentRegion flatNode,
		ITextRegion region, int documentPosition, IDocument document) {
	String result = null;
	if (region == null) {
		return null;
	}
	if (AngularDOMUtils.hasAngularNature(parentNode)) {
		String regionType = region.getType();
		if (regionType == DOMRegionContext.XML_CONTENT) {
			return computeAngularExpressionHelp((IDOMNode) treeNode,
					parentNode, flatNode, region, document,
					documentPosition);
		} else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
			return computeTagAttValueHelp((IDOMNode) treeNode, parentNode,
					flatNode, region, document, documentPosition);
		}
	}
	return super.computeRegionHelp(treeNode, parentNode, flatNode, region);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:21,代码来源:HTMLAngularTagInfoHoverProcessor.java


示例3: getMatchString

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
    if (aRegion == null || isCloseRegion(aRegion)) {
        return ""; //$NON-NLS-1$
    }
    String matchString = null;
    String regionType = aRegion.getType();
    if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
        matchString = ""; //$NON-NLS-1$
    }
    else if (regionType == DOMRegionContext.XML_CONTENT) {
        matchString = ""; //$NON-NLS-1$
    }
    else {
        if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
            matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
        }
        else {
            matchString = ""; //$NON-NLS-1$
        }
    }
    return matchString;
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:23,代码来源:SSTemplateCompletionProcessor.java


示例4: isCloseRegion

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private boolean isCloseRegion(ITextRegion region) {
    String type = region.getType();
    return ((type == DOMRegionContext.XML_PI_CLOSE) ||
            (type == DOMRegionContext.XML_TAG_CLOSE) ||
            (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
            (type == DOMRegionContext.XML_CDATA_CLOSE) ||
            (type == DOMRegionContext.XML_COMMENT_CLOSE) ||
            (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) ||
            (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) ||
            (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) ||
            (type == DOMRegionContext.XML_DECLARATION_CLOSE) ||
            (type == SilverStripeRegionContext.SS_CLOSE) ||
            (type == SilverStripeRegionContext.SS_END_CONTROL) ||
            (type == SilverStripeRegionContext.SS_END_IF) ||
            (type == SilverStripeRegionContext.SS_END_CACHEBLOCK) ||
            (type == SilverStripeRegionContext.SS_END_LOOP) ||
            (type == SilverStripeRegionContext.SS_END_UNCACHED) ||
            (type == SilverStripeRegionContext.SS_END_WITH) ||
            (type == SilverStripeRegionContext.SS_COMMENT_CLOSE));
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:21,代码来源:SSTemplateCompletionProcessor.java


示例5: getAttrByRegion

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
/**
 * Returns the SSE DOM Attribute {@link IDOMAttr} by region from the SSE DOM
 * element {@link IDOMElement}.
 * 
 * @param element
 *            the SSE DOM element {@link IDOMElement}.
 * @param region
 *            the region.
 * @return
 */
public static IDOMAttr getAttrByRegion(IDOMNode element, ITextRegion region) {
	if (!isAttrRegion(region)) {
		return null;
	}

	IStructuredDocumentRegion structuredDocumentRegionElement = element.getFirstStructuredDocumentRegion();

	// 1) Get attribute name region
	ITextRegionList elementRegions = structuredDocumentRegionElement.getRegions();
	int index = elementRegions.indexOf(region);
	if (index < 0) {
		return null;
	}

	ITextRegion attrNameRegion = null;
	while (index >= 0) {
		attrNameRegion = elementRegions.get(index--);
		if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
			break;
		}
	}
	if (attrNameRegion == null) {
		return null;
	}
	String attrName = structuredDocumentRegionElement.getText(attrNameRegion);
	return (IDOMAttr) element.getAttributes().getNamedItem(attrName);
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:38,代码来源:DOMUtils.java


示例6: isAttrRegion

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private static boolean isAttrRegion(ITextRegion region) {
	if (region == null) {
		return false;
	}
	String type = region.getType();
	return DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(type)
			|| DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(type)
			|| DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(type);
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:10,代码来源:DOMUtils.java


示例7: consumesElement

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private List<Position> consumesElement(IStructuredDocumentRegion region) {
	List<Position> positions = null;
	ITextRegionList regionList = region.getRegions();
	for (int i = 0; i < regionList.size(); i++) {
		ITextRegion textRegion = regionList.get(i);
		if (textRegion.getType().equals(DOMRegionContext.XML_TAG_NAME)) {
			Position position = new Position(region.getStartOffset(textRegion), textRegion.getLength());
			if (positions == null) {
				positions = new ArrayList<Position>();
			}
			positions.add(position);
		}
	}
	return positions;
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:16,代码来源:DirectiveSemanticHighlighting.java


示例8: isStyleElement

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
/**
 * Determines whether the given region is a UiBinder style element (opening or
 * closing) that can contain a CSS block.
 * 
 * @param styleElementRegion the region to check. If null, method returns
 *          false.
 */
private boolean isStyleElement(IStructuredDocumentRegion styleElementRegion) {
  if (styleElementRegion == null) {
    return false;
  }

  String uiBinderPrefix = null;
  ITextRegionList regions = styleElementRegion.getRegions();
  for (int i = 0; i < regions.size(); i++) {
    ITextRegion styleElementChildTextRegion = regions.get(i);
    if (styleElementChildTextRegion.getType().equals(
        DOMRegionContext.XML_TAG_NAME)) {

      // Ensure the namespace prefix and element name match
      if (uiBinderPrefix == null) {
        // Lazily fetch the prefix
        uiBinderPrefix = UiBinderXmlModelUtilities.resolveUiBinderNamespacePrefix(styleElementRegion.getParentDocument());
      }

      String tagName = styleElementRegion.getText(styleElementChildTextRegion);
      if (tagName.equalsIgnoreCase(uiBinderPrefix + ":"
          + UiBinderConstants.UI_BINDER_STYLE_ELEMENT_NAME)) {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:36,代码来源:StructuredTextPartitionerForUiBinderXml.java


示例9: computeCompletionProposals

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Override
protected ContentAssistRequest computeCompletionProposals(
		String matchString, ITextRegion completionRegion,
		IDOMNode treeNode, IDOMNode xmlnode,
		CompletionProposalInvocationContext context) {
	String regionType = completionRegion.getType();
	boolean isXMLContent = (regionType == DOMRegionContext.XML_CONTENT);
	if (isXMLContent && AngularDOMUtils.hasAngularNature(xmlnode)) {

		// completion for Angular expression {{}} inside text node.
		int documentPosition = context.getInvocationOffset();
		IStructuredDocumentRegion documentRegion = DOMUIUtils
				.getStructuredDocumentRegion(context.getViewer(),
						documentPosition);

		String match = null;
		AngularELRegion angularRegion = AngularRegionUtils
				.getAngularELRegion(documentRegion, documentPosition,
						DOMUtils.getFile(treeNode).getProject());
		if (angularRegion != null) {
			match = angularRegion.getExpression().substring(0,
					angularRegion.getExpressionOffset());
		}
		if (match != null) {
			ContentAssistRequest contentAssistRequest = new ContentAssistRequest(
					treeNode, treeNode.getParentNode(), documentRegion,
					completionRegion, documentPosition, 0, match);

			populateAngularProposals(contentAssistRequest, treeNode,
					context.getDocument(), AngularType.model, null);

			return contentAssistRequest;
		}
	}

	return super.computeCompletionProposals(matchString, completionRegion,
			treeNode, xmlnode, context);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:39,代码来源:HTMLAngularTagsCompletionProposalComputer.java


示例10: offsetBeforeStartEL

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Test
public void offsetBeforeStartEL() {
	AngularELRegion region = AngularRegionUtils.getAngularELRegion(
			DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 588,
			"{{", "}}");
	Assert.assertNull(region);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:8,代码来源:AngularRegionUtilsTest.java


示例11: offsetAfterStartEL

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Test
public void offsetAfterStartEL() {
	AngularELRegion region = AngularRegionUtils.getAngularELRegion(
			DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 590,
			"{{", "}}");
	Assert.assertNotNull(region);
	Assert.assertEquals("todo.text + to", region.getExpression());
	Assert.assertEquals(0, region.getExpressionOffset());
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:10,代码来源:AngularRegionUtilsTest.java


示例12: offsetBeforeEndEL

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Test
public void offsetBeforeEndEL() {
	AngularELRegion region = AngularRegionUtils.getAngularELRegion(
			DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 603,
			"{{", "}}");
	Assert.assertNotNull(region);
	Assert.assertEquals("todo.text + to", region.getExpression());
	Assert.assertEquals(13, region.getExpressionOffset());
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:10,代码来源:AngularRegionUtilsTest.java


示例13: offsetAfterEndEL

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Test
public void offsetAfterEndEL() {
	AngularELRegion region = AngularRegionUtils.getAngularELRegion(
			DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 604,
			"{{", "}}");
	Assert.assertNotNull(region);
	Assert.assertEquals("todo.text + to", region.getExpression());
	Assert.assertEquals(14, region.getExpressionOffset());
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:10,代码来源:AngularRegionUtilsTest.java


示例14: getAttrByRegion

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
/**
 * Returns the SSE DOM Attribute {@link IDOMAttr} by region from the SSE DOM
 * element {@link IDOMElement}.
 * 
 * @param element
 *            the SSE DOM element {@link IDOMElement}.
 * @param region
 *            the region.
 * @return
 */
public static IDOMAttr getAttrByRegion(IDOMNode element, ITextRegion region) {
	if (!isAttrRegion(region)) {
		return null;
	}

	IStructuredDocumentRegion structuredDocumentRegionElement = element
			.getFirstStructuredDocumentRegion();

	// 1) Get attribute name region
	ITextRegionList elementRegions = structuredDocumentRegionElement
			.getRegions();
	int index = elementRegions.indexOf(region);
	if (index < 0) {
		return null;
	}

	ITextRegion attrNameRegion = null;
	while (index >= 0) {
		attrNameRegion = elementRegions.get(index--);
		if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
			break;
		}
	}
	if (attrNameRegion == null) {
		return null;
	}
	String attrName = structuredDocumentRegionElement
			.getText(attrNameRegion);
	return (IDOMAttr) element.getAttributes().getNamedItem(attrName);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:41,代码来源:DOMUtils.java


示例15: getAngularELRegion

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
public static AngularELRegion getAngularELRegion(String regionType,
		String regionText, int regionStartOffset, int documentPosition,
		String startSymbol, String endSymbol) {
	int startOffset = documentPosition - regionStartOffset;
	if (startOffset < 0 || startOffset > regionText.length()) {
		return null;
	}
	if (regionType == DOMRegionContext.XML_CONTENT
			|| regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
		String expression = null;
		String text = regionText.substring(0, startOffset);
		int startExprIndex = text.lastIndexOf(startSymbol);
		if (startExprIndex != -1) {
			int endExprIndex = regionText.indexOf(endSymbol, startOffset);
			if (startExprIndex < endExprIndex) {
				// completion (for JSP) is done inside angular
				// expression {{
				expression = regionText.substring(startExprIndex
						+ startSymbol.length(), endExprIndex);
			}
		}
		if (expression != null) {
			int expressionOffset = startOffset - startExprIndex
					- startSymbol.length();
			return new AngularELRegion(expression, expressionOffset);
		}
	}
	return null;
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:30,代码来源:AngularRegionUtils.java


示例16: initRegionContextToStyleMap

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private void initRegionContextToStyleMap() {
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
	fContextToStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
	fContextToStyleMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);

	fContextToStyleMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);

	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);

	/*
	 * fContextToStyleMap.put(AngularRegionContext.ANGULAR_EXPRESSION_OPEN,
	 * IStyleConstantsForAngular.ANGULAR_EXPRESSION_BORDER);
	 * fContextToStyleMap.put(AngularRegionContext.ANGULAR_EXPRESSION_CLOSE,
	 * IStyleConstantsForAngular.ANGULAR_EXPRESSION_BORDER);
	 * fContextToStyleMap
	 * .put(AngularRegionContext.ANGULAR_EXPRESSION_CONTENT,
	 * IStyleConstantsForAngular.ANGULAR_EXPRESSION);
	 */
	// fContextToStyleMap.put(DOMRegionContext.XML_PI_OPEN,
	// IStyleConstantsXML.PI_BORDER);
	// fContextToStyleMap.put(DOMRegionContext.XML_PI_CONTENT,
	// IStyleConstantsXML.PI_CONTENT);
	// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_OPEN,
	// IStyleConstantsXML.CDATA_BORDER);
	// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_TEXT,
	// IStyleConstantsXML.CDATA_TEXT);
	// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE,
	// IStyleConstantsXML.CDATA_BORDER);
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:58,代码来源:HTMLAngularEditorSyntaxColoringPreferencePage.java


示例17: getElementTagRegions

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
/**
 * Finds the text regions (absolute positions within document) for the
 * element's start and end tags.
 * 
 * @param element the element whose tag regions are being found
 * @param includePrefix whether to include the namespace prefix in the regions
 * @return a non-null list of regions, with the start tag's region before the
 *         end tag's region (if there are two distinct tags)
 */
public static List<IRegion> getElementTagRegions(IDOMElement element,
    final boolean includePrefix) {
  final List<IRegion> regions = new ArrayList<IRegion>();
  final IStructuredDocument doc = element.getStructuredDocument();
  DomTextRegionVisitor visitor = new DomTextRegionVisitor() {
    public boolean visitDomTextRegion(IDOMNode node,
        IStructuredDocumentRegion domRegion, ITextRegion textRegion) {
      try {
        if (DOMRegionContext.XML_TAG_NAME.equals(textRegion.getType())) {
          // DOM region is relative to document, text region is relative to
          // the DOM
          int nameOffset = domRegion.getStartOffset() + textRegion.getStart();
          int nameLength = textRegion.getTextLength();

          if (!includePrefix) {
            // Lose the namespace prefix
            int unprefixedOffset = XmlUtilities.getUnprefixedOffset(doc.get(
                nameOffset, nameLength));
            nameOffset += unprefixedOffset;
            nameLength -= unprefixedOffset;
          }

          regions.add(new Region(nameOffset, nameLength));

          return false;
        }
      } catch (BadLocationException e) {
        // Ignore
      }

      return true;
    }
  };

  XmlUtilities.visitDomTextRegions(element,
      element.getFirstStructuredDocumentRegion(), visitor);
  XmlUtilities.visitDomTextRegions(element,
      element.getLastStructuredDocumentRegion(), visitor);

  return regions;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:51,代码来源:XmlUtilities.java


示例18: initRegionContextToStyleMap

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
private void initRegionContextToStyleMap() {
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN,
			IStyleConstantsXML.COMMENT_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT,
			IStyleConstantsXML.COMMENT_TEXT);
	fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE,
			IStyleConstantsXML.COMMENT_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_TAG_OPEN,
			IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN,
			IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME,
			IStyleConstantsXML.TAG_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME,
			IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS,
			IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE,
			IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
	fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE,
			IStyleConstantsXML.TAG_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE,
			IStyleConstantsXML.TAG_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_OPEN,
			IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE,
			IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION,
			IStyleConstantsXML.DECL_BORDER);
	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE,
			IStyleConstantsXML.DECL_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE,
			IStyleConstantsXML.ENTITY_REFERENCE);
	fContextToStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE,
			IStyleConstantsXML.ENTITY_REFERENCE);
	fContextToStyleMap.put(DOMRegionContext.XML_PE_REFERENCE,
			IStyleConstantsXML.ENTITY_REFERENCE);

	fContextToStyleMap.put(DOMRegionContext.XML_CONTENT,
			IStyleConstantsXML.XML_CONTENT);

	fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME,
			IStyleConstantsXML.DOCTYPE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION,
			IStyleConstantsXML.TAG_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE,
			IStyleConstantsXML.DECL_BORDER);

	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME,
			IStyleConstantsXML.DOCTYPE_NAME);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
	fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF,
			IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:63,代码来源:HTMLAngularEditorSyntaxColoringPreferencePage.java


示例19: test2

import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; //导入依赖的package包/类
@Test
public void test2() {
	AngularELRegion region = AngularRegionUtils.getAngularELRegion(
			DOMRegionContext.XML_CONTENT, "{{", 588, 604, "{{", "}}");
	Assert.assertNull(region);
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:7,代码来源:AngularRegionUtilsTest.java



注:本文中的org.eclipse.wst.xml.core.internal.regions.DOMRegionContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelectorList类代码示例发布时间:2022-05-23
下一篇:
Java HealthIndicatorAutoConfiguration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap