1   /**
2    * QJ-Pro
3    * Copyright (c) 2004, http://qjpro.sourceforge.net
4    *
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or
8    * (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful, but WITHOUT
11   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13   * details.
14   *
15   * You should have received a copy of the GNU General Public License along with
16   * this program; if not, write to the Free Software Foundation, Inc.,
17   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18   */
19  package com.qasystems.qstudio.java.integration.eclipse.actions;
20  
21  import com.qasystems.qstudio.java.gui.observation.ObservationPaneController;
22  import com.qasystems.qstudio.java.gui.observation.ObservationSelector;
23  import com.qasystems.qstudio.java.integration.eclipse.ObservationFilterDialog;
24  
25  import org.eclipse.jface.action.Action;
26  
27  public class ObservationFilterAction extends Action {
28    private ObservationPaneController controller;
29  
30    /**
31     * Creates the action.
32     */
33    public ObservationFilterAction(
34      ObservationPaneController controller, String id
35    ) {
36      super(id);
37      this.controller = controller;
38    }
39  
40    /**
41     * Performs this action.
42     */
43    public void run() {
44      ObservationFilterDialog dialog = new ObservationFilterDialog();
45      ObservationSelector filter = controller.getObservationSelector();
46      dialog.setFilter(filter);
47      dialog.open();
48    }
49  }
50