Java Gui Builder |
|
You are here: | Home > Documentation > JGB Elements Documentation > MethodCall Element |
Group membership: Property & method calls
methodCall allows arbitrary methods to be called on objects. The referenced object can be specified so the method call does not need to occur on the enclosing object.
The return value of the method (if any) is discarded, unless the methodCall element is enclosed in a return element, in which case the return element converts the return value into a regular parameter value.
Name | Type | Required | Description |
---|---|---|---|
method | CDATA | Yes |
The name of the method to call. Capitalization matters as the attribute's value is directly used to find a matching method. |
refid | IDREF | No |
The ID of an object that was previously defined, which will be the target of the method call. If this attribute is absent, the enclosing object will be the target of the call. |
<window id="msgWindow" type="jframe"> … <controls> <layout id="contentPaneLayout" class="BorderLayout"/> <button id="aButton"/> </controls> <!-- Call a method on the enclosing object (the window, in this case) --> <methodCall method="remove"> <parameter> <ref refid="aButton"/> ;</parameter> </methodCall> <!-- Call a method on an object which is not the current one (the contentPaneLayout object, in this case) --> <methodCall refid="contentPaneLayout" method="invalidateLayout"> <parameter> <return> <methodCall refid="msgWindow" method="getContentPane"/> </return> </parameter> </methodCall> </window>
Hosted on SourceForge.net |
Valid XHTML 1.0 ! |
Valid CSS ! |
Code Coverage provided by Clover |