Previous Topic

Book Contents

Book Index

Next Topic

Completion of Methods

If you press <Ctrl+space> after a dot, it is assumed that the word before the dot is a variable, a function call, a method call, a constructor call or a class name and therefore you want to know which methods or constants you can use.

Example:

  • If you type 'VM.' and press <Ctrl+space>, you will see all public methods of the Application class because it is the target class of the implicit variable VM:

    Help Image

    Select the desired method, e.g. getBOTypes() and press Enter to insert the method call into the code.

  • If you now type . and press Ctrl+space, you will see all public methods of the ApiBOTypes class because it is the return class of the method getBOTypes():

    Help Image

    Select the desired method, e.g. find() and press Enter to insert the method call into the code.

  • We could now continue in a similar way on and on. However, if the target class of the selected method is a primitive type (e.g. int, double, boolean etc.) or void, then the popup will not show any methods (it will only contain templates if you have defined some).

The example above shows how it works after an implicit variable (VM, transaction, _input, _output) and after any method call. But it works the same also after local or global variables:

Help Image

The target class of the variable boTypes is determined from the previous assignment boTypes = VM.getBOTypes(). The target class of VM is Application, the return class of getBOTypes() is ApiBOTypes, so the target class of the variable boTypes must be the same, therefore the popup displays all public methods of the ApiBOTypes class. It works in exactly the same way for local variables. Again, if the target class of the variable is a primitive type (e.g. int, double, boolean etc.) or void then the popup will not show any methods (it will only contain templates if you have defined some).

  • It works in the same way for constructor calls. In this case the target class is determined from the import(s):

    Help Image

  • If you type only a class name. and press <Ctrl+space>, you will see only static members – i.e. constants and static methods:

    Help Image

    Again, the target class is determined from the import(s). (In this case it was an API class so no import was necessary.)

See Also

Code Completion

Specifying Target Class Explicitly