All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.uqbar.arena.tests.nestedPropertyAccess.NestedPropertyAccessWindow Maven / Gradle / Ivy

The newest version!
package org.uqbar.arena.tests.nestedPropertyAccess;

import org.uqbar.arena.bindings.PropertyAdapter;
import org.uqbar.arena.tests.nestedCombos.Country;
import org.uqbar.arena.tests.nestedCombos.NestedCombosDomain;
import org.uqbar.arena.tests.nestedCombos.Province;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.widgets.Selector;
import org.uqbar.arena.windows.MainWindow;

public class NestedPropertyAccessWindow extends MainWindow {

	// ****************************************************************
	// ** STATICS
	// ****************************************************************

	public static void main(String[] args) {
		new NestedPropertyAccessWindow(new NestedCombosDomain()).startApplication();
	}

	// ****************************************************************
	// ** CONSTRUCTORS
	// ****************************************************************

	public NestedPropertyAccessWindow(NestedCombosDomain model) {
		super(model);
	}

	// ****************************************************************
	// ** OPERATIONS
	// ****************************************************************

	@Override
	public void createContents(Panel mainPanel) {
		Selector countries = new Selector(mainPanel);
		countries.bindItemsToProperty("possibleCountries").setAdapter(new PropertyAdapter(Country.class, "name"));
		countries.bindValueToProperty("country");

		Selector provinces = new Selector(mainPanel);
		provinces.bindItemsToProperty("country.provinces").setAdapter(new PropertyAdapter(Province.class, "name"));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy