Hi Dominicm,

I add the "Include" syntax to Ui module definition. You can put
commonly
used UI modules into a base class,   for example,

public class BaseUiModule extends DslContext {

  public void defineBaseUi() {
    ui.Container(uid: "SearchModule", clocator: [tag: "td"], group:
"true") {
      InputBox(uid: "Input", clocator: [title: "Google Search"])
      SubmitButton(uid: "Search", clocator: [name: "btnG", value:
"Google Search"])
      SubmitButton(uid: "ImFeelingLucky", clocator: [value: "I'm
Feeling Lucky"])
    }

    ui.Container(uid: "GoogleBooksList", clocator: [tag: "table", id:
"hp_table"], group: "true") {
      TextBox(uid: "category", clocator: [tag: "div", class:
"sub_cat_title"])
      List(uid: "subcategory", clocator: [tag: "div", class:
"sub_cat_section"], separator: "p") {
        UrlLink(uid: "all", clocator: [:])
      }
    }

  }
}

Then you can extend this base Ui module,

public class ExtendUiModule extends BaseUiModule {

  public void defineUi() {
    defineBaseUi()

    ui.Container(uid: "Google", clocator: [tag: "table"]) {
      Include(uid:
"SearchModule")
      Container(uid: "Options", clocator: [tag: "td", position: "3"],
group: "true") {
        UrlLink(uid: "LanguageTools", clocator: [tag: "a", text:
"Language Tools"])
        UrlLink(uid: "SearchPreferences", clocator: [tag: "a", text:
"Search Preferences"])
        UrlLink(uid: "AdvancedSearch", clocator: [tag: "a", text:
"Advanced Search"])
      }
    }

    ui.Container(uid: "Test", clocator: [tag: "div"]) {
      Include(uid: "GoogleBooksList.category")
      Include(uid: "GoogleBooksList.subcategory")
    }
  }
}

You can see that you can use the "include" syntax to include pre-
defined UI elements.

The Include must have the uid attribute to refer to which element it
wants to include.

For more details, please see the unit test ExtendUiModule_UT in trunk/
core.

Thanks,

Jian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to