blob: 3c4d83f965d1d3b409e4cc46b2a56360e6b4a3ae [file] [log] [blame]
deboer65ea5072005-02-17 19:14:45 +00001/*******************************************************************************
2 * Copyright (c) 2003, 2005 IBM Corporation and others.
deboerfbd35ee2004-12-06 22:18:24 +00003 * All rights reserved. This program and the accompanying materials
deboerdf10c152005-02-17 18:24:46 +00004 * are made available under the terms of the Eclipse Public License v1.0
deboerfbd35ee2004-12-06 22:18:24 +00005 * which accompanies this distribution, and is available at
deboerdf10c152005-02-17 18:24:46 +00006 * http://www.eclipse.org/legal/epl-v10.html
deboer65ea5072005-02-17 19:14:45 +00007 *
deboerfbd35ee2004-12-06 22:18:24 +00008 * Contributors:
deboerf9423572005-02-17 19:34:29 +00009 * IBM Corporation - Initial API and implementation
deboer65ea5072005-02-17 19:14:45 +000010 *******************************************************************************/
deboer03d38972004-12-06 22:29:45 +000011package org.eclipse.wst.internet.monitor.ui.internal.view;
deboerfbd35ee2004-12-06 22:18:24 +000012
13import org.eclipse.jface.action.Action;
14import org.eclipse.jface.action.IAction;
deboere8f7e3c2005-03-08 16:21:51 +000015import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
deboerfbd35ee2004-12-06 22:18:24 +000016/**
17 *
18 */
19public class FilterAction extends Action {
deboer28e80982005-05-31 14:14:37 +000020 protected ViewerManager vm;
deboerfbd35ee2004-12-06 22:18:24 +000021 protected IContentFilter filter;
22 protected boolean enabled;
23
deboer28e80982005-05-31 14:14:37 +000024 public FilterAction(ViewerManager vm, IContentFilter filter) {
deboerfbd35ee2004-12-06 22:18:24 +000025 super(filter.getName(), IAction.AS_CHECK_BOX);
26 this.vm = vm;
27 this.filter = filter;
28 }
29
30 public void run() {
31 if (!isChecked())
32 vm.removeFilter(filter);
33 else
34 vm.addFilter(filter);
35 }
36}