Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Adding a behavior at runtime

Help
2007-06-29
2013-04-29
  • I've created a new behavior and I want to be able to add it to my embedded browser at runtime. I think I've got the basic idea, but I don't know what to pass in as parameters for the Behavior.getInstance method. Here's what I have so far:

    Layer systemLayer = browser.getRoot().getLayer("system");
    if (systemLayer != null) {
       systemLayer.addBehavior(Behavior.getInstance( /* What goes here? */);

    The method signature is:
    getInstance(java.lang.String logicalname, java.lang.String behaviorclass, ESISNode children, java.util.Map<java.lang.String,java.lang.Object> attr, Layer layer)

    The API doesn't say much of anything about them beyond the signature. I'm guessing "behaviorclass" parameter is the name of the class, and "layer" in my case would be systemLayer, but I don't know what to use for logicalname, children, or attr. Any help would be greatly appreciated.

     
    • Never mind, I figured it out.