Search in sources :

Example 1 with WMIQualifier

use of org.jkiss.wmi.service.WMIQualifier in project dbeaver by serge-rider.

the class WMIPropertySource method getPropertyDescriptors2.

@Override
public DBPPropertyDescriptor[] getPropertyDescriptors2() {
    try {
        WMIQualifiedObject qualifiedObject = getQualifiedObject();
        if (qualifiedObject == null) {
            return EMPTY_PROPERTIES;
        }
        Collection<WMIQualifier> qualifiers = qualifiedObject.getQualifiers();
        DBPPropertyDescriptor[] result = new DBPPropertyDescriptor[qualifiers.size()];
        int index = 0;
        for (WMIQualifier qualifier : qualifiers) {
            String name = qualifier.getName();
            PropertyDescriptor prop = new PropertyDescriptor("WMI", name, name, null, null, false, null, null, false);
            result[index++] = prop;
        }
        return result;
    } catch (WMIException e) {
        log.error(e);
        return EMPTY_PROPERTIES;
    }
}
Also used : WMIException(org.jkiss.wmi.service.WMIException) DBPPropertyDescriptor(org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor) PropertyDescriptor(org.jkiss.dbeaver.model.impl.PropertyDescriptor) WMIQualifiedObject(org.jkiss.wmi.service.WMIQualifiedObject) WMIQualifier(org.jkiss.wmi.service.WMIQualifier) DBPPropertyDescriptor(org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor)

Aggregations

PropertyDescriptor (org.jkiss.dbeaver.model.impl.PropertyDescriptor)1 DBPPropertyDescriptor (org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor)1 WMIException (org.jkiss.wmi.service.WMIException)1 WMIQualifiedObject (org.jkiss.wmi.service.WMIQualifiedObject)1 WMIQualifier (org.jkiss.wmi.service.WMIQualifier)1