Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*******************************************************************************2 * Copyright (c) 2005, 2007 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 12 package org.eclipse.ui.internal.services;13 14 importorg.eclipse.core.expressions.Expression;15 importorg.eclipse.core.expressions.IEvaluationContext;16 importorg.eclipse.ui.ISources;17 18 /**19 * <p>20 * A cache of the result of an expression. This also provides the source21 * priority for the expression.22 * </p>23 * <p>24 * This interface is not intended to be implemented or extended by clients.25 * </p>26 * 27 * @since 3.228 * @see org.eclipse.ui.ISources29 * @see org.eclipse.ui.ISourceProvider30 */31 publicinterface IEvaluationResultCache {32 33 /**34 * Clears the cached computation of the <code>evaluate</code> method, if35 * any. This method is only intended for internal use. It provides a36 * mechanism by which <code>ISourceProvider</code> events can invalidate37 * state on a <code>IEvaluationResultCache</code> instance.38 */39 publicvoid clearResult();40 41 /**42 * Returns the expression controlling the activation or visibility of this43 * item.44 * 45 * @return The expression associated with this item; may be46 * <code>null</code>.47 */48 publicExpression getExpression();49 50 /**51 * Returns the priority that has been given to this expression.52 * 53 * @return The priority.54 * @see ISources55 */56 publicint getSourcePriority();57 58 /**59 * Evaluates the expression -- given the current state of the workbench.60 * This method should cache its computation. The cache will be cleared by a61 * call to <code>clearResult</code>.62 * 63 * @param context64 * The context in which this state should be evaluated; must not65 * be <code>null</code>.66 * @return <code>true</code> if the expression currently evaluates to67 * <code>true</code>; <code>false</code> otherwise.68 */69 publicboolean evaluate(IEvaluationContext context);70 71 /**72 * Forces the cached result to be a particular value. This will <b>not</b>73 * notify any users of the cache that it has changed.74 * 75 * @param result76 * The cached result to use.77 * @since 3.378 */79 publicvoid setResult(boolean result);80 }81