Friday, November 5, 2010

Tree with I18N

Hi

I am wondering how to build a TreeItem with I18N and not have
different tokens for a menu item.

If I build a TreeItem like this:

@UiField
Tree tree;

TreeItem customer = new TreeItem(customerGroup");
customer.addItem("searchCustomer");
customer.addItem("create");
customer.setState(true);

tree.clear();
tree.addItem(customer);


@UiHandler("tree")
public void onSelection(SelectionEvent<TreeItem> event) {
eventBus.fireEvent(event);
}
the ValueChange token I get when a user clicks the "create" node is
"create" and then I get code like

public void onValueChange(ValueChangeEvent<String> event) {
String token = event.getValue();
if(token.equals("create")
{
CreateCustomerView create = new CreateCustomerView(eventBus,
customerService);
content.setContent(create);
}
...

But what if I want to have different languages in the TreeItem nodes,
then I want something other then the text as a token, perhaps an id.
Can I solve this with the Places pattern from the MVP pattern, and if
so how does that work?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate