use of limelight.events.EventAction in project limelight by slagyr.
the class DropDownPopup method createList.
private void createList() {
popupList = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_drop_down_popup_list"));
popupList.getStyle().addExtension(stylesStore.get("limelight_builtin_drop_down_popup_list"));
popupList.getStyle().setX(dropDown.getParent().getAbsoluteLocation().x - dropDown.getRoot().getX());
popupList.getStyle().setY(dropDown.getParent().getAbsoluteLocation().y - dropDown.getRoot().getY());
popupList.getStyle().setWidth(dropDown.getParent().getWidth());
popupList.getEventHandler().add(MouseClickedEvent.class, new EventAction() {
public void invoke(Event event) {
// eat the event so the curtains won't get it
}
});
}
use of limelight.events.EventAction in project limelight by slagyr.
the class PanelEventTest method theRecipientIsSetOnlyDuringDispatchAndThenRestored.
@Test
public void theRecipientIsSetOnlyDuringDispatchAndThenRestored() throws Exception {
TestablePanelBase recipient = new TestablePanelBase();
recipient.getEventHandler().add(TestableEvent.class, new EventAction() {
public void invoke(Event event) {
dispatchedRecipient = ((PanelEvent) event).getRecipient();
}
});
event.dispatch(recipient);
assertEquals(recipient, dispatchedRecipient);
assertEquals(source, event.getRecipient());
}
use of limelight.events.EventAction in project limelight by slagyr.
the class EventActionMulticasterTest method removingFirstOfThree.
@Test
public void removingFirstOfThree() throws Exception {
EventAction action = EventActionMulticaster.add(action1, action2);
action = EventActionMulticaster.add(action, action3);
EventAction result = EventActionMulticaster.remove(action, action1);
assertEquals(EventActionMulticaster.class, result.getClass());
EventActionMulticaster multicaster = (EventActionMulticaster) result;
assertSame(action2, multicaster.getFirst());
assertSame(action3, multicaster.getSecond());
}
use of limelight.events.EventAction in project limelight by slagyr.
the class EventActionMulticasterTest method chainingMulticasters.
@Test
public void chainingMulticasters() throws Exception {
EventAction action = EventActionMulticaster.add(action1, action2);
action = EventActionMulticaster.add(action, action3);
action = EventActionMulticaster.add(action, action4);
action = EventActionMulticaster.add(action, action5);
action.invoke(null);
assertEquals(action1, invokations.get(0));
assertEquals(action2, invokations.get(1));
assertEquals(action3, invokations.get(2));
assertEquals(action4, invokations.get(3));
assertEquals(action5, invokations.get(4));
}
use of limelight.events.EventAction in project limelight by slagyr.
the class EventActionMulticasterTest method collectingTwoActions.
@Test
public void collectingTwoActions() throws Exception {
EventAction action = EventActionMulticaster.add(action1, action2);
List<EventAction> actions = EventActionMulticaster.collect(action);
assertEquals(2, actions.size());
assertSame(action1, actions.get(0));
assertSame(action2, actions.get(1));
}
Aggregations