home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / windowsxp / ftgateoffice / ftgateoffice.exe / Main / webhelp.jar / DoSync.class (.txt) next >
Encoding:
Java Class File  |  2000-11-07  |  1.6 KB  |  66 lines

  1. import hhapplet.ContentsTree;
  2. import hhapplet.SiteMapParserToContents;
  3. import hhapplet.URLFileHandler;
  4. import java.awt.Window;
  5. import sitemap.SiteMapParser;
  6. import treeview.SiblingChildTree;
  7. import treeview.TreeView;
  8. import treeview.TreeViewNode;
  9.  
  10. class DoSync extends Thread {
  11.    Window m_winToShow;
  12.    SiteMapParser m_smpContents;
  13.    String m_strContentItem;
  14.  
  15.    public DoSync(SiteMapParser var1, String var2, String var3) {
  16.       super(var3);
  17.       this.m_smpContents = var1;
  18.       this.m_strContentItem = var2.replace('\\', '/');
  19.    }
  20.  
  21.    public void run() {
  22.       try {
  23.          while(!this.m_smpContents.IsFinish()) {
  24.             System.out.println("Wait in DoSync");
  25.             Thread.sleep(100L);
  26.          }
  27.       } catch (InterruptedException var7) {
  28.          ((Throwable)var7).printStackTrace();
  29.       }
  30.  
  31.       TreeView var1 = ((SiteMapParserToContents)this.m_smpContents.getOutput()).getTree();
  32.       TreeViewNode var2 = var1.getCurrentSelection();
  33.       String var3 = URLFileHandler.GetNormalizedLocal2(this.m_strContentItem);
  34.       boolean var4 = false;
  35.       if (var2 != null) {
  36.          String var5 = ((ContentsTree)var2).local;
  37.          if (var5 != null) {
  38.             var5 = var5.replace('\\', '/');
  39.             if (var3.equalsIgnoreCase(URLFileHandler.GetNormalizedLocal2(var5))) {
  40.                var4 = true;
  41.             }
  42.          }
  43.       }
  44.  
  45.       if (!var4) {
  46.          TreeViewNode var9;
  47.          for(var9 = var1.getRoot(); var9 != null; var9 = (TreeViewNode)((SiblingChildTree)var9).nextNode()) {
  48.             if (var9 instanceof ContentsTree) {
  49.                String var6 = ((ContentsTree)var9).local;
  50.                if (var6 != null) {
  51.                   var6 = var6.replace('\\', '/');
  52.                   if (var3.equalsIgnoreCase(URLFileHandler.GetNormalizedLocal2(var6))) {
  53.                      break;
  54.                   }
  55.                }
  56.             }
  57.          }
  58.  
  59.          if (var9 != null) {
  60.             var1.Sync(var9);
  61.          }
  62.       }
  63.  
  64.    }
  65. }
  66.