org.uqbar.arena.tests.nestedProperties.NestedPropertiesWindow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arena-examples Show documentation
Show all versions of arena-examples Show documentation
Ejemplos básicos y tests del framework Arena
package org.uqbar.arena.tests.nestedProperties;
import org.uqbar.arena.bindings.PropertyAdapter;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.widgets.Selector;
import org.uqbar.arena.widgets.TextBox;
import org.uqbar.arena.windows.MainWindow;
public class NestedPropertiesWindow extends MainWindow {
public static void main(String[] args) {
NestedPropertiesModel model = new NestedPropertiesModel();
model.getList().add(new Nested("hola"));
model.getList().add(new Nested("chau"));
new NestedPropertiesWindow(model).startApplication();
}
public NestedPropertiesWindow(NestedPropertiesModel model) {
super(model);
}
@Override
public void createContents(Panel mainPanel) {
Selector selector = new Selector(mainPanel);
selector.bindItemsToProperty("list").setAdapter(new PropertyAdapter(Nested.class, "second"));
selector.bindValueToProperty("first");
new TextBox(mainPanel).bindValueToProperty("second");
new TextBox(mainPanel).bindValueToProperty("first.second");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy