home *** CD-ROM | disk | FTP | other *** search
/ Internet CD 2005 August / MICD_2005_08.iso / Multimedia / Twist / TwistEval.exe / Main / webhelp0.cab / DoSync.class (.txt) next >
Encoding:
Java Class File  |  2001-06-19  |  1.6 KB  |  67 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.       System.out.println(var3);
  35.       boolean var4 = false;
  36.       if (var2 != null) {
  37.          String var5 = ((ContentsTree)var2).local;
  38.          if (var5 != null) {
  39.             var5 = var5.replace('\\', '/');
  40.             if (var3.equalsIgnoreCase(URLFileHandler.GetNormalizedLocal2(var5))) {
  41.                var4 = true;
  42.             }
  43.          }
  44.       }
  45.  
  46.       if (!var4) {
  47.          TreeViewNode var9;
  48.          for(var9 = var1.getRoot(); var9 != null; var9 = (TreeViewNode)((SiblingChildTree)var9).nextNode()) {
  49.             if (var9 instanceof ContentsTree) {
  50.                String var6 = ((ContentsTree)var9).local;
  51.                if (var6 != null) {
  52.                   var6 = var6.replace('\\', '/');
  53.                   if (var3.equalsIgnoreCase(URLFileHandler.GetNormalizedLocal2(var6))) {
  54.                      break;
  55.                   }
  56.                }
  57.             }
  58.          }
  59.  
  60.          if (var9 != null) {
  61.             var1.Sync(var9);
  62.          }
  63.       }
  64.  
  65.    }
  66. }
  67.