protected NamespaceInfo createNamespaceInfo() { NamespaceInfo info = new NamespaceInfo(); namespaceInfoList.add(info); return info; } }
public static List cloneNamespaceInfoList(List oldList) { List newList = new Vector(oldList.size()); for (Iterator i = oldList.iterator(); i.hasNext(); ) { NamespaceInfo oldInfo = (NamespaceInfo)i.next(); newList.add(new NamespaceInfo(oldInfo)); } return newList; } }
public void addNoNamespaceSchemaLocation(String locationHint) { NamespaceInfo nsInfo = new NamespaceInfo(); nsInfo.prefix = null; nsInfo.uri = ""; //$NON-NLS-1$ nsInfo.locationHint = locationHint; internalAddNamespaceInfo("", nsInfo); //$NON-NLS-1$ }
protected void addBuiltInNamespaces(List list) { String xsiNamespace = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$ String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$ if (!isAlreadyDeclared(xsiNamespace)) { list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema-instance", "xsi", null)); //$NON-NLS-1$ //$NON-NLS-2$ } if (!isAlreadyDeclared(xsdNamespace)) { list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema", "xsd", null)); //$NON-NLS-1$ //$NON-NLS-2$ } }
public void addNamespaceInfo(String prefix, String uri, String locationHint) { NamespaceInfo nsInfo = new NamespaceInfo(); nsInfo.prefix = prefix; nsInfo.uri = uri; nsInfo.locationHint = locationHint; internalAddNamespaceInfo(prefix != null ? prefix : "", nsInfo); //$NON-NLS-1$ }
protected void createAnyElementNode(CMAnyElement anyElement) { String uri = anyElement.getNamespaceURI(); if ((uri != null) && !uri.startsWith("##")) //$NON-NLS-1$ { if (table.get(uri) == null) { NamespaceInfo info = new NamespaceInfo(); info.uri = uri; info.prefix = "p" + count++; //$NON-NLS-1$ table.put(uri, info); list.add(info); } } } }
protected void addNamespaceInfoList(List list, boolean isImplied) { if (list != null) { for (Iterator i = list.iterator(); i.hasNext(); ) { NamespaceInfo info = (NamespaceInfo)i.next(); NamespaceInfo clone = new NamespaceInfo(info); if (isImplied) { clone.setProperty("isImplied", "true"); //$NON-NLS-1$ //$NON-NLS-2$ } addNamespaceInfo(clone); } } }
public void performNew() { NamespaceInfo info = new NamespaceInfo(); EditNamespaceInfoDialog dialog = invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, info); if (dialog.getReturnCode() == Window.OK) { namespaceInfoList.add(info); performDelayedUpdate(); } }
public List getNamespaceInfoList() { List list = new ArrayList(); if (radio1.getSelection()) { TableItem[] items = tableViewer.getTable().getItems(); for (int i = 0; i < items.length; i++) { TableItem item = items[i]; if (item.getChecked()) { list.add(item.getData()); } } } else { NamespaceInfo info = new NamespaceInfo(); info.prefix = editNamespaceControl.prefixField.getText(); info.uri = editNamespaceControl.uriField.getText(); info.locationHint = editNamespaceControl.locationHintField.getText(); list.add(info); } return list; }
void updateTargetNamespaceAndNamespaceInfo(String oldTargetNamespace, String newTargetNamespace) { NamespaceInfo info = getNamespaceInfo(newTargetNamespace); if (info == null) { info = getNamespaceInfo(oldTargetNamespace); if (info == null) { info = new NamespaceInfo(newTargetNamespace, "tns", null); //$NON-NLS-1$ namespaceInfoList.add(info); } else { info.uri = targetNamespace; } } tableViewer.refresh(); } }
public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI) { NamespaceInfo nsInfo = new NamespaceInfo(); nsInfo.prefix = namespacePrefix; nsInfo.uri = namespaceURI; NamespaceInfo matchingNamespaceInfo = getNamespaceInfoForURI(namespaceURI); if (matchingNamespaceInfo != null) { nsInfo.locationHint = matchingNamespaceInfo.locationHint; } internalAddNamespaceInfo(namespacePrefix, nsInfo); super.visitXMLNamespaceAttribute(attr, namespacePrefix, namespaceURI); }
protected void addCatalogMapToList(ICatalog catalog, List list) { ICatalogEntry[] entries = catalog.getCatalogEntries(); for (int i = 0; i < entries.length; i++) { ICatalogEntry entry = entries[i]; if ((entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) && entry.getURI().endsWith(".xsd")) { //$NON-NLS-1$ if (!isAlreadyDeclared(entry.getKey())) { NamespaceInfo namespaceInfo = new NamespaceInfo(entry.getKey(), "xx", null); //$NON-NLS-1$ list.add(namespaceInfo); } } } }
/** Create a namespace prefix if needed, other wise retrieve * a predefined namespace prefix * @return */ private String handleNamespacePrefices() { Element schemaElement = component.getSchema().getElement(); String prefix = null; // If target namespace of the attribute already exists List namespacePrefices = manager.getNamespaceInfoList(schemaElement); for (int i = 0; i < namespacePrefices.size(); i++){ NamespaceInfo info = (NamespaceInfo) namespacePrefices.get(i); if ( info.uri.equals(attribute.getTargetNamespace())) { prefix = info.prefix; } } // Create unquie namespace prefix if ( prefix == null){ prefix = createUniquePrefix(component); } NamespaceInfo info = new NamespaceInfo(attribute.getTargetNamespace(), prefix, ""); //$NON-NLS-1$ List infoList = new ArrayList(1); infoList.add(info); manager.addNamespaceInfo(schemaElement, infoList, false); return prefix; }
NamespaceInfo oldCopy = new NamespaceInfo(info); info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
NamespaceInfo oldCopy = new NamespaceInfo(info); info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$