Search in sources :

Example 1 with MySQLGrant

use of org.jkiss.dbeaver.ext.mysql.model.MySQLGrant in project dbeaver by serge-rider.

the class PrivilegeTableControl method fillGrants.

public void fillGrants(List<MySQLGrant> grants) {
    if (grants == null) {
        return;
    }
    for (TableItem item : privTable.getItems()) {
        MySQLPrivilege privilege = (MySQLPrivilege) item.getData();
        //Button grantCheck = (Button)item.getData("grant");
        //, grantOption = false;
        boolean checked = false;
        for (MySQLGrant grant : grants) {
            if (grant.isAllPrivileges() || grant.getPrivileges().contains(privilege) || (grant.isGrantOption() && privilege.isGrantOption())) {
                checked = true;
                //grantOption = grant.isGrantOption();
                break;
            }
        }
        item.setChecked(checked);
    //grantCheck.setSelection(grantOption);
    }
}
Also used : MySQLPrivilege(org.jkiss.dbeaver.ext.mysql.model.MySQLPrivilege) MySQLGrant(org.jkiss.dbeaver.ext.mysql.model.MySQLGrant)

Aggregations

MySQLGrant (org.jkiss.dbeaver.ext.mysql.model.MySQLGrant)1 MySQLPrivilege (org.jkiss.dbeaver.ext.mysql.model.MySQLPrivilege)1