/** * The map for this HelpSet. This map involves the closure of * this HelpSet's children HelpSets. * * @return The map */ public Map getCombinedMap() { if (combinedMap == null) { combinedMap = new TryMap(); if (map != null) { combinedMap.add(map); // the local map } for (Enumeration e = helpsets.elements(); e.hasMoreElements(); ) { HelpSet hs = (HelpSet) e.nextElement(); combinedMap.add(hs.getCombinedMap()); } } return combinedMap; }
/** * Determines if the ID is valid (known to in the project file). * * @param id The ID to check. A null ID is a valid parameter * @param hs The HelpSet against which to resolve the string. * @return True if id is valid, false if not valid. */ public boolean isValidID(String id, HelpSet hs) { debug("isValidID "+id); for (Enumeration e = maps.elements(); e.hasMoreElements();) { Map m = (Map) e.nextElement(); if (m.isValidID(id, hs)) { return true; } } return false; }
/** * This methods creates a HelpSet based upon, in priority, the external * HelpSet, the backup HelpSet a newly created empty HelpSet. */ public static void initialize() { if (!initialized) { prb = (PropertyResourceBundle) ResourceBundle .getBundle("helpcollator"); readExternalHelpSet(); if (hs == null) { readBackupHelpSet(); } if (hs == null) { hs = new HelpSet(); hs.setLocalMap(new TryMap()); } else { logger.info("EmptyHelp set to false"); emptyHelp = false; } idMap = new HashMap<Component, String>(); nonAlphanumeric = Pattern.compile("[^a-z0-9\\.]"); initialized = true; } }
ID back = null; back = getIDFromURL(url); if (back != null) { return back;
if (hs == null) { hs = new HelpSet(); hs.setLocalMap(new TryMap()); } else { logger.info("EmptyHelp set to false");
/** * Determines the ID for this URL. * * @param url The URL to get the ID for. * @return The ID (Map.ID), or null if URL is not an ID */ public ID getIDFromURL(URL url) { debug("getIDFromURL("+url+")"); ID back = null; for (Enumeration e = maps.elements(); e.hasMoreElements(); ) { Map m = (Map) e.nextElement(); back = m.getIDFromURL(url); if (back != null) { return back; } } return null; }
/** * Gets the URL that corresponds to a given ID in the Map. * * @param id The ID for which to get the URL. If <tt>id</tt> is null it is * treated as an unresolved ID and returns null. * @return URL The matching URL. Null if this Map cannot resolve the ID. * @exception MalformedURLException if the URL specification found is malformed */ public URL getURLFromID(ID id) throws MalformedURLException { debug("getURLFromID("+id+")"); URL back = null; for (Enumeration e = maps.elements(); e.hasMoreElements(); ) { Map m = (Map) e.nextElement(); back = m.getURLFromID(id); if (back != null) { return back; } } return back; }