ComponentDropLocation (@NotNull RadContainer container, @Nullable final Point location) { FormLayout formLayout = getFormLayout(container); if (formLayout.getRowCount() == 0 || formLayout.getColumnCount() == 0) { if (location != null) { Rectangle rc = new Rectangle(new Point(), container.getDelegee().getSize()); return new FormFirstComponentInsertLocation(container, location, rc); } } final FormLayout.LayoutInfo layoutInfo = formLayout.getLayoutInfo(container.getDelegee()); if (location != null && location.x > layoutInfo.getWidth()) { int row = findCell(layoutInfo.rowOrigins, location.y); if (row == -1) { return NoDropLocation.INSTANCE; } return new GridInsertLocation(container, row, getGridColumnCount(container)-1, GridInsertMode.ColumnAfter); } if (location != null && location.y > layoutInfo.getHeight()) { int column = findCell(layoutInfo.columnOrigins, location.x); if (column == -1) { return NoDropLocation.INSTANCE; } return new GridInsertLocation(container, getGridRowCount(container)-1, column, GridInsertMode.RowAfter); } if (container.getGridRowCount() == 1 && container.getGridColumnCount() == 1 && getComponentAtGrid(container, 0, 0) == null) { final Rectangle rc = getGridCellRangeRect(container, 0, 0, 0, 0); if (location == null) { return new FormFirstComponentInsertLocation(container, rc, 0, 0); } return new FormFirstComponentInsertLocation(container, location, rc); } return super.getDropLocation(container, location); }