use of limelight.ui.model.PropPanel in project limelight by slagyr.
the class RadioButtonPanelTest method settingTheGroupName.
@Test
public void settingTheGroupName() throws Exception {
Scene scene = new FakeScene();
PropPanel parent1 = new PropPanel(new FakePropProxy("parent1"));
RadioButtonPanel radio1 = new RadioButtonPanel();
parent1.add(radio1);
PropPanel parent2 = new PropPanel(new FakePropProxy("parent2"));
RadioButtonPanel radio2 = new RadioButtonPanel();
parent2.add(radio2);
scene.add(parent1);
scene.add(parent2);
final RadioButtonGroup group = scene.getButtonGroups().get("test_group");
assertEquals(0, group.getButtons().size());
radio1.setGroup("test_group");
assertEquals(1, group.getButtons().size());
radio2.setGroup("test_group");
assertEquals(2, group.getButtons().size());
assertEquals(true, group.getButtons().contains(radio1));
assertEquals(true, group.getButtons().contains(radio2));
}
use of limelight.ui.model.PropPanel in project limelight by slagyr.
the class RadioButtonPanelTest method changingGroupName.
@Test
public void changingGroupName() throws Exception {
Scene scene = new FakeScene();
PropPanel parent1 = new PropPanel(new FakePropProxy("parent1"));
RadioButtonPanel radio1 = new RadioButtonPanel();
parent1.add(radio1);
scene.add(parent1);
final RadioButtonGroup group1 = scene.getButtonGroups().get("group1");
final RadioButtonGroup group2 = scene.getButtonGroups().get("group2");
radio1.setGroup("group1");
radio1.setGroup("group2");
assertEquals(0, group1.getButtons().size());
assertEquals(1, group2.getButtons().size());
}
use of limelight.ui.model.PropPanel in project limelight by slagyr.
the class DropDownPopup method createListItems.
private void createListItems() {
EventAction itemChosenAction = new EventAction() {
public void invoke(Event e) {
PanelEvent event = (PanelEvent) e;
choose((PropPanel) event.getRecipient());
}
};
EventAction itemSelectedAction = new EventAction() {
public void invoke(Event e) {
PanelEvent event = (PanelEvent) e;
select((PropPanel) event.getRecipient());
}
};
for (Object option : dropDown.getChoices()) {
PropPanel listItem = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_drop_down_popup_list_item"));
listItem.getStyle().addExtension(stylesStore.get("limelight_builtin_drop_down_popup_list_item"));
listItem.getEventHandler().add(MouseClickedEvent.class, itemChosenAction);
listItem.getEventHandler().add(MouseEnteredEvent.class, itemSelectedAction);
listItem.setText(option.toString());
if (option.equals(dropDown.getSelectedChoice()))
select(listItem);
popupList.add(listItem);
}
}
use of limelight.ui.model.PropPanel in project limelight by slagyr.
the class TextArea method install.
public void install(PanelEvent event) {
TextAreaPanel input = new TextAreaPanel();
final PropPanel panel = (PropPanel) event.getRecipient();
panel.add(input);
}
use of limelight.ui.model.PropPanel in project limelight by slagyr.
the class DropDownPopup method createCurtains.
private void createCurtains() {
curtains = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_curtains"));
curtains.getStyle().addExtension(stylesStore.get("limelight_builtin_curtains"));
curtains.getEventHandler().add(MouseClickedEvent.class, new EventAction() {
public void invoke(Event event) {
close();
}
});
}
Aggregations