KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > MethodActionFilter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui;
12
13
14 import org.eclipse.jdt.core.Flags;
15 import org.eclipse.jdt.core.IMethod;
16 import org.eclipse.jdt.core.JavaModelException;
17 import org.eclipse.ui.IActionFilter;
18
19 public class MethodActionFilter implements IActionFilter {
20
21     /**
22      * @see org.eclipse.ui.IActionFilter#testAttribute(Object, String, String)
23      */

24     public boolean testAttribute(Object JavaDoc target, String JavaDoc name, String JavaDoc value) {
25         if (name.equals("MethodActionFilter") //$NON-NLS-1$
26
&& value.equals("isAbstract")) { //$NON-NLS-1$
27
if (target instanceof IMethod) {
28                 IMethod method = (IMethod) target;
29                 try {
30                     return Flags.isAbstract(method.getFlags());
31                 } catch (JavaModelException e) {
32                     JDIDebugUIPlugin.log(e);
33                 }
34                 
35             }
36         }
37         return false;
38     }
39 }
40
Popular Tags