Example #1
0
  private Set<String> getLoadedPaths() {

    if (!IGV.hasInstance()) return new HashSet<String>();

    Collection<ResourceLocator> locators = IGV.getInstance().getDataResourceLocators();
    HashSet<String> loadedPaths = new HashSet<String>(locators.size());
    for (ResourceLocator locator : locators) {
      loadedPaths.add(locator.getPath());
    }
    return loadedPaths;
  }
Example #2
0
 public Profile(Element el) {
   name = el.getAttribute("name");
   ids = new HashSet<String>();
   Node child = el.getFirstChild();
   while (child != null) {
     if (child.getNodeType() == Node.ELEMENT_NODE) {
       ids.add(((Element) child).getAttribute("id"));
     }
     child = child.getNextSibling();
   }
 }
Example #3
0
 public void appendTo(Element el) {
   Document doc = el.getOwnerDocument();
   Element p = doc.createElement("profile");
   p.setAttribute("name", name);
   Iterator<String> it = ids.iterator();
   while (it.hasNext()) {
     Element child = doc.createElement("enable");
     child.setAttribute("id", it.next());
     p.appendChild(child);
   }
   el.appendChild(p);
 }
Example #4
0
 public boolean has(String id) {
   return ids.contains(id);
 }
Example #5
0
 public void add(String id) {
   ids.add(id);
 }