// root host. we always support it has editable area.
if (host == rootHost) {
if (host.getChildren().size() > 0) {
List children = host.getChildren();
for (int i = 0, size = children.size(); i < size; i++) {
GraphicalEditPart child = (GraphicalEditPart) children
.get(i);
DesignPosition position = innerFindEditPartPosition(
rootHost, child, p, boxLine, validator);
if (position != null) {
return position;
}
}
}
if (boxLine.getPartsList().size() == 0) {
if (lPart.contains(p)) {
// found!!!
return new DesignPosition(host, 0);
}
addToCurrentLine(boxLine, host, p, validator);
}
}
// container
else {
// can't edit it.
if (!validator.hasEditableArea(target)) {
if (lPart.contains(p) && //
(validator.isValidPosition(new DesignRefPosition(
target.getPart(), true)) || //
validator.isValidPosition(new DesignRefPosition(
target.getPart(), false)))) {
return new DesignRefPosition(host, lPart
.isBeforePoint(p)
|| !lPart.atLeftPart(p));
}
addToCurrentLine(boxLine, host, p, validator);
}
// can edit
else {
// contains p
if (lPart.contains(p) || //
(!validator.isValidPosition(new DesignRefPosition(
target.getPart(), true)) && //
!validator.isValidPosition(new DesignRefPosition(
target.getPart(), false)))) {
if (host.getChildren().size() > 0) {
List children = host.getChildren();
for (int i = 0, size = children.size(); i < size; i++) {
GraphicalEditPart child = (GraphicalEditPart) children
.get(i);
DesignPosition position = innerFindEditPartPosition(
rootHost, child, p, boxLine, validator);
if (position != null) {
return position;