KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > expressions > AlwaysEnabledExpression


1 /*******************************************************************************
2  * Copyright (c) 2007 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.ui.internal.expressions;
13
14 import org.eclipse.core.expressions.EvaluationResult;
15 import org.eclipse.core.expressions.Expression;
16 import org.eclipse.core.expressions.IEvaluationContext;
17
18 /**
19  * An expression that simply returns <code>true</code> at all times. A shared
20  * instance of this expression is provided.
21  *
22  * @since 3.3
23  *
24  */

25 public final class AlwaysEnabledExpression extends Expression {
26
27     public static final AlwaysEnabledExpression INSTANCE = new AlwaysEnabledExpression();
28
29
30     /**
31      * Not to be instantiated
32      */

33     private AlwaysEnabledExpression() {
34     }
35
36     /*
37      * (non-Javadoc)
38      *
39      * @see org.eclipse.core.expressions.Expression#evaluate(org.eclipse.core.expressions.IEvaluationContext)
40      */

41     public EvaluationResult evaluate(IEvaluationContext context) {
42         return EvaluationResult.TRUE;
43     }
44 }
45
Popular Tags