use of org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry in project webtools.sourceediting by eclipse.
the class ContentSettingsRegistry method getSystemIdFrom.
public static String getSystemIdFrom(String publicId) {
if (publicId == null || publicId.length() == 0)
return null;
HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
Enumeration e = reg.getEntries();
while (e.hasMoreElements()) {
HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
if (entry.getPublicId().equals(publicId))
return entry.getSystemId();
}
return null;
}
use of org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry in project webtools.sourceediting by eclipse.
the class WebContentSettingsPropertyPage method getSystemIdFrom.
private String getSystemIdFrom(String publicId) {
if (publicId == null || publicId.length() == 0)
return null;
HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
Enumeration e = reg.getEntries();
while (e.hasMoreElements()) {
HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
if (entry.getPublicId().equals(publicId))
return entry.getSystemId();
}
return null;
}
use of org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry in project webtools.sourceediting by eclipse.
the class WebContentSettingsPropertyPage method populateDoctypeValues.
private void populateDoctypeValues() {
fDocumentTypeIds = new ArrayList();
// add none first
fDocumentTypeCombo.add(SELECT_NONE);
fDocumentTypeIds.add(null);
HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
Enumeration e = reg.getEntries();
while (e.hasMoreElements()) {
HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
String publicId = entry.getPublicId();
String displayName = entry.getDisplayName();
displayName = displayName != null ? displayName : publicId;
fDocumentTypeCombo.add(displayName);
fDocumentTypeIds.add(publicId);
if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length()) {
maxLengthStringInHTMLDocumentTypeRegistry = displayName;
}
if (entry.getSystemId() == null)
// if HTML entry
continue;
if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
}
}
use of org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry in project webtools.sourceediting by eclipse.
the class ContentSettingsRegistry method setHTMLDocumentTypeRegistryInto.
public static void setHTMLDocumentTypeRegistryInto(ComboList combo) {
// $NON-NLS-1$
combo.add(NONE, "");
HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
Enumeration e = reg.getEntries();
while (e.hasMoreElements()) {
HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
String publicId = entry.getPublicId();
String displayName = entry.getDisplayName();
if (displayName != null) {
combo.add(displayName, publicId);
if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
maxLengthStringInHTMLDocumentTypeRegistry = displayName;
} else
combo.add(publicId, publicId);
if (publicId.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
maxLengthStringInHTMLDocumentTypeRegistry = publicId;
if (entry.getSystemId() == null)
// if HTML entry
continue;
if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
}
combo.sortByKey(1);
}
Aggregations