Project

General

Profile

Revision e45ed4d5

IDe45ed4d53f164b1e13974678b61cb017acfe2817
Parent 8407c42c
Child c0c46413

Added by Katja Luther over 2 years ago

ref #6159: minor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
110 110

  
111 111
                try {
112 112
                    TreePath path  = ((ITreeSelection) viewer.getSelection()).getPaths()[0];
113
                    checkChildren(path, event.getChecked());
113
                    checkChildren(event.getElement(), event.getChecked());
114 114
                    checkParents(path.getParentPath());
115 115
                }
116 116
                finally {
......
230 230
        checkParents(path.getParentPath());
231 231
    }
232 232

  
233
//    /**
234
//     *
235
//     * @param path
236
//     * @param checked
237
//     */
238
//    private void checkChildren(final TreePath path, final boolean checked) {
239
//        TermContentProvider tcp = new TermContentProvider();
240
//
241
//        if (path == null) {
242
//            return;
243
//        }
244
//        final Object element = path.getLastSegment();
245
//        if (element != null) {
246
//            this.viewer.setChecked(element, checked);
247
//            this.viewer.setGrayed(element, false);
248
//            int length = tcp.getChildren(element).length;
249
//            if(length>1){
250
//                this.viewer.expandToLevel(element, CheckboxTreeViewer.ALL_LEVELS);
251
//                this.viewer.setSubtreeChecked(element, checked);
252
//            }
253
//        }
254
//    }
255
    
233 256
    /**
234
     *
235
     * @param path
236
     * @param checked
237
     */
238
    private void checkChildren(final TreePath path, final boolean checked) {
239
        TermContentProvider tcp = new TermContentProvider();
257
    *
258
    * @param path
259
    * @param checked
260
    */
261
   private void checkChildren(final Object element, final boolean checked) {
262
       TermContentProvider tcp = new TermContentProvider();
240 263

  
241
        if (path == null) {
242
            return;
243
        }
244
        final Object element = path.getLastSegment();
245
        if (element != null) {
246
            this.viewer.setChecked(element, checked);
247
            this.viewer.setGrayed(element, false);
248
            int length = tcp.getChildren(element).length;
249
            if(length>1){
250
                this.viewer.expandToLevel(element, CheckboxTreeViewer.ALL_LEVELS);
251
                this.viewer.setSubtreeChecked(element, checked);
252
            }
253
        }
254
    }
264
       if (element == null) {
265
           return;
266
       }
267
    //   final Object element = path.getLastSegment();
268
       if (element != null) {
269
           this.viewer.setChecked(element, checked);
270
           this.viewer.setGrayed(element, false);
271
           int length = tcp.getChildren(element).length;
272
           if(length>1){
273
               this.viewer.expandToLevel(element, CheckboxTreeViewer.ALL_LEVELS);
274
               this.viewer.setSubtreeChecked(element, checked);
275
           }
276
       }
277
   }
255 278

  
256 279
    @Override
257 280
    public void dispose() {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)