home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / WebObjects / WebObjectsDoc_HTML / Reuse / ReusableComponentsEx / ArrayEditor.wo / ArrayEditor.wos < prev    next >
Encoding:
Text File  |  1996-03-04  |  788 b   |  50 lines

  1. ////////////////////////
  2. //  ArrayEditor
  3. //  by Charles Lloyd
  4. ////////////////////////
  5.  
  6.  
  7. //////////////////////////
  8. // User Settable Items
  9. //////////////////////////
  10. id array;
  11.  
  12. id borderSize;
  13. id cellPadding;
  14. id cellSpacing;
  15. id fieldSize;
  16. id isEditable;
  17.  
  18. //////////////////////
  19. //    Internal State
  20. //////////////////////
  21. id arrayElement;
  22. id repetitionIndex;
  23. id entryCount;
  24.  
  25. - awake
  26. {
  27.     [self setArray:[NSMutableArray array]];
  28.     borderSize = 1;
  29.     cellPadding = 2;
  30.     cellSpacing = 0;
  31.     isEditable = NO;
  32. }
  33.  
  34. - setArray:anArray
  35. {
  36.     array = anArray;
  37.     entryCount = [array count];
  38. }
  39.  
  40. - arrayElement
  41. {
  42.     return [array objectAtIndex:repetitionIndex];
  43. }
  44.  
  45. - setArrayElement:aValue
  46. {
  47.     arrayElement = aValue;
  48.     [array replaceObjectAtIndex:repetitionIndex withObject:arrayElement];
  49. }
  50.