home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / WebObjects / WebObjectsDoc_HTML / DynamicElements / CodeViewer.wo / CodeViewer.wos < prev   
Encoding:
Text File  |  1996-03-08  |  1.3 KB  |  51 lines

  1. id componentName;
  2. id pathForTemplateFile;
  3. id pathForDeclarationsFile;
  4. id pathForScriptFile;
  5. id showSource;
  6. id templateFile;
  7. id declarationsFile;
  8. id scriptFile;
  9.  
  10. - displaySourceLink {
  11.     if (showSource) {
  12.     return nil;
  13.     } else {
  14.     return YES;
  15.     }
  16. }
  17.  
  18. - hideSourceLink {
  19.     if (showSource) {
  20.     return YES;
  21.     } else {
  22.     return nil;
  23.     }
  24. }
  25.  
  26. - hideSource {
  27.     showSource = nil;
  28. }
  29.  
  30. - viewSource {
  31.     id pathForComponent;
  32.     id codePage;
  33.     id nameOfHTMLFile = [componentName stringByAppendingString:@".html"];
  34.     id nameOfWODFile = [componentName stringByAppendingString:@".wod"];
  35.     id nameOfWOSFile = [componentName stringByAppendingString:@".wos"];
  36.     
  37.     showSource = YES;
  38.     pathForComponent = [WOApp pathForResource:componentName ofType:@"wo"];
  39.     
  40.     pathForTemplateFile = [pathForComponent stringByAppendingPathComponent:nameOfHTMLFile];
  41.     templateFile = [NSString stringWithContentsOfFile:pathForTemplateFile];
  42.     
  43.     pathForDeclarationsFile = [pathForComponent stringByAppendingPathComponent:nameOfWODFile];
  44.     declarationsFile = [NSString stringWithContentsOfFile:pathForDeclarationsFile];
  45.  
  46.     pathForScriptFile = [pathForComponent stringByAppendingPathComponent:nameOfWOSFile];
  47.     scriptFile = [NSString stringWithContentsOfFile:pathForScriptFile];
  48. }
  49.  
  50.  
  51.