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 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 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); } } } }
catalogLocationField.setText(URIUtils.convertURIToLocation(getDisplayValue(getNextCatalog().getCatalogLocation())));