At a second thought, I changed the "Include" a bit to make it more
flexible.
That is to say, you should use "ref" to reference the object you want
to
include, you can still specify the uid for the object (if you do not
need a
different uid, you do not need the uid), if the object uid is not
equal to the original one, Tellurium will clone a new object for you
so that
you can have multiple objects with different uids.

For example, the ExtendUiModule looks as follows,

public class ExtendUiModule extends BaseUiModule {

  public void defineUi() {
    defineBaseUi()

    ui.Container(uid: "Google", clocator: [tag: "table"]) {
      Include(ref: "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: "newcategory", ref:
"GoogleBooksList.category")
      Include(uid: "secondcategory", ref: "GoogleBooksList.category")
      Include(uid: "newsubcategory", ref:
"GoogleBooksList.subcategory")
    }
  }
}

The tellurium jar is also updated.

Thanks,

Jian

On Mar 7, 4:11 am, John <[email protected]> wrote:
> 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