01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.internal.expressions;
11:
12: import org.eclipse.core.expressions.EvaluationResult;
13: import org.eclipse.core.expressions.Expression;
14: import org.eclipse.core.expressions.IEvaluationContext;
15:
16: /**
17: * An expression that simply returns <code>true</code> at all times. A shared
18: * instance of this expression is provided.
19: *
20: * @since 3.3
21: *
22: */
23: public final class AlwaysEnabledExpression extends Expression {
24:
25: public static final AlwaysEnabledExpression INSTANCE = new AlwaysEnabledExpression();
26:
27: /**
28: * Not to be instantiated
29: */
30: private AlwaysEnabledExpression() {
31: }
32:
33: /*
34: * (non-Javadoc)
35: *
36: * @see org.eclipse.core.expressions.Expression#evaluate(org.eclipse.core.expressions.IEvaluationContext)
37: */
38: public EvaluationResult evaluate(IEvaluationContext context) {
39: return EvaluationResult.TRUE;
40: }
41: }
|