KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > propertytester > ProjectPropertyTester


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.core.internal.propertytester;
13
14 import org.eclipse.core.resources.IProject;
15
16 /**
17  * A property tester for various properties of projects.
18  *
19  * @since 3.2
20  */

21 public class ProjectPropertyTester extends ResourcePropertyTester {
22
23     /**
24      * A property indicating whether the project is open (value <code>"open"</code>).
25      */

26     private static final String JavaDoc OPEN = "open"; //$NON-NLS-1$
27

28     /*
29      * (non-Javadoc)
30      *
31      * @see org.eclipse.core.internal.resources.ResourcePropertyTester#test(java.lang.Object,
32      * java.lang.String, java.lang.Object[], java.lang.Object)
33      */

34     public boolean test(Object JavaDoc receiver, String JavaDoc method, Object JavaDoc[] args, Object JavaDoc expectedValue) {
35         if ((receiver instanceof IProject) && method.equals(OPEN))
36             return ((IProject) receiver).isOpen() == toBoolean(expectedValue);
37         return false;
38     }
39 }
40
Popular Tags