use of org.jkiss.dbeaver.runtime.properties.PropertySourceMap in project dbeaver by dbeaver.
the class PropertyPageStandard method getPropertySource.
@Override
public IPropertySource getPropertySource(Object object) {
if (object == null || object.getClass().isPrimitive() || object instanceof CharSequence || object instanceof Number || object instanceof Boolean) {
// Just for better performance
return null;
}
// (get prop source from adapter, load props, load lazy props -> refresh -> get prop source from adapter, etc).
if (!ArrayUtils.isEmpty(curSelection)) {
for (PropertySourceCache cache : curSelection) {
if (cache.object == object) {
if (!cache.cached) {
cache.propertySource = RuntimeUtils.getObjectAdapter(object, IPropertySource.class);
cache.cached = true;
}
return cache.propertySource;
}
}
}
if (object instanceof Collection) {
return new PropertySourceDelegate(new PropertySourceCollection((Collection<?>) object));
} else if (object instanceof Map) {
return new PropertySourceDelegate(new PropertySourceMap((Map<String, ?>) object));
}
return RuntimeUtils.getObjectAdapter(object, IPropertySource.class);
}
use of org.jkiss.dbeaver.runtime.properties.PropertySourceMap in project dbeaver by serge-rider.
the class PropertyPageStandard method getPropertySource.
@Override
public IPropertySource getPropertySource(Object object) {
if (object == null || object.getClass().isPrimitive() || object instanceof CharSequence || object instanceof Number || object instanceof Boolean) {
// Just for better performance
return null;
}
// (get prop source from adapter, load props, load lazy props -> refresh -> get prop source from adapter, etc).
if (!ArrayUtils.isEmpty(curSelection)) {
for (PropertySourceCache cache : curSelection) {
if (cache.object == object) {
if (!cache.cached) {
cache.propertySource = RuntimeUtils.getObjectAdapter(object, IPropertySource.class);
cache.cached = true;
}
return cache.propertySource;
}
}
}
if (object instanceof Collection) {
return new PropertySourceDelegate(new PropertySourceCollection((Collection<?>) object));
} else if (object instanceof Map) {
return new PropertySourceDelegate(new PropertySourceMap((Map<String, ?>) object));
}
return RuntimeUtils.getObjectAdapter(object, IPropertySource.class);
}
Aggregations