private static void collectItems(Class<?> clazz, Map<String, IPropertyItem> items) throws InstantiationException, IllegalAccessException {
- Class<?> superclass = clazz.getSuperclass();
- if(superclass != null)
- collectItems(superclass, items);
-
- for (Method m : clazz.getDeclaredMethods()) {
- m.setAccessible(true);
- for (Annotation annotation : m.getAnnotations()) {
- if (annotation.annotationType().equals(GetPropertyValue.class)) {
- GetPropertyValue get = (GetPropertyValue)annotation;
- PropertyItem item = (PropertyItem)items.get(get.value());
- if (item == null) {
- item = new PropertyItem(get.value());
- items.put(item.id, item);
- }
+ Class<?> superclass = clazz.getSuperclass();
+ if(superclass != null)
+ collectItems(superclass, items);
+
+ for (Method m : clazz.getDeclaredMethods()) {
+ m.setAccessible(true);
+ for (Annotation annotation : m.getAnnotations()) {
+ if (annotation.annotationType().equals(GetPropertyValue.class)) {
+ GetPropertyValue get = (GetPropertyValue)annotation;
+ PropertyItem item = (PropertyItem)items.get(get.value());
+ if (item == null) {
+ item = new PropertyItem(get.value());
+ items.put(item.id, item);
+ }
- item.getter = m;
- item.manipulatorClass = get.manipulator().newInstance().get(m,null);
+ item.getter = m;
+ item.manipulatorClass = get.manipulator().newInstance().get(m,null);
- item.tabId = get.tabId();
+ item.tabId = get.tabId();
- item.name = get.name();
-
-
- } else if (annotation.annotationType().equals(SetPropertyValue.class)) {
- SetPropertyValue set = (SetPropertyValue)annotation;
- PropertyItem item = (PropertyItem)items.get(set.value());
- if (item == null) {
- item = new PropertyItem(set.value());
- items.put(item.id, item);
- }
-
- item.setter = m;
- } else if (annotation.annotationType().equals(CompoundGetPropertyValue.class)) {
- CompoundGetPropertyValue get = (CompoundGetPropertyValue)annotation;
- CompoundPropertyItem item = (CompoundPropertyItem)items.get(get.value());
- if (item == null) {
- item = new CompoundPropertyItem(get.value());
- items.put(item.id, item);
- }
+ item.name = get.name();
+
+
+ } else if (annotation.annotationType().equals(SetPropertyValue.class)) {
+ SetPropertyValue set = (SetPropertyValue)annotation;
+ PropertyItem item = (PropertyItem)items.get(set.value());
+ if (item == null) {
+ item = new PropertyItem(set.value());
+ items.put(item.id, item);
+ }
+
+ item.setter = m;
+ } else if (annotation.annotationType().equals(CompoundGetPropertyValue.class)) {
+ CompoundGetPropertyValue get = (CompoundGetPropertyValue)annotation;
+ CompoundPropertyItem item = (CompoundPropertyItem)items.get(get.value());
+ if (item == null) {
+ item = new CompoundPropertyItem(get.value());
+ items.put(item.id, item);
+ }
- item.getter = m;
- item.manipulatorFactory = get.manipulator().newInstance();
+ item.getter = m;
+ item.manipulatorFactory = get.manipulator().newInstance();
- item.tabId = get.tabId();
+ item.tabId = get.tabId();
- item.name = get.name();
- } else if (annotation.annotationType().equals(CompoundSetPropertyValue.class)) {
- CompoundSetPropertyValue set = (CompoundSetPropertyValue)annotation;
- CompoundPropertyItem item = (CompoundPropertyItem)items.get(set.value());
- if (item == null) {
- item = new CompoundPropertyItem(set.value());
- items.put(item.id, item);
- }
-
- item.setter = m;
- }
- }
- }
+ item.name = get.name();
+ } else if (annotation.annotationType().equals(CompoundSetPropertyValue.class)) {
+ CompoundSetPropertyValue set = (CompoundSetPropertyValue)annotation;
+ CompoundPropertyItem item = (CompoundPropertyItem)items.get(set.value());
+ if (item == null) {
+ item = new CompoundPropertyItem(set.value());
+ items.put(item.id, item);
+ }
+
+ item.setter = m;
+ }
+ }
+ }
}
private static void collectBlacklist(Class<?> clazz, List<String> blacklist) throws InstantiationException, IllegalAccessException {
- Class<?> superclass = clazz.getSuperclass();
- if(superclass != null)
- collectBlacklist(superclass, blacklist);
-
- PropertyTabBlacklist ann = clazz.getAnnotation(PropertyTabBlacklist.class);
- if (ann == null)
- return;
- String s = ann.value();
- if (s == null)
- return;
- if (s.length() == 0)
- return;
- for (String item : s.split(";")) {
- blacklist.add(item);
- }
-
+ Class<?> superclass = clazz.getSuperclass();
+ if(superclass != null)
+ collectBlacklist(superclass, blacklist);
+
+ PropertyTabBlacklist ann = clazz.getAnnotation(PropertyTabBlacklist.class);
+ if (ann == null)
+ return;
+ String s = ann.value();
+ if (s == null)
+ return;
+ if (s.length() == 0)
+ return;
+ for (String item : s.split(";")) {
+ blacklist.add(item);
+ }
+
}
// }
// }
if (Thread.currentThread() == Display.getDefault().getThread()) {
+ if (viewer.getTable().isDisposed())
+ return;
if (DEBUG)System.out.println("Viewer refresh " + id);
for (PropertyItem item : resolvedItems)
if (!item.equals(selectedItem))
if (DEBUG)System.err.println("CELL SET VALUE: " + element + " " + value);
manipulator.setValue((String)value,index);
viewer.refresh(item);
- nodeMap.commit();
+ nodeMap.commit("Set " + item.id + " value to " + value);
}