use of limelight.events.EventAction in project limelight by slagyr.
the class EventActionMulticasterTest method removingFromNull.
@Test
public void removingFromNull() throws Exception {
EventAction action = EventActionMulticaster.remove(null, action1);
assertEquals(null, action);
}
use of limelight.events.EventAction in project limelight by slagyr.
the class EventActionMulticasterTest method removingLastOfThree.
@Test
public void removingLastOfThree() throws Exception {
EventAction action = EventActionMulticaster.add(action1, action2);
action = EventActionMulticaster.add(action, action3);
EventAction result = EventActionMulticaster.remove(action, action3);
assertEquals(EventActionMulticaster.class, result.getClass());
EventActionMulticaster multicaster = (EventActionMulticaster) result;
assertSame(action1, multicaster.getFirst());
assertSame(action2, multicaster.getSecond());
}
use of limelight.events.EventAction 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.events.EventAction in project limelight by slagyr.
the class EventActionMulticaster method remove.
private EventAction remove(EventAction removed) {
if (first == removed)
return second;
if (second == removed)
return first;
EventAction firstRemoval = EventActionMulticaster.remove(first, removed);
EventAction secondRemoval = EventActionMulticaster.remove(second, removed);
if (first == firstRemoval && second == secondRemoval)
return this;
return EventActionMulticaster.add(firstRemoval, secondRemoval);
}
use of limelight.events.EventAction 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