private void processNextCatalogs(ICatalog catalog, Element parent) { // handle catalog entries INextCatalog[] nextCatalogs = catalog.getNextCatalogs(); Element childElement = null; //dw String attrValue = null; for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog delegate = nextCatalogs[i]; childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_NEXT_CATALOG); if (childElement != null) { parent.appendChild(childElement); String location = delegate.getCatalogLocation(); if (location != null) { childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, location); } String id = delegate.getId(); if (id != null) { childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id); } } } }
private void processNextCatalogElements(IConfigurationElement[] childElementList) { if (catalog == null) return; for (int i = 0; i < childElementList.length; i++) { IConfigurationElement childElement = childElementList[i]; String location = childElement.getAttribute(OASISCatalogConstants.ATTR_CATALOG); // mandatory if (location == null || location.equals("")) //$NON-NLS-1$ { Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_next_catalog_location_uri_not_set); continue; } INextCatalog nextCatalog = new NextCatalog(); String resolvedPath = resolvePath(location); nextCatalog.setCatalogLocation(resolvedPath); String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); if (id != null && !id.equals("")) //$NON-NLS-1$ { nextCatalog.setId(id); } catalog.addCatalogElement(nextCatalog); } }
public Object[] getChildren(Object parentElement) { Object[] result = new Object[0]; if (parentElement == roots[0]) { result = getChildrenHelper(fWorkingUserCatalog); } else if (parentElement == roots[1]) { result = getChildrenHelper(fSystemCatalog); } else if (parentElement instanceof INextCatalog) { ICatalog nextCatalog = ((INextCatalog) parentElement).getReferencedCatalog(); result = getChildrenHelper(nextCatalog); } return result; }
public String getText(Object object) { String result = null; if (object instanceof ICatalogEntry) { ICatalogEntry catalogEntry = (ICatalogEntry) object; result = catalogEntry.getKey(); // result = URIHelper.removePlatformResourceProtocol(result); } else if (object instanceof INextCatalog) { INextCatalog nextCatalog = (INextCatalog) object; // result = nextCatalog.getCatalogLocation(); result = URIUtils.convertURIToLocation(nextCatalog.getCatalogLocation()); if (nextCatalog.getCatalogLocation().startsWith("file:")) { result += " (" + XMLCatalogMessages.UI_LABEL_FILE_SYSTEM_RESOURCE + ")"; } else if (nextCatalog.getCatalogLocation().startsWith("platform:")) { result += " (" + XMLCatalogMessages.UI_LABEL_PLATFORM_RESOURCE + ")"; } } return result != null ? result : object.toString(); }
public void saveData() { getNextCatalog().setCatalogLocation(URIUtils.convertLocationToURI(catalogLocationField.getText())); }
public XMLCatalogPreferencePage() { defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) { userCatalog = referencedCatalog; } } } }
public void setCatalogElement(INextCatalog nextCatalog) { String value = getDisplayValue(nextCatalog != null ? nextCatalog.getCatalogLocation() : ""); //$NON-NLS-1$ String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t" + value; //$NON-NLS-1$ String line0 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t" + URIUtils.convertURIToLocation(value); String entireString = "\n" + line0 + "\n" + line1; //$NON-NLS-1$ detailsText.setText(entireString); }
private void retrieveCatalog() { if (systemCatalog != null) return; ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } } } }
catalogLocationField.setText(URIUtils.convertURIToLocation(getDisplayValue(getNextCatalog().getCatalogLocation())));
private void retrieveCatalog() { if (systemCatalog != null) return; ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } } } }
public SelectFromCatalogDialog(Shell parentShell) { super(parentShell); defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) { userCatalog = referencedCatalog; } } } }
for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
ICatalog catalog = nextCatalogs[nextCatalog].getReferencedCatalog(); ICatalogEntry[] entries2 = catalog.getCatalogEntries(); for (int entry = 0; entry < entries2.length; entry++) {
ICatalog catalog = nextCatalog.getReferencedCatalog(); if (catalog != null)
protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); addNamespacesControl = new CommonAddNamespacesControl(dialogArea, SWT.NONE, resourceLocation); List list = new ArrayList(); addBuiltInNamespaces(list); ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) { ICatalog userCatalog = referencedCatalog; addCatalogMapToList(userCatalog, list); } else if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { ICatalog systemCatalog = referencedCatalog; addCatalogMapToList(systemCatalog, list); } } } computeAddablePrefixes(list, existingNamespaces); addNamespacesControl.setNamespaceInfoList(list); return dialogArea; }