Package com.intellij.util.xml

Examples of com.intellij.util.xml.DomElement


*/
public class GlobalExceptionMappingResultResolveConverter extends ResolvingConverter<GlobalResult> {

  @NotNull
  public Collection<? extends GlobalResult> getVariants(final ConvertContext context) {
    final DomElement invocationElement = context.getInvocationElement();
    final StrutsPackage strutsPackage = invocationElement.getParentOfType(StrutsPackage.class, true);
    if (strutsPackage != null) {
      return strutsPackage.getGlobalResults().getResults();
    }

    return Collections.emptySet();
View Full Code Here


        return getElement();
      }

      @NotNull
      public Object[] getVariants() {
        final DomElement invocationElement = convertContext.getInvocationElement();
        final Action action = invocationElement.getParentOfType(Action.class, true);
        assert action != null;

        final PsiClass psiClass = action.searchActionClass();
        if (psiClass == null) {
          return EMPTY_ARRAY;
View Full Code Here

   * @param context Current context.
   * @return Action-element.
   */
  @NotNull
  private static Action getActionElement(final ConvertContext context) {
    final DomElement domElement = context.getInvocationElement();
    final Action action = domElement.getParentOfType(Action.class, false);
    assert action != null : "not triggered within <action> for " + domElement.getXmlElement();
    return action;
  }
View Full Code Here

*/
public class ExceptionMappingResultResolveConverter extends ResolvingConverter<HasResultType> {

  @NotNull
  public Collection<? extends HasResultType> getVariants(final ConvertContext context) {
    final DomElement invocationElement = context.getInvocationElement();
    final Action action = invocationElement.getParentOfType(Action.class, true);
    if (action == null) {
      return Collections.emptySet();
    }

    final List<HasResultType> variants = new ArrayList<HasResultType>();
View Full Code Here

   * @param context Current context.
   * @return Action-element.
   */
  @NotNull
  private static Action getActionElement(final ConvertContext context) {
    final DomElement domElement = context.getInvocationElement();
    final Action action = domElement.getParentOfType(Action.class, false);
    assert action != null : "not triggered within <action> for " + domElement.getXmlElement();
    return action;
  }
View Full Code Here

                                      @NotNull final ElementDescriptionLocation elementDescriptionLocation) {
    if (elementDescriptionLocation != StrutsTreeDescriptionLocation.INSTANCE) {
      return null;
    }

    final DomElement domElement = DomUtil.getDomElement(psiElement);
    if (domElement == null) {
      return null;
    }

    return getElementDescription(domElement);
View Full Code Here

    return isDomElementOfKind(element, alwaysLeaf);
  }

  private static boolean isDomElementOfKind(final StructureViewTreeElement element,
                                            final Class... kinds) {
    final DomElement domElement = ((DomStructureTreeElement)element).getElement();
    for (final Class clazz : kinds) {
      if (clazz.isInstance(domElement)) {
        return true;
      }
    }
View Full Code Here

    PsiElement parent = context.getParent();
    if (parent instanceof XmlAttribute) {
      String name = ((XmlAttribute)parent).getLocalName();
      if ("expression".equals(name) || "templateExpression".equals(name)) {
        DomElement domElement = DomManager.getDomManager(context.getProject()).getDomElement((XmlTag)parent.getParent());
        if (domElement instanceof Put || domElement instanceof Add || domElement instanceof Definition) {
          final TextRange attributeTextRange = ElementManipulators.getValueTextRange(context);
          final TextRange ognlTextRange = TextRange.from(attributeTextRange.getStartOffset() + OGNL_PREFIX.length(),
                                                         attributeTextRange.getLength() - OGNL_PREFIX.length());
          registrar.startInjecting(OgnlLanguage.INSTANCE)
View Full Code Here

   * @return null if no errors.
   */
  @Nullable
  @Override
  public TextAttributesKey getTextAttributesKey() {
    final DomElement element = getElement();
    if (!element.isValid()) {
      return null;
    }

    final XmlTag tag = element.getXmlTag();
    if (tag == null) {
      return null;
    }

    final DomElementsProblemsHolder holder = DomElementAnnotationsManager.getInstance(tag.getProject())
View Full Code Here

  }


  @NotNull
  public TreeElement[] getChildren() {
    final DomElement element = getElement();
    if (!element.isValid()) {
      return EMPTY_ARRAY;
    }

    final List<TreeElement> result = new SmartList<TreeElement>();
    DomUtil.acceptAvailableChildren(element, new DomElementVisitor() {
View Full Code Here

TOP

Related Classes of com.intellij.util.xml.DomElement

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.