Examples of XmlAttributeImpl


Examples of com.alexgilleran.icesoap.xml.impl.XMLAttributeImpl

    super(NAMESPACE, NAME);
  }

  @Override
  protected XMLAttributeImpl constructObject(String namespace, String name) {
    return new XMLAttributeImpl(namespace, name, VALUE);
  }
View Full Code Here

Examples of com.alexgilleran.icesoap.xml.impl.XMLAttributeImpl

    // Assert that there are no attributes to start with
    assertEquals(0, getXMLObject().getAttributes().size());

    // Make a set of sample data
    Set<XMLAttribute> attributes = new HashSet<XMLAttribute>();
    attributes.add(new XMLAttributeImpl(testNsUrl1, testName1, testValue1));
    attributes.add(new XMLAttributeImpl(testNsUrl2, testName2, testValue2));
    attributes.add(new XMLAttributeImpl(testNsUrl3, testName3, testValue3));

    // Add the same values from the sample data to the XML Object
    getXMLObject().declarePrefix(testNsPrefix1, testNsUrl1);
    getXMLObject().addAttribute(testNsUrl1, testName1, testValue1);
    getXMLObject().declarePrefix(testNsPrefix2, testNsUrl2);
View Full Code Here

Examples of com.intellij.psi.impl.source.xml.XmlAttributeImpl

        new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(editor.getProject(), editor);
    }

    private TextRange getRangeFromToken(XmlTokenImpl token, CaretModel caretModel, String direction){
        XmlAttributeImpl attribute = getAttributeFromToken(token);

        if (RIGHT.equals(direction)){
            //account for namespace
            if (token.getTokenType() == XmlTokenType.XML_NAME){
                //special case for namespace
                if (attribute.isNamespaceDeclaration()){

                    String namespacePrefix = attribute.getNamespacePrefix();
                    String localName = attribute.getLocalName();
                    int textOffset = attribute.getFirstChild().getTextOffset();
                    int localNameOffset = textOffset + namespacePrefix.length() + 1;

                    //the caret is on the prefix, so go to the local name
                    if (caretModel.getOffset() < localNameOffset){
                        return new TextRange(localNameOffset, localNameOffset + localName.length());
                    }

                    PsiElement attributeValue = attribute.getLastChild().getChildren()[1];
                    return attributeValue.getTextRange();
                }
                //just a plain attribute (not a namespace)
                else{
                    //the caret is either on the namespace or it's not a namespace, so go to the value
                    PsiElement attributeValue = attribute.getLastChild();
                    PsiElement valueToken = attributeValue.getChildren()[1];
                    return valueToken.getTextRange();
                }
            }
            //the caret is on the attribute value
            else if (token.getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN){
                //Don't forget the whitespace!
                PsiElement whiteSpace = attribute.getNextSibling();
                attribute = (XmlAttributeImpl) whiteSpace.getNextSibling();
                //you've moved to the attribute name of the next attribute
                if (attribute.isNamespaceDeclaration()){
                    String namespacePrefix = attribute.getNamespacePrefix();
                    int textOffset = attribute.getFirstChild().getTextOffset();
                    int localNameOffset = textOffset + namespacePrefix.length() + 1;

                    //time to select the prefix
                    if (caretModel.getOffset() < localNameOffset){
                        return new TextRange(textOffset, textOffset + namespacePrefix.length());
                    }
                }

                //just return the attribute name
                return attribute.getFirstChild().getTextRange();
            }

        }
        else if (LEFT.equals(direction)){
            //special case for namespace
            if (attribute.isNamespaceDeclaration()){
                String namespacePrefix = attribute.getNamespacePrefix();
                String localName = attribute.getLocalName();
                int textOffset = attribute.getFirstChild().getTextOffset();
                int localNameOffset = textOffset + namespacePrefix.length() + 1;

                //the caret is on the prefix, so go to the local name
                if (caretModel.getOffset() < localNameOffset){
                    return new TextRange(localNameOffset, localNameOffset + localName.length());
View Full Code Here

Examples of org.apache.axis2.rmi.metadata.xml.impl.XmlAttributeImpl

    }

    public void generateSchema(Configurator configurator, Map schemaMap)
            throws SchemaGenerationException {
        super.generateSchema(configurator, schemaMap);
        this.attribute = new XmlAttributeImpl(this.getPropertyDescriptor().getPropertyType().isPrimitive());
        this.attribute.setName(this.name);
        this.attribute.setNamespace(this.namespace);
        this.attribute.setType(this.type.getXmlType());
        this.attribute.setRequired(this.isRequried);
    }
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.