/** * Register a component under the specified id. The method checks that the * id is known to the HelpSet's map. * * @param component * @param id */ public static void registerComponent(Component component, final String id) { logger.info("Attempting to register " + id); initialize(); String normalizedId = normalizeString(id.toLowerCase()); if (idMap.containsKey(component)) { logger.info("Registered " + normalizedId); } else { // If Workbench is started up while there is no network connection - // hs.getLocalMap() is null for some reason if (hs != null && hs.getLocalMap()!= null && hs.getLocalMap().isValidID(normalizedId, hs)) { idMap.put(component, normalizedId); logger.info("Registered " + normalizedId); } else { logger.info("Refused to register component as " + normalizedId + " - not in map"); } } }
connection.connect(); hs = new HelpSet(null, new URL(externalHelpSetURL)); if (hs.getLocalMap() == null) { hs = null; logger.error("Helpset from " + externalHelpSetURL + " local map was null");
/** * Register a component under the specified id. The method checks that the * id is known to the HelpSet's map. * * @param component * @param id */ public static void registerComponent(Component component, final String id) { logger.info("Attempting to register " + id); initialize(); String normalizedId = normalizeString(id.toLowerCase()); if (idMap.containsKey(component)) { logger.info("Registered " + normalizedId); } else { if (hs.getLocalMap().isValidID(normalizedId, hs)) { idMap.put(component, normalizedId); logger.info("Registered " + normalizedId); } else { logger.info("Refused to register component as " + normalizedId + " - not in map"); } } }
/** * return the content URL in String form for a given IndexItem * * returns an empty String if no content exists. */ private String getContentURL(IndexItem item) { URL url = null; ID id = item.getID(); if (id != null) { HelpSet hs = id.hs; Map map = hs.getLocalMap(); try { url = map.getURLFromID(id); } catch (MalformedURLException e) { // just ignore } } if (url == null) { return ""; } return url.toExternalForm(); }
/** * return the content URL in String form for a given TOCItem * * returns an empty String if no content exists. */ private String getContentURL(TOCItem item) { URL url = null; ID id = item.getID(); if (id != null) { HelpSet hs = id.hs; Map map = hs.getLocalMap(); try { url = map.getURLFromID(id); } catch (MalformedURLException e) { // just ignore } } if (url == null) { return ""; } return url.toExternalForm(); }
/** * return the icon URL in String form for a given TOCItem * * returns empty String if no content exists. */ private String getIconURL(NavigatorView view) { URL url = null; ID id = view.getImageID(); if (id != null) { HelpSet hs = id.hs; Map map = hs.getLocalMap(); try { url = map.getURLFromID(id); } catch (MalformedURLException e) { // just ignore } } if (url == null) { return ""; } return url.toExternalForm(); } }
} else { String className = working.getClass().getCanonicalName(); if (hs.getLocalMap().isValidID(className, hs)) { result = className; found = true;
} else { String className = working.getClass().getCanonicalName(); if (hs.getLocalMap().isValidID(className, hs)) { result = className; found = true;
possibility = className + "-" + possibility; logger.info("Possibility is " + possibility); if (hs.getLocalMap().isValidID(possibility, hs)) { result = possibility; logger.info("Accepted tree node " + result); } else { if (hs.getLocalMap().isValidID(className, hs)) { result = className; logger.info("Found tree node class name " + result);
possibility = className + "-" + possibility; logger.info("Possibility is " + possibility); if (hs.getLocalMap().isValidID(possibility, hs)) { result = possibility; logger.info("Accepted tree node " + result); } else { if (hs.getLocalMap().isValidID(className, hs)) { result = className; logger.info("Found tree node class name " + result);
for (Object idAsObject : Collections.list(hs.getLocalMap().getAllIDs())) { final ID id = (ID) idAsObject; String stringId = id.getIDString();
url = map.getURLFromID(ident); } else { Map hsmap = hs.getLocalMap(); url = hsmap.getURLFromID(ident);
Map map = hs.getLocalMap(); try { url = map.getURLFromID(id);
try { Map map = new FlatMap(new URL(hsURL, spec), hs); Map omap = hs.getLocalMap(); if (omap == null) { debug("map is null");