Returns an array of integers specifying the indexs of the components in the path . If path is the root, this will return an empty array. If path is null , null will be returned.
(TreePath path)
| 3196 | * is <code>null</code>, <code>null</code> will be returned. |
| 3197 | */ |
| 3198 | private int[] getModelIndexsForPath(TreePath path) { |
| 3199 | if(path != null) { |
| 3200 | TreeModel model = getModel(); |
| 3201 | int count = path.getPathCount(); |
| 3202 | int[] indexs = new int[count - 1]; |
| 3203 | Object parent = model.getRoot(); |
| 3204 | |
| 3205 | for(int counter = 1; counter < count; counter++) { |
| 3206 | indexs[counter - 1] = model.getIndexOfChild |
| 3207 | (parent, path.getPathComponent(counter)); |
| 3208 | parent = path.getPathComponent(counter); |
| 3209 | if(indexs[counter - 1] < 0) |
| 3210 | return null; |
| 3211 | } |
| 3212 | return indexs; |
| 3213 | } |
| 3214 | return null; |
| 3215 | } |
| 3216 | |
| 3217 | /** |
| 3218 | * Returns a <code>TreePath</code> created by obtaining the children |
no test coverage detected