Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_0_Build_2052 / applications / appgvSIG / src / org / gvsig / fmap / dal / serverexplorer / filesystem / swing / FilesystemExplorerWizardPanel.java @ 38815

History | View | Annotate | Download (22.9 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 IVER T.I. S.A.   {{Task}}
26
 */
27
package org.gvsig.fmap.dal.serverexplorer.filesystem.swing;
28

    
29
import java.awt.Component;
30
import java.awt.GridBagConstraints;
31
import java.awt.GridBagLayout;
32
import java.awt.Insets;
33
import java.awt.event.ActionEvent;
34
import java.awt.event.ActionListener;
35
import java.io.File;
36
import java.util.ArrayList;
37
import java.util.Iterator;
38
import java.util.List;
39
import java.util.prefs.Preferences;
40

    
41
import javax.swing.AbstractListModel;
42
import javax.swing.JButton;
43
import javax.swing.JList;
44
import javax.swing.JPanel;
45
import javax.swing.JScrollPane;
46
import javax.swing.ScrollPaneConstants;
47
import javax.swing.event.ListSelectionEvent;
48
import javax.swing.event.ListSelectionListener;
49
import javax.swing.filechooser.FileFilter;
50

    
51
import org.slf4j.Logger;
52
import org.slf4j.LoggerFactory;
53

    
54
import org.gvsig.andami.PluginServices;
55
import org.gvsig.andami.messages.Messages;
56
import org.gvsig.andami.messages.NotificationManager;
57
import org.gvsig.app.ApplicationLocator;
58
import org.gvsig.app.ApplicationManager;
59
import org.gvsig.app.gui.WizardPanel;
60
import org.gvsig.app.prepareAction.PrepareContext;
61
import org.gvsig.fmap.dal.DALLocator;
62
import org.gvsig.fmap.dal.DataManager;
63
import org.gvsig.fmap.dal.DataStoreParameters;
64
import org.gvsig.fmap.dal.exception.DataException;
65
import org.gvsig.fmap.dal.exception.FileNotFoundException;
66
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter;
67
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
68
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
69
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
70
import org.gvsig.fmap.mapcontrol.swing.dynobject.DynObjectEditor;
71
import org.gvsig.fmap.mapcontrol.swing.dynobject.DynObjectViewer;
72
import org.gvsig.gui.beans.swing.JFileChooser;
73
import org.gvsig.tools.dynobject.DynObject;
74
import org.gvsig.tools.service.ServiceException;
75
import org.gvsig.tools.swing.api.ToolsSwingLocator;
76

    
77
/**
78
 * @author jmvivo
79
 * 
80
 */
81
public abstract class FilesystemExplorerWizardPanel extends WizardPanel
82
    implements ActionListener, ListSelectionListener {
83

    
84
    /**
85
         *
86
         */
87
    private static final long serialVersionUID = -3371957786521876903L;
88

    
89
    private static final Logger LOG = LoggerFactory
90
        .getLogger(FilesystemExplorerWizardPanel.class);
91

    
92
    public static final String OPEN_LAYER_FILE_CHOOSER_ID =
93
        "OPEN_LAYER_FILE_CHOOSER_ID";
94

    
95
    protected static final String ADD_COMMAND = "ADD";
96
    protected static final String EDIT_COMMAND = "PROPERTIES";
97
    protected static final String REMOVE_COMMAND = "REMOVE";
98
    protected static final String UP_COMMAND = "UP";
99
    protected static final String DOWN_COMMAND = "DOWN";
100

    
101
    private static String lastPath = null;
102
    private static MyFileFilter lastFilter = null;
103
    private static final String DEFAULT_FILTER = "All_supported";
104

    
105
    private JList fileList;
106
    private JScrollPane fileListScroll;
107
    private JPanel buttonsPanel;
108
    private JButton addButton;
109
    private JButton propertiesButton;
110
    private JButton removeButton;
111
    private JButton upButton;
112
    private JButton downButton;
113

    
114
    protected FilesystemServerExplorer explorer;
115
    private ArrayList<MyFileFilter> filters;
116

    
117
    public void setTabName(String name) {
118
        super.setTabName(name);
119
    }
120

    
121
    /*
122
     * (non-Javadoc)
123
     * 
124
     * @see com.iver.cit.gvsig.gui.WizardPanel#getParameters()
125
     */
126
    @Override
127
    public DataStoreParameters[] getParameters() {
128
        return ((FilesystemStoreListModel) getFileList().getModel())
129
            .getParameters();
130
    }
131

    
132
    /*
133
     * (non-Javadoc)
134
     * 
135
     * @see com.iver.cit.gvsig.gui.WizardPanel#initWizard()
136
     */
137
    @Override
138
    public void initWizard() {
139
        setTabName(PluginServices.getText(this, "Fichero"));
140
        if (lastPath == null) {
141
            Preferences prefs = Preferences.userRoot().node("gvsig.foldering");
142
            lastPath = prefs.get("DataFolder", null);
143
        }
144

    
145
        DataManager dm = DALLocator.getDataManager();
146
        FilesystemServerExplorerParameters param;
147
        try {
148
            param =
149
                (FilesystemServerExplorerParameters) dm
150
                    .createServerExplorerParameters(FilesystemServerExplorer.NAME);
151
            param.setInitialpath(lastPath);
152
            explorer =
153
                (FilesystemServerExplorer) dm.openServerExplorer(
154
                    FilesystemServerExplorer.NAME, param);
155
        } catch (Exception e) {
156
            throw new RuntimeException(e);
157
        }
158

    
159
        int mode = FilesystemServerExplorer.MODE_ALL;
160
        this.filters = new ArrayList<MyFileFilter>();
161
        if (this.getMapCtrl() == null) {
162
            mode = FilesystemServerExplorer.MODE_FEATURE;
163
        } else {
164
            mode =
165
                FilesystemServerExplorer.MODE_GEOMETRY
166
                    | FilesystemServerExplorer.MODE_RASTER;
167
        }
168
        @SuppressWarnings("unchecked")
169
        Iterator<FilesystemFileFilter> iter = explorer.getFilters(mode);
170
        while (iter.hasNext()) {
171
            this.filters.add(new MyFileFilter(iter.next()));
172
        }
173
        this.filters.add(new MyFileFilter(explorer.getFilter(mode,
174
            Messages.get(DEFAULT_FILTER))));
175
        initUI();
176
    }
177

    
178
    private void initUI() {
179
        this.setLayout(new GridBagLayout());
180
        GridBagConstraints constr = new GridBagConstraints();
181

    
182
        constr.gridwidth = GridBagConstraints.RELATIVE;
183
        constr.gridheight = GridBagConstraints.RELATIVE;
184
        constr.fill = GridBagConstraints.BOTH;
185
        constr.anchor = GridBagConstraints.FIRST_LINE_START;
186
        constr.weightx = 1;
187
        constr.weighty = 1;
188
        constr.ipadx = 3;
189
        constr.ipady = 3;
190

    
191
        this.add(getFileListScroll(), constr);
192

    
193
        constr.gridwidth = GridBagConstraints.REMAINDER;
194
        constr.gridheight = GridBagConstraints.RELATIVE;
195
        constr.fill = GridBagConstraints.NONE;
196
        constr.anchor = GridBagConstraints.FIRST_LINE_END;
197
        constr.weightx = 0;
198
        constr.weighty = 0;
199
        this.add(getButtonsPanel(), constr);
200

    
201
        this.updateButtons();
202
        this.updateContainingWizardAcceptButton();
203

    
204
    }
205

    
206
    protected class FilesystemStoreListModel extends AbstractListModel {
207

    
208
        private static final long serialVersionUID = -726119349962990665L;
209
        private ArrayList<FilesystemStoreParameters> theList;
210

    
211
        public FilesystemStoreListModel() {
212
            theList = new ArrayList<FilesystemStoreParameters>();
213
        }
214

    
215
        public DataStoreParameters[] getParameters() {
216
            return theList.toArray(new DataStoreParameters[0]);
217
        }
218

    
219
        public Object getElementAt(int index) {
220
            return theList.get(index).getFile().getName();
221
        }
222

    
223
        public FilesystemStoreParameters getStoreParameterAt(int index) {
224
            return theList.get(index);
225
        }
226

    
227
        public int getSize() {
228
            return theList.size();
229
        }
230

    
231
        public DynObject getDynObjectAt(int index) {
232
            return (DynObject) theList.get(index);
233
        }
234

    
235
        public void add(DynObject dynObject) {
236
            this.theList.add((FilesystemStoreParameters) dynObject);
237
            this.fireIntervalAdded(this, this.theList.size() - 1,
238
                this.theList.size() - 1);
239
        }
240

    
241
        public void addAll(List<FilesystemStoreParameters> toAdd) {
242
            int index0 = this.getSize() - 1;
243
            if (index0 < 0) {
244
                index0 = 0;
245
            }
246
            this.theList.addAll(toAdd);
247
            this.fireIntervalAdded(this, index0, this.theList.size() - 1);
248
        }
249

    
250
        public void remove(int i) {
251
            this.theList.remove(i);
252
            this.fireIntervalRemoved(this, i, i);
253

    
254
        }
255

    
256
        public void up(FilesystemStoreParameters item) {
257
            int curIndex = this.theList.indexOf(item);
258
            if (curIndex < 1) {
259
                return;
260
            }
261
            this.theList.remove(item);
262
            this.theList.add(curIndex - 1, item);
263
            this.fireContentsChanged(this, curIndex, curIndex - 1);
264
        }
265

    
266
        public void down(FilesystemStoreParameters item) {
267
            int curIndex = this.theList.indexOf(item);
268
            if (curIndex < 0) {
269
                return;
270
            } else
271
                if (curIndex == this.theList.size() - 1) {
272
                    return;
273
                }
274
            this.theList.remove(item);
275
            this.theList.add(curIndex + 1, item);
276
            this.fireContentsChanged(this, curIndex, curIndex + 1);
277
        }
278
        
279
        public void forceUpdate(int index) {
280
            this.fireContentsChanged(this, index, index);
281
        }
282

    
283
    }
284

    
285
    protected JList getFileList() {
286
        if (fileList == null) {
287
            fileList = new JList(new FilesystemStoreListModel());
288

    
289
            fileList.addListSelectionListener(this);
290
        }
291
        return fileList;
292
    }
293

    
294
    private JScrollPane getFileListScroll() {
295
        if (fileListScroll == null) {
296
            fileListScroll = new JScrollPane();
297
            fileListScroll.setViewportView(getFileList());
298
            fileListScroll
299
                .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
300
            fileListScroll
301
                .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
302

    
303
        }
304
        return fileListScroll;
305
    }
306

    
307
    private Component getButtonsPanel() {
308
        if (buttonsPanel == null) {
309
            buttonsPanel = new JPanel();
310

    
311
            buttonsPanel.setLayout(new GridBagLayout());
312

    
313
            GridBagConstraints constr = new GridBagConstraints();
314

    
315
            constr.anchor = GridBagConstraints.CENTER;
316
            constr.fill = GridBagConstraints.NONE;
317
            constr.ipadx = 3;
318
            constr.ipady = 3;
319
            constr.insets = new Insets(3, 3, 3, 3);
320
            constr.gridwidth = GridBagConstraints.REMAINDER;
321

    
322
            buttonsPanel.add(getAddButton(), constr);
323
            buttonsPanel.add(getPropertiesButton(), constr);
324
            buttonsPanel.add(getRemoveButton(), constr);
325
            buttonsPanel.add(getUpButton(), constr);
326
            buttonsPanel.add(getDownButton(), constr);
327
            // buttonsPanel.add(new JLabel(), constrLbl);
328
        }
329
        return buttonsPanel;
330
    }
331

    
332
    private JButton getAddButton() {
333
        if (addButton == null) {
334
            addButton =
335
                ToolsSwingLocator.getUsabilitySwingManager().createJButton();
336
            addButton.setText(getLocalizedText("add"));
337
            addButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
338
            addButton.setActionCommand(ADD_COMMAND);
339
            addButton.addActionListener(this);
340
        }
341
        return addButton;
342
    }
343

    
344
    private JButton getPropertiesButton() {
345
        if (propertiesButton == null) {
346
            propertiesButton =
347
                ToolsSwingLocator.getUsabilitySwingManager().createJButton();
348
            propertiesButton.setText(getLocalizedText("properties"));
349
            propertiesButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
350
            propertiesButton.setActionCommand(EDIT_COMMAND);
351
            propertiesButton.addActionListener(this);
352
        }
353
        return propertiesButton;
354
    }
355

    
356
    private JButton getRemoveButton() {
357
        if (removeButton == null) {
358
            removeButton =
359
                ToolsSwingLocator.getUsabilitySwingManager().createJButton();
360
            removeButton.setText(getLocalizedText("remove"));
361
            removeButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
362
            removeButton.setActionCommand(REMOVE_COMMAND);
363
            removeButton.addActionListener(this);
364
        }
365
        return removeButton;
366
    }
367

    
368
    private JButton getUpButton() {
369
        if (upButton == null) {
370
            upButton =
371
                ToolsSwingLocator.getUsabilitySwingManager().createJButton();
372
            upButton.setText(getLocalizedText("up"));
373
            upButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
374
            upButton.setActionCommand(UP_COMMAND);
375
            upButton.addActionListener(this);
376
        }
377
        return upButton;
378
    }
379

    
380
    private JButton getDownButton() {
381
        if (downButton == null) {
382
            downButton =
383
                ToolsSwingLocator.getUsabilitySwingManager().createJButton();
384
            downButton.setText(getLocalizedText("down"));
385
            downButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
386
            downButton.setActionCommand(DOWN_COMMAND);
387
            downButton.addActionListener(this);
388
        }
389
        return downButton;
390
    }
391

    
392
    private String getLocalizedText(String txt) {
393
        try {
394
            return PluginServices.getText(this, txt);
395
        } catch (Exception e) {
396
            return txt;
397
        }
398
    }
399

    
400
    public void actionPerformed(ActionEvent e) {
401
        String command = e.getActionCommand();
402
        FilesystemStoreListModel model =
403
            (FilesystemStoreListModel) getFileList().getModel();
404

    
405
        if (command == ADD_COMMAND) {
406
            List<FilesystemStoreParameters> toAdd = this.addFiles();
407
            if (toAdd.isEmpty()) {
408
                return;
409
            }
410
            model.addAll(toAdd);
411

    
412
            getFileList().setModel(model);
413
            
414
            this.updateContainingWizardAcceptButton();
415

    
416
        } else
417
            if (command == EDIT_COMMAND) {
418
                DynObject dynObject =
419
                    model.getDynObjectAt(getFileList().getSelectedIndex());
420

    
421
                try {
422
                    DynObjectEditor editor = new DynObjectEditor(dynObject);
423
                    editor.editObject(true);
424
                } catch (ServiceException ex) {
425
                    LOG.error(
426
                        "Error creating a Swing component for the DynObject: "
427
                            + dynObject, ex);
428
                }
429

    
430
            } else
431
                if (command == REMOVE_COMMAND) {
432
                    int[] selecteds = getFileList().getSelectedIndices();
433
                    for (int i = selecteds.length - 1; i > -1; i--) {
434
                        model.remove(selecteds[i]);
435
                    }
436
                    getFileList().setSelectedIndex(-1);
437
                    
438
                    this.updateContainingWizardAcceptButton();
439

    
440
                } else
441
                    if (command == UP_COMMAND) {
442
                        List<FilesystemStoreParameters> items =
443
                            new ArrayList<FilesystemStoreParameters>();
444
                        int[] selecteds = getFileList().getSelectedIndices();
445
                        if (selecteds.length == 0 || selecteds[0] == 0) {
446
                            return;
447
                        }
448
                        for (int i = 0; i < selecteds.length; i++) {
449
                            items.add(model.getStoreParameterAt(selecteds[i]));
450
                            selecteds[i]--;
451
                        }
452
                        Iterator<FilesystemStoreParameters> iter =
453
                            items.iterator();
454
                        while (iter.hasNext()) {
455
                            model.up(iter.next());
456
                        }
457
                        getFileList().setSelectedIndices(selecteds);
458

    
459
                    } else
460
                        if (command == DOWN_COMMAND) {
461
                            List<FilesystemStoreParameters> items =
462
                                new ArrayList<FilesystemStoreParameters>();
463
                            int[] selecteds =
464
                                getFileList().getSelectedIndices();
465
                            if (selecteds.length == 0
466
                                || selecteds[selecteds.length - 1] == model
467
                                    .getSize() - 1) {
468
                                return;
469
                            }
470
                            for (int i = selecteds.length - 1; i > -1; i--) {
471
                                items.add(model
472
                                    .getStoreParameterAt(selecteds[i]));
473
                                selecteds[i]++;
474
                            }
475
                            Iterator<FilesystemStoreParameters> iter =
476
                                items.iterator();
477
                            while (iter.hasNext()) {
478
                                model.down(iter.next());
479
                            }
480
                            getFileList().setSelectedIndices(selecteds);
481

    
482
                        } else {
483
                            throw new IllegalArgumentException(command);
484
                        }
485

    
486
    }
487

    
488
    /**
489
     * check number of files already selected for adding
490
     */
491
    private void updateContainingWizardAcceptButton() {
492
        int curr_add_file_count = getFileList().getModel().getSize();
493
        this.callStateChanged(curr_add_file_count > 0);
494
    }
495

    
496
    
497
    public boolean areSettingsValid() {
498
        int curr_add_file_count = getFileList().getModel().getSize();
499
        return (curr_add_file_count > 0);
500
    }
501

    
502
    public List<DynObject> getSelecteds() {
503
        ArrayList<DynObject> list = new ArrayList<DynObject>();
504
        JList fList = this.getFileList();
505
        int[] selecteds = fList.getSelectedIndices();
506
        FilesystemStoreListModel model =
507
            (FilesystemStoreListModel) fList.getModel();
508

    
509
        for (int index : selecteds) {
510
            list.add((DynObject) model.getStoreParameterAt(index));
511
        }
512
        return list;
513
    }
514

    
515
    public void valueChanged(ListSelectionEvent e) {
516
        this.updateButtons();
517
    }
518

    
519
    public class MyFileFilter extends FileFilter {
520

    
521
        public FilesystemFileFilter filter = null;
522

    
523
        public MyFileFilter(FilesystemFileFilter params) {
524
            this.filter = params;
525
        }
526

    
527
        /**
528
         * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
529
         */
530
        public boolean accept(File f) {
531
            if (f.isDirectory()) {
532
                return true;
533
            }
534
            return filter.accept(f);
535

    
536
        }
537

    
538
        /**
539
         * @see javax.swing.filechooser.FileFilter#getDescription()
540
         */
541
        public String getDescription() {
542
            return filter.getDescription();
543
        }
544

    
545
        public String getName() {
546
            return filter.getDataStoreProviderName();
547
        }
548
    }
549

    
550
    private List<FilesystemStoreParameters> addFiles() {
551
        
552
        // this.callStateChanged(true);
553
        
554
        JFileChooser fileChooser =
555
            new JFileChooser(OPEN_LAYER_FILE_CHOOSER_ID,
556
                explorer.getCurrentPath());
557
        fileChooser.setMultiSelectionEnabled(true);
558
        fileChooser.setAcceptAllFileFilterUsed(false);
559

    
560
        Iterator<MyFileFilter> iter = this.filters.iterator();
561
        while (iter.hasNext()) {
562
            fileChooser.addChoosableFileFilter(iter.next());
563
        }
564

    
565
        if (lastFilter != null && filters.contains(lastFilter)) {
566
            fileChooser.setFileFilter(lastFilter);
567
        }
568

    
569
        int result = fileChooser.showOpenDialog(this);
570

    
571
        List<FilesystemStoreParameters> toAdd =
572
            new ArrayList<FilesystemStoreParameters>();
573

    
574
        if (result == JFileChooser.APPROVE_OPTION) {
575
            lastPath = fileChooser.getCurrentDirectory().getAbsolutePath();
576
            try {
577
                explorer.setCurrentPath(fileChooser.getCurrentDirectory());
578
            } catch (FileNotFoundException e) {
579
                NotificationManager.addError(e);
580
            }
581
            lastFilter = (MyFileFilter) fileChooser.getFileFilter();
582
            ApplicationManager appGvSIGMan = ApplicationLocator.getManager();
583
            PrepareContext context = this.getPrepareDataStoreContext();
584
            List<DataStoreParameters> paramList = new ArrayList<DataStoreParameters>();
585
            List<DataStoreParameters> toAddParamList = null;
586
            for (File aFile : fileChooser.getSelectedFiles()) {
587
                try {
588
                        DataStoreParameters param =
589
                        explorer.createStoreParameters(aFile, lastFilter
590
                            .getDescription().compareTo(DEFAULT_FILTER) == 0
591
                            ? null : lastFilter.getName());
592
                    if (param == null) {
593
                        // TODO show warning
594
                        continue;
595
                    }
596

    
597
                    paramList.add(param);
598
                   
599
                } catch (DataException e) {
600
                    NotificationManager.addError(e);
601
                    return null;
602
                }
603
            }
604
            
605
            try {
606
                toAddParamList =
607
                    appGvSIGMan.prepareOpenDataStoreParameters(paramList, context);
608
            } catch (Exception e) {
609
                NotificationManager.addError(e);
610
            }
611
            
612
            for (int i = 0; i < toAddParamList.size(); i++) {
613
                                toAdd.add((FilesystemStoreParameters)toAddParamList.get(i));
614
                        }
615
        }
616
        return toAdd;
617
    }
618

    
619
    protected abstract PrepareContext getPrepareDataStoreContext();
620

    
621
    /**
622
     * Refers to up/down/remove buttons etc. Called when selection changes
623
     */
624
    private void updateButtons() {
625
        int selectedIndex = this.getFileList().getSelectedIndex();
626
        int size = this.getFileList().getModel().getSize();
627
        int[] selecteds = this.getFileList().getSelectedIndices();
628
        if (size < 1) {
629
            this.getPropertiesButton().setEnabled(false);
630
            this.getRemoveButton().setEnabled(false);
631
            this.getUpButton().setEnabled(false);
632
            this.getDownButton().setEnabled(false);
633
            return;
634
        } else
635
            if (size == 1) {
636
                this.getUpButton().setEnabled(false);
637
                this.getDownButton().setEnabled(false);
638
            } else {
639
                this.getUpButton().setEnabled(selectedIndex > 0);
640

    
641
                this.getDownButton().setEnabled(
642
                    selectedIndex > -1
643
                        && selecteds[selecteds.length - 1] < size - 1);
644
            }
645
        this.getPropertiesButton().setEnabled(
646
            selectedIndex > -1
647
                && this.getFileList().getSelectedIndices().length == 1);
648
        this.getRemoveButton().setEnabled(selectedIndex > -1);
649
    }
650

    
651
    public void close() {
652
        if (explorer != null) {
653
            explorer.dispose();
654
            explorer = null;
655
        }
656
        if (filters != null) {
657
            filters.clear();
658
            filters = null;
659
        }
660
    }
661
}