e179924397239c911f5b17d8e5602e7833462d5a
[scilab.git] / scilab / modules / ui_data / src / java / org / scilab / modules / ui_data / variablebrowser / SwingScilabVariableBrowser.java
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
4  * Copyright (C) 2010 - DIGITEO - Vincent COUVERT
5  * Copyright (C) 2011 - Calixte DENIZET
6  *
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at
11  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12  *
13  */
14 package org.scilab.modules.ui_data.variablebrowser;
15
16 import static org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.asynchronousScilabExec;
17
18 import java.awt.Color;
19 import java.awt.MouseInfo;
20 import java.awt.event.ActionEvent;
21 import java.awt.event.ActionListener;
22 import java.awt.event.MouseEvent;
23 import java.awt.event.MouseListener;
24
25 import javax.swing.ActionMap;
26 import javax.swing.SwingUtilities;
27
28 import java.util.ArrayList;
29 import java.util.HashSet;
30 import java.util.List;
31
32 import javax.swing.JScrollPane;
33 import javax.swing.JTable;
34 import javax.swing.ListSelectionModel;
35 import javax.swing.RowFilter;
36 import javax.swing.table.DefaultTableCellRenderer;
37 import javax.swing.table.TableColumn;
38 import javax.swing.table.TableModel;
39 import javax.swing.table.TableRowSorter;
40
41 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
42 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
43 import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
44 import org.scilab.modules.gui.bridge.contextmenu.SwingScilabContextMenu;
45 import org.scilab.modules.gui.contextmenu.ContextMenu;
46 import org.scilab.modules.gui.contextmenu.ScilabContextMenu;
47 import org.scilab.modules.gui.checkboxmenuitem.CheckBoxMenuItem;
48 import org.scilab.modules.gui.menu.Menu;
49 import org.scilab.modules.gui.menu.ScilabMenu;
50 import org.scilab.modules.gui.menubar.MenuBar;
51 import org.scilab.modules.gui.menubar.ScilabMenuBar;
52 import org.scilab.modules.gui.messagebox.ScilabModalDialog;
53 import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType;
54 import org.scilab.modules.gui.pushbutton.PushButton;
55 import org.scilab.modules.gui.textbox.TextBox;
56 import org.scilab.modules.gui.toolbar.ScilabToolBar;
57 import org.scilab.modules.gui.toolbar.ToolBar;
58 import org.scilab.modules.gui.utils.WindowsConfigurationManager;
59 import org.scilab.modules.localization.Messages;
60 import org.scilab.modules.types.ScilabTypeEnum;
61 import org.scilab.modules.ui_data.BrowseVar;
62 import org.scilab.modules.ui_data.actions.BooleanFilteringAction;
63 import org.scilab.modules.ui_data.actions.CompiledFunctionFilteringAction;
64 import org.scilab.modules.ui_data.actions.DoubleFilteringAction;
65 import org.scilab.modules.ui_data.actions.FunctionLibFilteringAction;
66 import org.scilab.modules.ui_data.actions.GraphicHandlesFilteringAction;
67 import org.scilab.modules.ui_data.actions.HelpAction;
68 import org.scilab.modules.ui_data.actions.ImplicitPolynomialFilteringAction;
69 import org.scilab.modules.ui_data.actions.IntegerFilteringAction;
70 import org.scilab.modules.ui_data.actions.IntrinsicFunctionFilteringAction;
71 import org.scilab.modules.ui_data.actions.ListFilteringAction;
72 import org.scilab.modules.ui_data.actions.MListFilteringAction;
73 import org.scilab.modules.ui_data.actions.MatlabSparseFilteringAction;
74 import org.scilab.modules.ui_data.actions.PointerFilteringAction;
75 import org.scilab.modules.ui_data.actions.PolynomialFilteringAction;
76 import org.scilab.modules.ui_data.actions.ScilabVarFilteringAction;
77 import org.scilab.modules.ui_data.actions.ScilabVarFilteringButtonAction;
78 import org.scilab.modules.ui_data.actions.SparseBoolFilteringAction;
79 import org.scilab.modules.ui_data.actions.SparseFilteringAction;
80 import org.scilab.modules.ui_data.actions.StringFilteringAction;
81 import org.scilab.modules.ui_data.actions.TListFilteringAction;
82 import org.scilab.modules.ui_data.actions.UncompiledFunctionFilteringAction;
83 import org.scilab.modules.ui_data.datatable.SwingTableModel;
84 import org.scilab.modules.ui_data.utils.UiDataMessages;
85 import org.scilab.modules.ui_data.variableeditor.actions.ExportToCsvAction;
86 import org.scilab.modules.ui_data.variablebrowser.actions.CloseAction;
87 import org.scilab.modules.ui_data.variablebrowser.actions.DeleteAction;
88 import org.scilab.modules.ui_data.variablebrowser.actions.RefreshAction;
89 import org.scilab.modules.ui_data.variablebrowser.rowfilter.VariableBrowserRowDataFilter;
90 import org.scilab.modules.ui_data.variablebrowser.rowfilter.VariableBrowserRowTypeFilter;
91
92 /**
93  * Swing implementation of Scilab Variable browser
94  * uses JTable
95  */
96 public final class SwingScilabVariableBrowser extends SwingScilabTab implements SimpleVariableBrowser {
97
98     public static final String VARBROWSERUUID = "3b649047-6a71-4998-bd8e-00d367a4793c";
99
100     private static final long serialVersionUID = 2169382559550113917L;
101
102     private SwingTableModel<Object> dataModel;
103     private JTable table;
104
105     private MenuBar menuBar;
106     private Menu fileMenu;
107     private Menu helpMenu;
108     private Menu filterMenu;
109     private CheckBoxMenuItem filterDoubleCheckBox;
110     private CheckBoxMenuItem filterPolynomialCheckBox;
111     private CheckBoxMenuItem filterScilabVarCheckBox;
112     private CheckBoxMenuItem filterBooleanCheckBox;
113     private CheckBoxMenuItem filterSparseCheckBox;
114     private CheckBoxMenuItem filterSparseBoolCheckBox;
115     private CheckBoxMenuItem filterIntegerCheckBox;
116     private CheckBoxMenuItem filterGraphicHandlesCheckBox;
117     private CheckBoxMenuItem filterStringCheckBox;
118     private CheckBoxMenuItem filterUncompiledFuncCheckBox;
119     private CheckBoxMenuItem filtercompiledFuncCheckBox;
120     private CheckBoxMenuItem filterFunctionLibCheckBox;
121     private CheckBoxMenuItem filterListCheckBox;
122     private CheckBoxMenuItem filterTListCheckBox;
123     private CheckBoxMenuItem filterMListCheckBox;
124     private CheckBoxMenuItem filterPointerCheckBox;
125     private CheckBoxMenuItem filterIntrinsicFunctionCheckBox;
126     private CheckBoxMenuItem filterMatlabSparseCheckBox;
127     private CheckBoxMenuItem filterImplicitPolynomialCheckBox;
128     private PushButton filteringButton;
129
130     private boolean isSetData = false;
131
132     private TableRowSorter < ? > rowSorter;
133
134     /**
135      * Create a JTable with data Model.
136      * @param columnsName : Titles of JTable columns.
137      */
138     public SwingScilabVariableBrowser(String[] columnsName, int[] aligment) {
139         super(UiDataMessages.VARIABLE_BROWSER, VARBROWSERUUID);
140
141         setAssociatedXMLIDForHelp("browsevar");
142
143         buildMenuBar();
144         addMenuBar(menuBar);
145
146         ToolBar toolBar = ScilabToolBar.createToolBar();
147         toolBar.add(RefreshAction.createButton(UiDataMessages.REFRESH));
148         toolBar.addSeparator();
149         toolBar.add(DeleteAction.createButton(this, UiDataMessages.DELETE));
150         toolBar.addSeparator();
151         toolBar.add(HelpAction.createButton(UiDataMessages.HELP));
152         filteringButton = ScilabVarFilteringButtonAction.createButton("Show/hide Scilab variable");
153         //        toolBar.add(filteringButton);
154         addToolBar(toolBar);
155
156         dataModel = new SwingTableModel<Object>(columnsName);
157
158         table = new JTable(dataModel) {
159             //Implement table cell tool tips.
160             public String getToolTipText(MouseEvent e) {
161                 String tip = null;
162                 TableModel model = ((JTable) e.getSource()).getModel();
163                 java.awt.Point p = e.getPoint();
164                 int rowIndex = rowAtPoint(p);
165
166                 if (rowIndex >= 0) {
167                     rowIndex = convertRowIndexToModel(rowIndex);
168                     int colIndex = columnAtPoint(p);
169                     if (colIndex == BrowseVar.TYPE_DESC_COLUMN_INDEX) { /* Scilab type */
170                         try {
171                             tip = Messages.gettext("Scilab type:") + " " + model.getValueAt(rowIndex, BrowseVar.TYPE_COLUMN_INDEX).toString();
172                         } catch (IllegalArgumentException exception) {
173                             /* If the type is not known/managed, don't crash */
174                         }
175                     } else {
176
177                         if (colIndex == BrowseVar.SIZE_COLUMN_INDEX) {
178                             /* Use the getModel() method because the
179                              * column 5 has been removed from display
180                              * but still exist in the model */
181                             tip = Messages.gettext("Bytes:") + " " + model.getValueAt(rowIndex, BrowseVar.BYTES_COLUMN_INDEX).toString();
182                         }
183                     }
184                 }
185                 return tip;
186             }
187         };
188
189         table.setFillsViewportHeight(true);
190         table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
191         table.setAutoCreateRowSorter(true);
192
193         /* Size of the icon column */
194         table.getColumnModel().getColumn(0).setPreferredWidth(30);
195
196         /* Hide the columns. But keep it in memory for the tooltip */
197         TableColumn column = table.getColumnModel().getColumn(BrowseVar.TYPE_COLUMN_INDEX);
198         /* The order to removing does matter since it changes the positions */
199         table.removeColumn(column);
200
201         column = table.getColumnModel().getColumn(BrowseVar.FROM_SCILAB_COLUMN_INDEX);
202         table.removeColumn(column);
203
204         column = table.getColumnModel().getColumn(BrowseVar.BYTES_COLUMN_INDEX);
205         table.removeColumn(column);
206
207         table.addMouseListener(new BrowseVarMouseListener());
208         // Mouse selection mode
209         table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
210         table.setCellSelectionEnabled(true);
211
212         table.setBackground(Color.WHITE);
213         if (table.getGridColor().equals(Color.WHITE)) {
214             table.setGridColor(new Color(128, 128, 128));
215         }
216         table.setShowHorizontalLines(true);
217         table.setShowVerticalLines(true);
218
219         for (int i = 0; i < aligment.length; i++) {
220             align(table, columnsName[i], aligment[i]);
221         }
222
223         // Plug the shortcuts
224         ExportToCsvAction.registerAction(this, table);
225
226         JScrollPane scrollPane = new JScrollPane(table);
227         setContentPane(scrollPane);
228         WindowsConfigurationManager.restorationFinished(this);
229     }
230
231     /**
232      * {@inheritDoc}
233      */
234     public void addInfoBar(TextBox infoBarToAdd) {
235         setInfoBar(infoBarToAdd);
236     }
237
238     /**
239      * {@inheritDoc}
240      */
241     public void addMenuBar(MenuBar menuBarToAdd) {
242         setMenuBar(menuBarToAdd);
243     }
244
245     /**
246      * {@inheritDoc}
247      */
248     public void addToolBar(ToolBar toolBarToAdd) {
249         setToolBar(toolBarToAdd);
250     }
251
252     /**
253      * {@inheritDoc}
254      */
255     public void setColumnNames(String[] columnNames) {
256         dataModel.setColumnNames(columnNames);
257     }
258
259     /**
260      * {@inheritDoc}
261      */
262     public void setData(Object[][] data) {
263         isSetData = true;
264         dataModel.setData(data);
265         rowSorter = new TableRowSorter<TableModel>(dataModel);
266         this.updateRowFiltering();
267     }
268
269     private static void align(JTable table, String name, int alignment) {
270         if (alignment != -1) {
271             DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
272             renderer.setHorizontalAlignment(alignment);
273             try {
274                 TableColumn col = table.getColumn(name);
275                 if (col != null) {
276                     col.setCellRenderer(renderer);
277                 }
278             } catch (IllegalArgumentException e) { }
279         }
280     }
281
282     /**
283      * Update the display after filtering
284      * @see org.scilab.modules.ui_data.variablebrowser.SimpleVariableBrowser#updateRowFiltering()
285      */
286     public void updateRowFiltering() {
287         if (isSetData == false) { /* If the pull of the data has not been done, do it (please) */
288             try {
289                 ScilabInterpreterManagement.synchronousScilabExec("browsevar");
290                 isSetData = true;
291             } catch (InterpreterException e) {
292                 System.err.println(e);
293             }
294         }
295         VariableBrowserRowTypeFilter rowTypeFilter = new VariableBrowserRowTypeFilter(getFilteredTypeValues());
296         VariableBrowserRowDataFilter rowDataFilter = new VariableBrowserRowDataFilter(getFilteredDataValues());
297
298         List<RowFilter<Object, Object>> filters = new ArrayList<RowFilter<Object, Object>>();
299         RowFilter<Object, Object> compoundRowFilter = null;
300         filters.add(rowTypeFilter);
301         filters.add(rowDataFilter);
302         compoundRowFilter = RowFilter.andFilter(filters);
303
304         rowSorter.setRowFilter(compoundRowFilter);
305         table.setRowSorter(rowSorter);
306     }
307
308     /**
309      * MouseListener inner class
310      */
311     private class BrowseVarMouseListener implements MouseListener {
312
313         /**
314          * Contructor
315          */
316         public BrowseVarMouseListener() {
317
318         }
319
320         /**
321          * Mouse CLICKED event handling
322          * @param e the event
323          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
324          */
325         public void mouseClicked(MouseEvent e) {
326
327             // Right click management
328             if ((e.getClickCount() == 1 && SwingUtilities.isRightMouseButton(e)) || e.isPopupTrigger()) {
329
330
331                 int clickedRow = ((JTable) e.getSource()).rowAtPoint(e.getPoint());
332                 // Does nothing if no variable selected
333                 if (clickedRow != -1) {
334                     displayContextMenu();
335                 }
336             }
337
338             if (e.getClickCount() >= 2) {
339                 int clickedRow = ((JTable) e.getSource()).rowAtPoint(e.getPoint());
340                 if (clickedRow != -1) {
341                     String variableName = table.getValueAt(clickedRow, BrowseVar.NAME_COLUMN_INDEX).toString();
342
343                     String variableVisibility = ((JTable) e.getSource())
344                                                 .getValueAt(((JTable) e.getSource()).getSelectedRow(), BrowseVar.VISIBILITY_COLUMN_INDEX).toString();
345
346                     // Global variables are not editable yet
347                     if (variableVisibility.equals("global")) {
348                         ScilabModalDialog.show(getBrowserTab(),
349                                                UiDataMessages.GLOBAL_NOT_EDITABLE,
350                                                UiDataMessages.VARIABLE_EDITOR,
351                                                IconType.ERROR_ICON);
352                         return;
353                     }
354
355                     try {
356                         asynchronousScilabExec(null,
357                                                "if exists(\"" + variableName + "\") == 1 then "
358                                                + "  try "
359                                                + "    editvar(\"" + variableName + "\"); "
360                                                + "  catch "
361                                                + "    messagebox(\"Variables of type \"\"\" + typeof ("
362                                                + variableName + ") + \"\"\" can not be edited.\""
363                                                + ",\"" + UiDataMessages.VARIABLE_EDITOR + "\", \"error\", \"modal\");"
364                                                + "    clear ans;"   // clear return value of messagebox
365                                                + "  end "
366                                                + "else "
367                                                + "  messagebox(\"Variable \"\""
368                                                + variableName + "\"\" no more exists.\""
369                                                + ",\"" + UiDataMessages.VARIABLE_EDITOR + "\", \"error\", \"modal\");"
370                                                + "  clear ans;"  // clear return value of messagebox
371                                                + "  browsevar();" // Reload browsevar to remove cleared variables
372                                                + "end");
373                     } catch (InterpreterException e1) {
374                         System.err.println("An error in the interpreter has been catched: " + e1.getLocalizedMessage());
375                     }
376                 }
377             }
378         }
379
380         /**
381          * Mouse ENTERED event handling
382          * @param e the event
383          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
384          */
385         public void mouseEntered(MouseEvent e) {
386         }
387
388         /**
389          * Mouse EXITED event handling
390          * @param e the event
391          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
392          */
393         public void mouseExited(MouseEvent e) {
394         }
395
396         /**
397          * Mouse PRESSED event handling
398          * @param e the event
399          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
400          */
401         public void mousePressed(MouseEvent e) {
402         }
403
404         /**
405          * Mouse RELEASED event handling
406          * @param e the event
407          * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
408          */
409         public void mouseReleased(MouseEvent e) {
410
411         }
412
413         /**
414          * Create and display the context menu
415          */
416         private void displayContextMenu() {
417             ContextMenu menu = ScilabContextMenu.createContextMenu();
418
419             DeleteAction delete = new DeleteAction(SwingScilabVariableBrowser.this);
420             menu.add(delete.createMenuItem());
421
422             ExportToCsvAction csvExport = new ExportToCsvAction((SwingScilabTab)SwingScilabVariableBrowser.this, UiDataMessages.EXPORTCSV);
423             menu.add(csvExport.createMenuItem(SwingScilabVariableBrowser.this, UiDataMessages.EXPORTCSV));
424             menu.setVisible(true);
425
426             ((SwingScilabContextMenu) menu.getAsSimpleContextMenu()).setLocation(
427                 MouseInfo.getPointerInfo().getLocation().x,
428                 MouseInfo.getPointerInfo().getLocation().y);
429
430         }
431
432
433     }
434
435     /**
436      * Creates the menuBar
437      */
438     public void buildMenuBar() {
439         menuBar = ScilabMenuBar.createMenuBar();
440
441         fileMenu = ScilabMenu.createMenu();
442         fileMenu.setText(UiDataMessages.FILE);
443         fileMenu.setMnemonic('F');
444         fileMenu.add(RefreshAction.createMenuItem(UiDataMessages.REFRESH));
445         fileMenu.addSeparator();
446         fileMenu.add(CloseAction.createMenu());
447
448         menuBar.add(fileMenu);
449
450         filterMenu = ScilabMenu.createMenu();
451         filterMenu.setText(UiDataMessages.FILTER);
452         filterMenu.setMnemonic('I');
453
454         filterScilabVarCheckBox = ScilabVarFilteringAction.createCheckBoxMenu();
455         filterScilabVarCheckBox.setChecked(true);
456         filterMenu.add(filterScilabVarCheckBox);
457
458         filterMenu.addSeparator();
459
460         filterBooleanCheckBox = BooleanFilteringAction.createCheckBoxMenu();
461         filterBooleanCheckBox.setChecked(true);
462         filterMenu.add(filterBooleanCheckBox);
463
464         filterDoubleCheckBox = DoubleFilteringAction.createCheckBoxMenu();
465         filterDoubleCheckBox.setChecked(true);
466         filterMenu.add(filterDoubleCheckBox);
467
468         filterPolynomialCheckBox = PolynomialFilteringAction.createCheckBoxMenu();
469         filterPolynomialCheckBox.setChecked(true);
470         filterMenu.add(filterPolynomialCheckBox);
471
472         filterFunctionLibCheckBox = FunctionLibFilteringAction.createCheckBoxMenu();
473         filterMenu.add(filterFunctionLibCheckBox);
474
475         filterStringCheckBox = StringFilteringAction.createCheckBoxMenu();
476         filterStringCheckBox.setChecked(true);
477         filterMenu.add(filterStringCheckBox);
478
479         filterSparseCheckBox = SparseFilteringAction.createCheckBoxMenu();
480         filterSparseCheckBox.setChecked(true);
481         filterMenu.add(filterSparseCheckBox);
482
483         filterSparseBoolCheckBox = SparseBoolFilteringAction.createCheckBoxMenu();
484         filterSparseBoolCheckBox.setChecked(true);
485         filterMenu.add(filterSparseBoolCheckBox);
486
487         filterIntegerCheckBox = IntegerFilteringAction.createCheckBoxMenu();
488         filterIntegerCheckBox.setChecked(true);
489         filterMenu.add(filterIntegerCheckBox);
490
491         filterGraphicHandlesCheckBox = GraphicHandlesFilteringAction.createCheckBoxMenu();
492         filterGraphicHandlesCheckBox.setChecked(true);
493         filterMenu.add(filterGraphicHandlesCheckBox);
494
495         filterUncompiledFuncCheckBox = UncompiledFunctionFilteringAction.createCheckBoxMenu();
496         filterMenu.add(filterUncompiledFuncCheckBox);
497
498         filtercompiledFuncCheckBox = CompiledFunctionFilteringAction.createCheckBoxMenu();
499         filterMenu.add(filtercompiledFuncCheckBox);
500
501         filterListCheckBox = ListFilteringAction.createCheckBoxMenu();
502         filterListCheckBox.setChecked(true);
503         filterMenu.add(filterListCheckBox);
504
505         filterTListCheckBox = TListFilteringAction.createCheckBoxMenu();
506         filterTListCheckBox.setChecked(true);
507         filterMenu.add(filterTListCheckBox);
508
509         filterMListCheckBox = MListFilteringAction.createCheckBoxMenu();
510         filterMListCheckBox.setChecked(true);
511         filterMenu.add(filterMListCheckBox);
512
513         filterPointerCheckBox = PointerFilteringAction.createCheckBoxMenu();
514         filterPointerCheckBox.setChecked(true);
515         filterMenu.add(filterPointerCheckBox);
516
517         filterIntrinsicFunctionCheckBox = IntrinsicFunctionFilteringAction.createCheckBoxMenu();
518         filterMenu.add(filterIntrinsicFunctionCheckBox);
519
520         filterMatlabSparseCheckBox = MatlabSparseFilteringAction.createCheckBoxMenu();
521         filterMenu.add(filterMatlabSparseCheckBox);
522
523         filterImplicitPolynomialCheckBox = ImplicitPolynomialFilteringAction.createCheckBoxMenu();
524         filterMenu.add(filterImplicitPolynomialCheckBox);
525
526         menuBar.add(filterMenu);
527
528         helpMenu = ScilabMenu.createMenu();
529         helpMenu.setText("?");
530         helpMenu.setMnemonic('?');
531         helpMenu.add(HelpAction.createMenuItem(UiDataMessages.HELP));
532         menuBar.add(helpMenu);
533     }
534
535
536     /**
537      * Filter management of data (Scilab or user data)
538      * @return the set of filtered values
539      */
540     public boolean getFilteredDataValues() {
541         return filterScilabVarCheckBox.isChecked();
542
543     }
544
545     /**
546      * Filter management of type
547      * @return the set of filtered values
548      */
549     public HashSet<ScilabTypeEnum> getFilteredTypeValues() {
550         HashSet<ScilabTypeEnum> filteredValues = new HashSet<ScilabTypeEnum>();
551         // TODO to replace later by something which smells less
552         if (!filterBooleanCheckBox.isChecked()) {
553             filteredValues.add(ScilabTypeEnum.sci_boolean);
554         }
555
556         if (!filterDoubleCheckBox.isChecked()) {
557             filteredValues.add(ScilabTypeEnum.sci_matrix);
558         }
559
560         if (!filterFunctionLibCheckBox.isChecked()) {
561             filteredValues.add(ScilabTypeEnum.sci_lib);
562         }
563
564         if (!filterStringCheckBox.isChecked()) {
565             filteredValues.add(ScilabTypeEnum.sci_strings);
566         }
567
568         if (!filterPolynomialCheckBox.isChecked()) {
569             filteredValues.add(ScilabTypeEnum.sci_poly);
570         }
571
572         if (!filterSparseCheckBox.isChecked()) {
573             filteredValues.add(ScilabTypeEnum.sci_sparse);
574         }
575
576         if (!filterSparseBoolCheckBox.isChecked()) {
577             filteredValues.add(ScilabTypeEnum.sci_boolean_sparse);
578         }
579
580         if (!filterIntegerCheckBox.isChecked()) {
581             filteredValues.add(ScilabTypeEnum.sci_ints);
582         }
583
584         if (!filterGraphicHandlesCheckBox.isChecked()) {
585             filteredValues.add(ScilabTypeEnum.sci_handles);
586         }
587
588         if (!filterUncompiledFuncCheckBox.isChecked()) {
589             filteredValues.add(ScilabTypeEnum.sci_u_function);
590         }
591
592         if (!filtercompiledFuncCheckBox.isChecked()) {
593             filteredValues.add(ScilabTypeEnum.sci_c_function);
594         }
595
596         if (!filterListCheckBox.isChecked()) {
597             filteredValues.add(ScilabTypeEnum.sci_list);
598         }
599
600         if (!filterTListCheckBox.isChecked()) {
601             filteredValues.add(ScilabTypeEnum.sci_tlist);
602         }
603
604         if (!filterMListCheckBox.isChecked()) {
605             filteredValues.add(ScilabTypeEnum.sci_mlist);
606         }
607
608         if (!filterPointerCheckBox.isChecked()) {
609             filteredValues.add(ScilabTypeEnum.sci_pointer);
610         }
611
612         if (!filterIntrinsicFunctionCheckBox.isChecked()) {
613             filteredValues.add(ScilabTypeEnum.sci_intrinsic_function);
614         }
615
616         if (!filterMatlabSparseCheckBox.isChecked()) {
617             filteredValues.add(ScilabTypeEnum.sci_matlab_sparse);
618         }
619
620         if (!filterImplicitPolynomialCheckBox.isChecked()) {
621             filteredValues.add(ScilabTypeEnum.sci_implicit_poly);
622         }
623
624         return filteredValues;
625     }
626
627     /**
628      * Get this browser as a Tab object
629      * @return the tab
630      */
631     public SwingScilabTab getBrowserTab() {
632         return this;
633     }
634
635
636     /**
637      * Return the variable Browser Table
638      * @return The variable Browser Table
639      */
640     public JTable getTable() {
641         return table;
642     }
643 }