use of org.eclipse.e4.core.commands.ExpressionContext in project tmdm-studio-se by Talend.
the class JumpToSourceLineHandler method setEnabled.
/*
* (non-Javadoc)
*
* @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
*/
@Override
public void setEnabled(Object evaluationContext) {
if (evaluationContext != null) {
Object defaultVariable = null;
if (evaluationContext instanceof ExpressionContext) {
ExpressionContext exc = (ExpressionContext) evaluationContext;
defaultVariable = exc.getDefaultVariable();
} else if (evaluationContext instanceof EvaluationContext) {
EvaluationContext context = (EvaluationContext) evaluationContext;
defaultVariable = context.getDefaultVariable();
}
if (defaultVariable instanceof List) {
selectedObjs = (List) defaultVariable;
} else {
selectedObjs = null;
}
}
}
use of org.eclipse.e4.core.commands.ExpressionContext in project jbosstools-hibernate by jbosstools.
the class JPAMapToolActionDelegate method setEnabled.
public void setEnabled(Object context) {
if (context instanceof EvaluationContext) {
EvaluationContext ec = (EvaluationContext) context;
Object obj = ec.getDefaultVariable();
refContextObject = new WeakReference<Object>(obj);
} else if (context instanceof ExpressionContext) {
ExpressionContext ec = (ExpressionContext) context;
Object obj = ec.getDefaultVariable();
refContextObject = new WeakReference<Object>(obj);
} else {
refContextObject = null;
}
setBaseEnabled(checkEnabled());
}
Aggregations