Request request;
if (component != null && (request = component.getRequest()) != null) {
EventType dragEventType = EventType.stringToType(request.getParameter(EventType.IDENTIFIER));
ComponentFinder visitor = new ComponentFinder(request.getParameter(DROPPED_COMPONENTID_IDENTIFIER));
component.getPage().visitChildren(visitor);
if (component instanceof IDroppable) {
IDroppable draggableComponent = (IDroppable)component;
if (dragEventType == EventType.DROP)
draggableComponent.onDrop(target, visitor.getFoundComponent(), new SpecialKeys(request));
else if (dragEventType == EventType.DROP_ACTIVATE)
draggableComponent.onActivate(target, visitor.getFoundComponent(), new SpecialKeys(request));
else if (dragEventType == EventType.DROP_DEACTIVATE)
draggableComponent.onDeactivate(target, visitor.getFoundComponent(), new SpecialKeys(request));
}
if (dragEventType == EventType.DROP)
onDrop(target, visitor.getFoundComponent(), new SpecialKeys(request));
else if (dragEventType == EventType.DROP_ACTIVATE)
onActivate(target, visitor.getFoundComponent(), new SpecialKeys(request));
else if (dragEventType == EventType.DROP_DEACTIVATE)
onDeactivate(target, visitor.getFoundComponent(), new SpecialKeys(request));
}
}