void (final ComponentDropLocation location) { final ComponentItem componentToInsert = getComponentToInsert(); assert componentToInsert != null; ComponentItemDragObject dragObject = new ComponentItemDragObject(componentToInsert); if (location.canDrop(dragObject)) { myLastLocation = location; } else { ComponentDropLocation locationToRight = location.getAdjacentLocation(ComponentDropLocation.Direction.RIGHT); ComponentDropLocation locationToBottom = location.getAdjacentLocation(ComponentDropLocation.Direction.DOWN); if (locationToRight != null && locationToRight.canDrop(dragObject)) { myLastLocation = locationToRight; } else if (locationToBottom != null && locationToBottom.canDrop(dragObject)) { myLastLocation = locationToBottom; } else { myLastLocation = location; } } if (myLastLocation.canDrop(dragObject)) { myLastLocation.placeFeedback(myEditor.getActiveDecorationLayer(), dragObject); } }