use of org.eclipse.ui.internal.services.EvaluationReference in project eclipse.platform.ui by eclipse-platform.
the class WorkbenchWindow method liftRestrictions.
void liftRestrictions() {
if (menuRestrictions.isEmpty()) {
return;
}
EvaluationReference[] refs = menuRestrictions.toArray(new EvaluationReference[menuRestrictions.size()]);
IEvaluationService es = serviceLocator.getService(IEvaluationService.class);
IEvaluationContext currentState = es.getCurrentState();
for (EvaluationReference reference : refs) {
reference.setPostingChanges(true);
boolean os = reference.evaluate(currentState);
reference.clearResult();
boolean ns = reference.evaluate(currentState);
if (os != ns) {
reference.getListener().propertyChange(new PropertyChangeEvent(reference, reference.getProperty(), valueOf(os), valueOf(ns)));
}
}
}
use of org.eclipse.ui.internal.services.EvaluationReference in project eclipse.platform.ui by eclipse-platform.
the class WorkbenchWindow method imposeRestrictions.
void imposeRestrictions() {
Iterator<?> i = menuRestrictions.iterator();
while (i.hasNext()) {
EvaluationReference ref = (EvaluationReference) i.next();
ref.setPostingChanges(false);
}
}
Aggregations