Java Gui Builder
You are here: Home   >   Documentation   >   JGB Elements Documentation   >   MethodCall Element
JGB Element Navigation
tab
ref

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.

Attributes

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.

Example usage

<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>
        

Parent element(s)

button, check, combo, controls, control, item, label, layout, menuBar, menu, object, panel, popupmenu, radio, return, separator, sheet, tab, textfield, window.

Child element(s)

parameter.
Back to top
SourceForge Logo
Hosted on SourceForge.net
Valid XHTML 1.0!
Valid XHTML 1.0 !
Valid CSS!
Valid CSS !
Code Coverage by Clover
Code Coverage provided by Clover
 |  Home |  License |  Downloads |  Documentation |  Developers |  Mailing Lists |  Dependencies |  Links |  Privacy Policy |  SF Project Home |