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