Add a comment

Dragome exists thanks to your donations

Help us continue to make it better



Dragome

Open Source



Dragome Web SDK fork me on github!
Takes your Java code to the web
Download Dragome

Gui Toolkit Tutorial

Components

VisualLabel

Usage example:

VisualLabel<String> label= new VisualLabelImpl<String>("label1");
label.setValue("text");

VisualButton

Usage example:

VisualButton button= new VisualButtonImpl("button1", v -> System.out.println("Click"));

VisualCheckbox

Usage example:

VisualCheckbox checkBox= new VisualCheckboxImpl("check1");
checkBox.setValue(true);

VisualTextField

Usage example:

VisualTextField<String> textfield= new VisualTextFieldImpl<String>("textfield1");
textfield.setValue("text");

VisualComboBox

Usage example:

VisualComboBox combobox= new VisualComboBoxImpl<String>("nickname", Arrays.asList("Pelusa", "Burrito", "Bocha", "Bruja"))

VisualPanel

Usage example:

VisualPanel panel= new VisualPanelImpl("panel1");
panel.addChild(label);
panel.addChild(button);
panel.addChild(textfield);

Binding models

Binding a textfield

Using Builders:

componentBuilder.bindTemplate("givenName").as(VisualTextField.class).toProperty(Person::getGivenName, Person::setGivenName).build();

Using Pectin:

VisualTextFieldImpl<String> textField= new VisualTextFieldImpl<String>("name");
AbstractBeanModelProvider<Person> modelProvider= new ReflectionBeanModelProvider<Person>(Person.class);
FieldModel<String> nameFieldModel= new FormModel().fieldOfType(String.class).boundTo(modelProvider, "name");
FormBinder binder= new FormBinder();
binder.bind(nameFieldModel).to(textField);

Binding a list

Using Builders:

componentBuilder.bindTemplate("nickname").to(new VisualComboBoxImpl<String>("nickname", Arrays.asList("Pelusa", "Burrito", "Bocha", "Bruja"))).toProperty(Person::getNickname, Person::setNickname).build();

Binding a formatted age field

Using ModelBinder:

VisualTextField<Integer> ageTextField= new VisualTextFieldImpl<Integer>("age");
binder.bindFormattedMemberToValueHolder("age", ageTextField, Integer.class, new AgeFormat());

As Dragome Form Bindings is based on GWT Pectin Project GWT Pectin, you can use a lot of its great features.
For more info Take a look at: GuideBindingToBeans





Google+