Rational® Rhapsody® provides
various types of autocompletion, making it easier to include model
elements in your code.
The user interface provides a number of areas for writing code,
for example, the Implementation tab of the Features dialog for operations.
Autocompletion facilitates inclusion of model elements in the code
you are writing by providing a drop-down list of elements. The elements
included in the list are based on the current context.
Autocompletion can be used in the following areas:
- Implementation tab of Features dialog for operations
- Initializer field on General tab of Features dialog for constructors
- The internal code editor
- Active code view
- State actions (action on entry, action on exit, reactions in state)
- Transitions on statecharts (guard and action fields)
- Sequence diagrams (message names, action blocks, condition marks)
The types of autocompletion available include:
- Type Ctrl+space to get a list of all model elements or those that
begin with the characters you have already entered.
- After entering the name of a class or object, Type "." to get
a list of the members. In C and C++, you can type "->" if a pointer
has to be dereferenced.
- Select an event from the drop-down list, and you will get the
relevant code for generating the event, for example, GEN(evOn()).
- Type the name of an enum, followed by "::", and you will get a
list of the enum literals.
- Type the name of a macro that takes a port as an argument, such
as OUT_PORT and you will see a placeholder argument.
Delete the placeholder argument, and you will see a list of ports
to choose from. The same mechanism is used for macros that take both
a port and an event as arguments.
- On sequence diagrams, when you draw a message, type Ctrl+space
to get a list of messages that can be used. You can also use Ctrl+space
to get a list of relevant elements for action blocks and condition
marks.