Examples of XmlAttributeValue


Examples of com.intellij.psi.xml.XmlAttributeValue

                // lets do some basic checks...
                PsiFile f = p.getOriginalFile();
                if (f.getFileType() == StdFileTypes.HTML) {
                    PsiElement psiElement = p.getOriginalPosition();
                    if (psiElement instanceof XmlToken) {
                        XmlAttributeValue wicketIdAttribute = getWicketIdAttribute((XmlToken) psiElement);
                        if (wicketIdAttribute != null) {
                            PsiClass clazz = ClassIndex.getAssociatedClass(f);
                            if (clazz != null) {
                                // ... before we search for our parent Item
                                String parentPath = HierarchyUtil.findPathOf(wicketIdAttribute, true);
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

    @Nullable
    private XmlAttributeValue getWicketIdAttribute(@NotNull XmlToken position) {
        if (!(position.getParent() instanceof XmlAttributeValue)) {
            return null;
        }
        XmlAttributeValue attributeValue = (XmlAttributeValue) position.getParent();
        if (!(attributeValue.getParent() instanceof XmlAttribute)) {
            return null;
        }
        XmlAttribute attribute = (XmlAttribute) attributeValue.getParent();
        return Constants.WICKET_ID.equals(attribute.getName()) ? attributeValue : null;
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

            file.accept(new XmlRecursiveElementVisitor() {
                @Override
                public void visitXmlAttribute(XmlAttribute attribute) {
                    super.visitXmlAttribute(attribute);
                    if (Constants.WICKET_ID.equals(attribute.getName())) {
                        XmlAttributeValue attributeValue = attribute.getValueElement();
                        if (attributeValue != null && hasReference(attributeValue, MarkupWicketIdReference.class)) {
                            HighlightInfo highlightInfo = createHighlightInfo(WicketForgeColorSettingsPage.HIGHLIGHT_MARKUPWICKETID, attributeValue.getTextRange());
                            if (highlightInfo != null) {
                                workList.add(highlightInfo);
                            }
                        }
                    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

    private boolean isWicketAttribute(XmlToken position) {
        if (!(position.getParent() instanceof XmlAttributeValue)) {
            return false;
        }
        XmlAttributeValue attributeValue = (XmlAttributeValue) position.getParent();
        if (!(attributeValue.getParent() instanceof XmlAttribute)) {
            return false;
        }
        XmlAttribute attribute = (XmlAttribute) attributeValue.getParent();
        String name = attribute.getName();
        return "key".equalsIgnoreCase(name);
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

            }

            @Override
            public void visitXmlAttribute(XmlAttribute attribute) {
                if (Constants.WICKET_ID.equals(attribute.getName())) {
                    XmlAttributeValue attributeValue = attribute.getValueElement();
                    if (attributeValue != null) {
                        String wicketId = attributeValue.getValue();
                        if (wicketId != null) {
                            MarkupWicketIdItem item = new MarkupWicketIdItem(wicketId, attribute, attributeValue);
                            current.addChild(item);
                            sb.append(Constants.HIERARCHYSEPARATOR).append(wicketId);
                            wicketIdPathMap.put(sb.toString(), item);
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

*/
public class MarkupWicketIdReferenceProvider extends PsiReferenceProvider {
    @NotNull
    @Override
    public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
        XmlAttributeValue attributeValue = (XmlAttributeValue) element;
        PsiElement parent = attributeValue.getParent();
        if (parent instanceof XmlAttribute && Constants.WICKET_ID.equals(((XmlAttribute) parent).getName())) {
            PsiFile psiFile = attributeValue.getContainingFile();
            if (psiFile != null) {
                if (WicketForgeFacet.hasFacetOrIsFromLibrary(element)) {
                    PsiClass psiClass = ClassIndex.getAssociatedClass(psiFile);
                    if (psiClass != null) {
                        return new PsiReference[] {new MarkupWicketIdReference(attributeValue, psiClass)};
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

        @Override
        public void visitXmlAttribute(XmlAttribute attribute) {
            super.visitXmlAttribute(attribute);

            if ("src".equals(attribute.getName())) {
                XmlAttributeValue attributeValue = attribute.getValueElement();
                if (attributeValue != null && StringUtil.isEmpty(attributeValue.getValue())) {
                    problemDescriptors.add(manager.createProblemDescriptor(attribute, "Empty src attribute will result in extra call to server",
                            (LocalQuickFix) null, ProblemHighlightType.GENERIC_ERROR, true));
                }
            }
        }
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

        return new XmlElementVisitor() {
            @Override
            public void visitXmlAttribute(XmlAttribute attribute) {
                super.visitXmlAttribute(attribute);
                if (Constants.WICKET_ID.equals(attribute.getName())) {
                    XmlAttributeValue attributeValue = attribute.getValueElement();
                    if (attributeValue != null && attributeValue.getTextLength() > 0) {
                        for (PsiReference reference : attributeValue.getReferences()) {
                            if (reference instanceof MarkupWicketIdReference && ((MarkupWicketIdReference) reference).multiResolve(false).length == 0) {
                                holder.registerProblem(holder.getManager().createProblemDescriptor(attributeValue, "Wicket id reference problem",
                                        (LocalQuickFix) null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, true));
                            }
                        }
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

    @Override
    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
      PsiElement element = descriptor.getPsiElement();
      if (element instanceof XmlAttributeValue) {
        final XmlAttributeValue value = (XmlAttributeValue)element;
        XmlTag tag = PsiTreeUtil.getParentOfType(value, XmlTag.class, false);

        final boolean inline = tag instanceof HtmlTag;

        final URL url = parseURL(value, myActionExtension);
View Full Code Here

Examples of com.intellij.psi.xml.XmlAttributeValue

    final StrutsModel strutsModel = strutsManager.getCombinedModel(psiElement);
    if (strutsModel == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    final XmlAttributeValue xmlAttributeValue = (XmlAttributeValue) psiElement;
    final String path = xmlAttributeValue.getValue();

    // resolve to <action>
    final String actionName = TaglibUtil.trimActionPath(path);
    final String namespace = getNamespace(xmlAttributeValue);
    final List<Action> actions = strutsModel.findActionsByName(actionName, namespace);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.