Revision 38233

View differences:

branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerAddLayerWizardPanel.java
123 123
            try {
124 124
                DynObjectEditor editor = new DynObjectEditor(dynObject);
125 125
                editor.editObject(true);
126
                this.loadParamsList(dynObject);
127 126
            } catch (ServiceException ex) {
128 127
                LOG.error(
129 128
                    "Error creating a Swing component for the DynObject: "
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardPanel.java
109 109
    private JButton removeButton;
110 110
    private JButton upButton;
111 111
    private JButton downButton;
112
    private JScrollPane paramsListScroll;
113
    private JPanel paramsList;
114 112

  
115 113
    protected FilesystemServerExplorer explorer;
116 114
    private ArrayList<MyFileFilter> filters;
......
199 197
        constr.weighty = 0;
200 198
        this.add(getButtonsPanel(), constr);
201 199

  
202
        constr.gridwidth = GridBagConstraints.REMAINDER;
203
        constr.gridheight = GridBagConstraints.REMAINDER;
204
        constr.fill = GridBagConstraints.BOTH;
205
        constr.anchor = GridBagConstraints.FIRST_LINE_START;
206
        constr.weightx = 1;
207
        constr.weighty = 1;
208
        this.add(getParamsListScroll(), constr);
209

  
210 200
        this.updateButtons();
211 201

  
212 202
    }
......
401 391
        }
402 392
    }
403 393

  
404
    private Component getParamsListScroll() {
405
        if (paramsListScroll == null) {
406
            paramsListScroll = new JScrollPane();
407
            paramsListScroll.setBorder(null);
408
            paramsListScroll.setViewportView(getParamsList());
409
            paramsListScroll
410
                .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
411
            paramsListScroll
412
                .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
413
        }
414
        return paramsListScroll;
415
    }
416

  
417
    private JPanel getParamsList() {
418
        if (paramsList == null) {
419
            paramsList = new DynObjectViewer();
420
        }
421
        return paramsList;
422

  
423
    }
424

  
425
    protected void loadParamsList(DynObject dynObj) {
426
        DynObjectViewer panel = (DynObjectViewer) getParamsList();
427

  
428
        panel.load(dynObj);
429
    }
430

  
431 394
    public void actionPerformed(ActionEvent e) {
432 395
        String command = e.getActionCommand();
433 396
        FilesystemStoreListModel model =
......
450 413
                try {
451 414
                    DynObjectEditor editor = new DynObjectEditor(dynObject);
452 415
                    editor.editObject(true);
453
                    this.loadParamsList(dynObject);
454 416
                } catch (ServiceException ex) {
455 417
                    LOG.error(
456 418
                        "Error creating a Swing component for the DynObject: "
......
464 426
                        model.remove(selecteds[i]);
465 427
                    }
466 428
                    getFileList().setSelectedIndex(-1);
467
                    this.loadParamsList(null);
468 429

  
469 430
                } else
470 431
                    if (command == UP_COMMAND) {
......
528 489
    }
529 490

  
530 491
    public void valueChanged(ListSelectionEvent e) {
531
        int index = getFileList().getSelectedIndex();
532
        if (index < 0) {
533
            loadParamsList(null);
534
        } else {
535
            FilesystemStoreListModel model =
536
                ((FilesystemStoreListModel) getFileList().getModel());
537
            this.loadParamsList((DynObject) model.getStoreParameterAt(index));
538
        }
539 492
        this.updateButtons();
540 493
    }
541 494

  

Also available in: Unified diff