@Override public void drop(final BaseWidget target, final List<Object> objects, final DropListener dl) { if (objects == null) { dl.dropped(DropCheck.CANNOT); return; } if (objects.isEmpty()) { dl.dropped(DropCheck.CANNOT); return; } final ProjectMemberRoleSelector.RoleSelectionListener rsl = new ProjectMemberRoleSelector.RoleSelectionListener() { @Override public void roleSelected(ProjectRole role, DataUse dataUse) { if (role == null) { dl.dropped(DropCheck.CANNOT); return; } for (Object o : objects) { if (o instanceof UserRef) { _o.addMember(new ProjectMember(((UserRef) o), role, dataUse)); } else if (o instanceof ProjectMember) { ProjectMember pm = ((ProjectMember) o); pm.setRole(role); pm.setDataUse(dataUse); _o.addMember(pm); } } commitChangesAndRefresh(); dl.dropped(DropCheck.CAN); } }; ProjectMemberRoleSelector.showAt( target.absoluteLeft() + target.width() / 2, target.absoluteTop() + target.height() / 2, rsl); }
public static void showAt(int x, int y, RoleSelectionListener rsl) { showAt(x, y, MIN_WIDTH, MIN_HEIGHT, rsl); }