/** * CMNodeWrapper constructor comment. */ public CMNodeWrapperImpl(String prefix, CMNode node) { super(); fPrefix = prefix; fNode = node; fNodeName = fPrefix + ":" + fNode.getNodeName(); //$NON-NLS-1$ }
private CMElementDeclaration getSelf() { if (self.getNodeType() != CMNode.ELEMENT_DECLARATION) return null; return (CMElementDeclaration) self; }
public String getProperty(CMNode cmNode, String propertyName) { String result = null; String cmNodeSpec = (String) cmNode.getProperty("spec"); //$NON-NLS-1$ if (cmNodeSpec == null) { cmNodeSpec = cmNode.getNodeName(); } if (cmNodeSpec != null) { result = getProperty(cmNodeSpec, propertyName); } return result; }
private boolean shouldIgnoreCase(CMNode cmnode) { if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)) return false; return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue(); } }
switch (cmNode.getNodeType()) list.add("\"" + cmNode.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ break;
/** * */ public String getLabel(Node parent, CMNode cmnode) { String result = "?" + cmnode + "?"; //$NON-NLS-1$ //$NON-NLS-2$ if (cmnode != null) { result = cmnode.getNodeName(); if(result == null) { result = (String) cmnode.getProperty("description"); //$NON-NLS-1$ } if (result == null || result.length() == 0) { if (cmnode.getNodeType() == CMNode.GROUP) { CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder(); result = descriptionBuilder.buildDescription(cmnode); } else { result = DOMNamespaceHelper.computeName(cmnode, parent, null); } } } return result; }
protected boolean isAbstract(CMNode ed) { boolean result = false; if (ed != null) { Object value = ed.getProperty("Abstract"); //$NON-NLS-1$ result = (value == Boolean.TRUE); } return result; }
/** * supports method * @return boolean * * Returns true if the CMNode supports a specified property * */ public boolean supports(String propertyName) { return fNode.supports(propertyName); } }
public List getDataTypeValues(Element element, CMNode cmNode) { List list = new ArrayList(); String contentTypeId = getContentTypeId(element); String namespace = getNamespace(cmNode); String name = cmNode.getNodeName(); for (Iterator i = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, namespace).iterator(); i.hasNext();) { ModelQueryExtension extension = (ModelQueryExtension)i.next(); String[] values = null; if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) { values = extension.getAttributeValues(element, namespace, name); } else { values = extension.getElementValues(element, namespace, name); } if (values != null) { list.addAll(Arrays.asList(values)); } } return list; }
/** * getProperty method * @return java.lang.Object * * Returns the object property desciped by the propertyName * */ public Object getProperty(String propertyName) { return fNode.getProperty(propertyName); }
public Object getProperty(String propertyName) { if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) { return new Boolean(!isXHTML); } if (propertyName.equals(HTMLCMProperties.IS_XHTML)) { return new Boolean(isXHTML); } if (buddy == null || (!buddy.supports(propertyName))) return null; return buddy.getProperty(propertyName); } }
public boolean supports(String propertyName) { if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) return true; if (propertyName.equals(HTMLCMProperties.IS_XHTML)) return true; if (buddy == null) return false; return buddy.supports(propertyName); }
public String getNodeName() { return self.getNodeName(); }
/** * getNodeType method * @return int * * Returns one of : * */ public int getNodeType() { return fNode.getNodeType(); }
protected String getKey(CMNode cmNode) { String key = cmNode.getNodeName(); CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ if (namespaceURI != null) { key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$ } } return key; }
if (node.getNodeType() == CMNode.ELEMENT_DECLARATION) { CMElementDeclaration ed = (CMElementDeclaration) node; sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Element____1 + SPACE + BOLD_END); sb.append(node.getNodeName()); sb.append(PARAGRAPH_END); printDocumentation(sb, node); else if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) { CMAttributeDeclaration ad = (CMAttributeDeclaration) node; sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Attribute____3 + SPACE + BOLD_END); sb.append(node.getNodeName()); sb.append(PARAGRAPH_END); printDocumentation(sb, node); else if (node.getNodeType() == CMNode.DATA_TYPE) { sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END); sb.append(node.getNodeName()); sb.append(PARAGRAPH_END); printDocumentation(sb, node);
/** * Adds the tag info property of the CMNode to the string buffer, sb * */ protected void printTagInfo(StringBuffer sb, CMNode node) { String tagInfo = (String) node.getProperty("tagInfo"); //$NON-NLS-1$ if (tagInfo != null) { sb.append(PARAGRAPH_START + tagInfo.trim() + PARAGRAPH_END); } } }
public void put(CMNode cmNode) { table.put(cmNode.getNodeName(), cmNode); } }
private CMAttributeDeclaration getDecl(CMNode cmnode) { if (cmnode == null) return null; if (cmnode.getNodeType() != CMNode.ATTRIBUTE_DECLARATION) return null; return (CMAttributeDeclaration) cmnode; } }
public static String computeName(CMNode cmNode, Node parent, String prefix, NamespaceTable namespaceTable) String result = cmNode.getNodeName(); String qualification = (String)cmNode.getProperty("http://org.eclipse.wst/cm/properties/nsPrefixQualification"); //$NON-NLS-1$ CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null)