-
New Feature
-
Resolution: Unresolved
-
Normal
-
None
-
6.0.0
TreeDataEvent types are currently represented as integers. I think it would be a good idea to convert this to Java 1.5 enums in ZK 6.0.
public class TreeDataEvent<E> { public static final int CONTENTS_CHANGED = 0; public static final int INTERVAL_ADDED = 1; public static final int INTERVAL_REMOVED = 2; public static final int STRUCTURE_CHANGED = 3; ... }
could be changed to
public class TreeDataEvent<E> { public static enum Type { CONTENTS_CHANGED, INTERVAL_ADDED, INTERVAL_REMOVED, STRUCTURE_CHANGED } ... }
This would make the method signature of fireEvent in AbstractTreeModel much better, because type/indexFrom/indexTo parameters would no longer be confused with each other:
public void fireEvent(E node, int indexFrom, int indexTo, int evtType) // Three consecutive integers are confusing
vs
public void fireEvent(E node, int indexFrom, int indexTo, TreeDataEvent.Type evtType)