Resource Browser

 


 

Dolphin Smalltalk allows resource objects to be created and associated with any class. The intention is that these objects, most often concerned with user interface features, can be modified separately from an application's code. In this way, a non-programmer can change the user interface look and feel without too much fear of breaking an application's functionality. In a well-designed application it may well be that only the resources need to be changed to create, for example, an international version. The Resource Browser is the development tool in Dolphin that allows you to browse the overall collection of resources known to the system.

Tip: in Dolphin Smalltalk/98 Release 1, only View resources are supported. In future versions, additional resource types such as Strings, Menus and Bitmaps will be allowed.

The Resource Browser displays the list of all resources, showing the Owning class and the Resource name. The list may be ordered by class or name simply by clicking on the appropriate header column in the list. The toolbar includes a Packages drop-down which shows the package that the currently selected resource belongs to. You can also use this drop-down to move the resource to another package.

Adding a new resource

Use the Resource/New menu command or the New context menu command to create new resources. An appropriate default instance of the chosen resource will be created and opened into a suitable editor.

Modifying a resource

Select the resource you wish to modify in the Resource Browsers list and choose Resource/Open, or double click it, to open an appropriate editor. For example, double-clicking on a View resource will open it into the View Composer.

Tip: you may wish to modify some of the views for the development system tools, perhaps just to change their appearance. This is perfectly acceptable, but take care not to alter the view so radically that the tool no longer works correctly.

Deleting a resource

Select the resource you wish to delete and choose Resource/Delete. Be careful not to delete any resources that are fundamental to the operation of the basic development system.

Drag-and-drop

Resources can be dragged from the Resource Browser. If dragged to a package in the Package Browser, the resource is moved to that package. Note that, by default, a resource belongs to the package of its owning class. View resources may also be dragged and dropped onto the composition arena in the View Composer. In this way the Resource Browser acts identically to the View Composer's toolbox.