1
/*******************************************************************************
2
* Copyright (c) 2005, 2008 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - initial API and implementation
11
* Sergey Prigogin (Google)
12
*******************************************************************************/
13
package org.eclipse.cdt.internal.ui;
15
import org.eclipse.core.resources.IResource;
16
import org.eclipse.ui.IActionFilter;
18
import org.eclipse.cdt.core.model.ICElement;
21
* An implementation of the IWorkbenchAdapter for CElements.
23
public class CActionFilter implements IActionFilter {
25
public CActionFilter() {
28
public boolean testAttribute(Object target, String name, String value) {
29
ICElement element = (ICElement) target;
30
IResource resource = element.getResource();
31
if (resource != null) {
32
IActionFilter filter = (IActionFilter) resource.getAdapter(IActionFilter.class);
34
return filter.testAttribute(resource, name, value);