1 package org.weda.model.impl;
2
3 import org.weda.enhance.InjectHivemindObject;
4 import org.weda.model.EditorModelException;
5 import org.weda.property.ObjectDescriptorRegistry;
6 import org.weda.property.ObjectDescriptorRegistryException;
7 import org.weda.property.PropertyDescriptor;
8 import org.weda.model.EditorModelGroupException;
9 import org.weda.store.impl.ObjectSet;
10
11 /**
12 *
13 * @author tim
14 */
15 public abstract class ObjectSetEditorModelGroup<T extends ObjectSetEditorModel>
16 extends BaseEditorModelGroup<T>
17 {
18 @InjectHivemindObject()
19 protected static ObjectDescriptorRegistry objectDescriptorRegistry;
20
21 public abstract ObjectSet getObjectSet() throws EditorModelGroupException;
22
23 public PropertyDescriptor getPropertyDescriptor(String propertyPath)
24 throws EditorModelGroupException
25 {
26 try{
27 return objectDescriptorRegistry.getPropertyDescriptor(
28 getObjectSet().getBaseClass(), propertyPath);
29 }catch(ObjectDescriptorRegistryException e){
30 throw new EditorModelGroupException(
31 String.format(
32 "Can't get property descriptor for property path (%s)"
33 , propertyPath)
34 , e);
35 }
36 }
37
38 public boolean isMultiLeveledModelValues() throws EditorModelGroupException {
39 return getObjectSet().getObjects().length>1;
40 }
41
42 }