• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

8.3. Summary

Tool bars and menus build on the basic widgets of SWT. Their items both share “buttonlike” behavior and the separator style that was first encountered in class Label. Unfortunately, tool bars suffer from the “first image defines the item size” limitation (forced on SWT by Microsoft Windows). The advanced control classes Tree, Table, and TabFolder share this limitation.

One criticism of the ToolBar and Menu API in SWT is that it is too verbose. Some native toolkits provide helper or “factory” methods in an attempt to lessen the burden.[14] We have thought long and hard about this problem and have come to the conclusion that, although helper API allows you to get something coded quickly, in real-world applications you need to specify most menu and tool item properties anyway, causing the helper code to be just as verbose. Helper methods suffer from the problem that they tend to become outdated when new functionality is added to the classes they wrap. In Java, the problem of defining helper methods that really help is further exacerbated by the verbose nature of inner classes and the fact that the use of reflection to transform data into something executable is frowned on by the Java community.

[14] GTK provides “Item Factories.” Motif provides the “Simple Menu” API.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint