Example #1
0
        public void changed(LocationEvent event) {
          if (object == null) {
            return;
          }
          log.info(event.getSource());
          String newUrl = browser.getUrl();
          String name =
              newUrl.substring(newUrl.lastIndexOf(File.separator) + 1, newUrl.length() - 5);
          log.info(name);
          if (name.startsWith("mod_")) {
            name = name.substring(4);
          }

          ICoverageObject newObj;
          if ((newObj = object.treeSearch(name)) != null) {
            // TODO -> findChild
            setObject(newObj);
            if (object.getParent() == null) {
              up.setEnabled(false);
              next.setEnabled(false);
              prev.setEnabled(false);
            } else {
              up.setEnabled(true);
              if (object.getParent().getNextSiblingTo(object.getLabel()) == null) {
                next.setEnabled(false);
              } else {
                next.setEnabled(true);
              }
              if (object.getParent().getPrevSiblingTo(object.getLabel()) == null) {
                prev.setEnabled(false);
              } else {
                prev.setEnabled(true);
              }
            }
          }
        }
 private String internalGetUrl() {
   if (browser != null) {
     return browser.getUrl();
   }
   return null;
 }