home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / Samples / Mod / Ex4 (.txt) < prev    next >
Encoding:
Oberon Document  |  1994-06-07  |  3.6 KB  |  65 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Geneva
  16. Geneva
  17. L Frutiger Light
  18. Geneva
  19. TextRulers.StdRulerDesc
  20. TextRulers.RulerDesc
  21. TextRulers.StdStyleDesc
  22. TextRulers.StyleDesc
  23. TextRulers.AttributesDesc
  24. MODULE SamplesEx4;
  25.     IMPORT Files, Views, Dialog, TextModels, TextMappers, TextViews;
  26.     PROCEDURE Do*;
  27.         VAR stationary: BOOLEAN; loc: Files.Locator; name: Files.Name;
  28.             v: Views.View; t: TextModels.Model; f: TextMappers.Formatter;
  29.     BEGIN
  30.         Dialog.GetIntSpec("", stationary, loc, name);
  31.         IF loc # NIL THEN
  32.             v := Views.OldView(loc, name);
  33.             IF v IS TextViews.View THEN
  34.                 t := v(TextViews.View).ThisModel();
  35.                 f.ConnectTo(t);
  36.                 f.SetPos(t.Length());
  37.                 f.WriteString("appendix");
  38.                 Views.Open(v, NIL, "")
  39.             END
  40.         END
  41.     END Do;
  42. END SamplesEx4.
  43. TextControllers.StdCtrlDesc
  44. TextControllers.ControllerDesc
  45. Containers.ControllerDesc
  46. Controllers.ControllerDesc
  47. Geneva
  48. DevCommanders.StdViewDesc
  49. DevCommanders.ViewDesc
  50. Example 4
  51. This example asks the user for a file, opens the document contained in the file, and appends a string to the text contained in the document. Finally, the text (in its text view) is opened in a window.
  52. After compilation, you can try out the above example:
  53.  SamplesEx4.Do
  54. With this example, we have seen how the contents of an Oberon document's root view can be accessed, and how this view can be opened in a window after its contents have been modified. In contrast to SamplesEx1, an existing text has been modified; by first setting the formatter to its end, and then appending new text.
  55. Note that similar to the previous examples, views play a central role.
  56. In contrast to traditional development systems and frameworks, files, windows, and applications play only a minor role in Oberon/F, or have completely disappeared as abstractions of their own. The view on the other hand has become a pivotal abstraction. It is an essential property of views that they can be nested, to form hierarchical documents.
  57. These aspects of Oberon/F constitute a fundamental paradigm shift
  58. from monolithic applications to software components
  59. from interoperable programs to integrated components
  60. from closed programs to open environments
  61. from fully specified requirements to extensible interfaces
  62. from application-centered thinking to document-centered thinking
  63. Geneva
  64. Documents.ControllerDesc
  65.