In standard swing, a split pane divider location cannot be set until the
pane contents are "realized".
What is the proper technique to do this in the ULC environment?
I have a widget extension that contains a JSplitPane as the main root of its
content.
Invoking the "setDividerLocation" method on this extension immediately after
adding it to the ULC widget hierarchy has no affect, because with the
asynchronous nature of ULC client/server communications, the client widget
has not been fully realized when it receives the "setDividerLocation"
command.
Stepping through this code using the debugger alleviates the problem.
I can also simulate this action programmatically (this is my current code!):
add(mySplitPaneExtension);
final ULCPollingTimer delay = new ULCPollingTimer(100, new IActionListener()
{
public void actionPerformed(ActionEvent event) {
mySplitPaneExtension.setDividerLocation(loc);
}
});
delay.setRepeats(false);
delay.start();
This of course is highly dependent on network latency.
I've also tried this, without success:
add(mySplitPaneExtension);
UlcUtilities.invokeLater(new Runnable() {
public void run() {
mySplitPaneExtension.setDividerLocation(loc);
}
});
Browsing ULC documentation shows two other potential solutions.
ClientContext.setEventDeliveryMode(ULCProxy proxy,
String eventCategory, int mode);
Unfortunately I couldn't try this, because the "eventCategory" argument
doesn't seem to be documented anywhere (a "google" search only shows this
being assigned the value "UlcEventCategories.VALUE_CHANGED_EVENT_CATEGORY",
where "UlcEventCategories" seems to be an obsolete class.
Note: there's another place I might need to use this method, if someone
would be so kind as to point to the documentation.
The other option I've seen but haven't yet tried is to use
ApplicationContext.addRoundTripListener, which is a static method, and would
not seem to be appropriate for a single instance. (would it?)
Many thanks.