In Uniface 10, developers can open development objects from, among other places, the U-Bar by entering the object’s full name or selecting the desired object from a list. For small applications these are very useful options however, for larger applications, having a simple way of searching for objects would improve the user’s experience and reduce the frustration of searching through, what could possibly be, a long list.
To improve the user experience and provide a simple way to search for objects, we have added smart suggestions to the main U-Bar.
Smart suggestions are intended to help enter a value that is relevant in a given context, such as the URL of an object, the value of a property, code, or a new name of an object. They can help with entering correct syntax, as well as with finding objects while entering a URL.
Suggestions are offered as you type. Simply start typing, and based on what you enter, suggestions are offered in a drop-down box below the field. You can quickly accept a suggestion using the down/up keys, then continue to enter more text, or press Enter/Tab to select the value.
The offered suggestions depend on the purpose of the entry field and what you type.
Suggestions in the Main U-Bar
The purpose of the Main U-Bar is to open an object for editing. Object URLs have a defined syntax, so the suggestions offered depend on how much of the URL you have entered or selected.
To start with, you need to enter the code of the main development object. If you don’t know the type code, try a keyword, such as form, service, entity, or include to get suggestions based on the description.
If you do know the code, you can just start typing it, for example cpt for components. In this case, a list of component types is offered.
Use the navigation keys to select the type of object you are looking for and press Enter to select it.
(Of course, the list of available types is small, so the easiest way is just to select the type from the list of suggestions without typing anything. 😊)
Suggestions for Objects
Once you have selected the main object type, you can start typing the name of the object, or a string that occurs in the object name or description. While typing, suggestions are offered. The first item that matches is highlighted.
If there is no exact match, suggestions are provided for items that contain the string somewhere in the name or description.
Depending on your naming conventions, your object names and/or descriptions may contain keywords that represent some functional domain, sub-application, or some sort of category. Such information can be used in the U-Bar to find your objects.
Use the arrow keys to accept a suggestion, and press Enter or Tab to open it. However, if you want to open the object at a specific sub-object, type a forward slash to get the next object type suggestions.
You can then select the sub-object type to get the next suggestions.
If your naming conventions are a bit more complex, you can use wildcards * and ? or Uniface characters profile (Gold+*, Gold+?) to enter a naming pattern. For example, perhaps you have a naming convention for components that uses the first 2 characters to specify a functional domain, followed by 4, followed by 2 characters to specify some functional behavior (browse, maintenance, edit, open, erase, batch, …). You could then enter a string like AU????BR, or *BR to find the matching components.
What is considered smart depends on the context. The suggestions at the top of the list are considered most relevant; probably the thing you’re looking for. Does the IDE really know? No, but it does make an educated guess.
In the Main U-Bar, for each object type, suggestions are ordered based on modification date, because you often look for an object you recently worked on.
Once you start entering something after the object type, the suggestions are offered in the following order:
- Objects whose name starts with the entered text
- Objects whose name contains the entered text
- Objects whose description contains the entered text
By default, the number of suggestions offered is limited to 50, which allows the IDE to show suggestions instantly. Depending on the connection speed between the IDE and your Repository, you may want to tweak this number by using an assignment file setting. In practice, if your object is not in the first 50, you will probably make your search criteria more specific.
There are situations where you simply don’t know what you’re looking for—you just want to explore the Repository a bit. For such situations, you can have the IDE show all suggestions, allowing you to scroll through the list of suggested objects using the scrollbar.
We feel this is a really useful feature that helps developers navigate around their application’s sources using Uniface 10.