Package com.volantis.mcs.eclipse.ab.editors.xml.schema

Examples of com.volantis.mcs.eclipse.ab.editors.xml.schema.ElementDefinition


                                    null);
                        }
                    } else {
                        // We are trying to complete something other than the
                        // close element markup
                        ElementDefinition element =
                            schema.getElementDefinition(elementName);
                        matchName = localMatchName(matchName,
                                                   ic.isAttribute(),
                                                   prefix);

                        // If an element definition cannot be found for the
                        // containing element, or we can't derive a local match
                        // name from the input context we can't do completions
                        if ((element != null) && (matchName != null)) {
                            List options = new ArrayList();

                            if (ic.isAttribute()) {
                                List attributes =
                                    element.getAttributeDefinitions(matchName);
                                AttributeDefinition attribute;

                                for (int i = 0;
                                     i < attributes.size();
                                     i++) {
                                    attribute =
                                        (AttributeDefinition)attributes.get(i);

                                    options.add(attribute.getName());
                                }
                            } else {
                                List subElements =
                                    element.getSubElementNames(matchName);

                                options.addAll(subElements);
                            }

                            if (options.size() != 0) {
View Full Code Here


            if (attributes) {
                replace = option + "=\"\""; //$NON-NLS-1$
                cursorPos = option.length() + 2;
            } else {
                // Firstly, find out if there are any (mandatory) attributes
                ElementDefinition element =
                    schema.getElementDefinition(option);
                List attrs = element.getAttributeDefinitions(null);
                String prefixedName = qName(prefix, option);
                StringBuffer sb = new StringBuffer(prefixedName.length() * 4);
                boolean hasMandatoryAttributes = false;

                // Determine if the element may have content.
                // NOTE: This assumes content is sub-elements only and doesn't
                // account for textual content.
                boolean hasContent = element.hasSubElements();

                // The replacement will always start with the prefixed name
                sb.append(prefixedName);

                for (int j = 0;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.ab.editors.xml.schema.ElementDefinition

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.