Commit 67a5f7df authored by Romain Bioteau's avatar Romain Bioteau
Browse files

fix tests

parent df206c5c
......@@ -51,7 +51,6 @@ import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.emf.databinding.EMFDataBindingContext;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
......@@ -123,13 +122,16 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
private final XtextComparisonExpressionLoader xtextComparisonExpressionLoader;
public ComparisonExpressionEditor(final Resource eResource, final EObject context) {
public ComparisonExpressionEditor(final EObject context) {
this.context = context;
adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
adapterLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
final Injector injector = ConditionModelActivator.getInstance().getInjector(ConditionModelActivator.ORG_BONITASOFT_STUDIO_CONDITION_CONDITIONMODEL);
if (context != null && context.eResource() != null) {
final ConditionModelJavaValidator validator = injector.getInstance(ConditionModelJavaValidator.class);
validator.setCurrentResourceSet(context.eResource().getResourceSet());
validator.setCurrentResourceSet(context.eResource().getResourceSet());
}
xtextComparisonExpressionLoader = new XtextComparisonExpressionLoader(injector);
}
......
/**
*
*
*/
package org.bonitasoft.studio.condition.ui.expression;
......@@ -27,7 +27,7 @@ public class ComparisonExpressionProvider implements IExpressionProvider {
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getExpressions(org.eclipse.emf.ecore.EObject)
*/
@Override
public Set<Expression> getExpressions(EObject context) {
public Set<Expression> getExpressions(final EObject context) {
return Collections.emptySet();
}
......@@ -45,7 +45,7 @@ public class ComparisonExpressionProvider implements IExpressionProvider {
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getIcon(org.bonitasoft.studio.model.expression.Expression)
*/
@Override
public Image getIcon(Expression expression) {
public Image getIcon(final Expression expression) {
return Pics.getImage("balance.png");
}
......@@ -61,7 +61,7 @@ public class ComparisonExpressionProvider implements IExpressionProvider {
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getProposalLabel(org.bonitasoft.studio.model.expression.Expression)
*/
@Override
public String getProposalLabel(Expression expression) {
public String getProposalLabel(final Expression expression) {
return expression.getName();
}
......@@ -69,7 +69,7 @@ public class ComparisonExpressionProvider implements IExpressionProvider {
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#isRelevantFor(org.eclipse.emf.ecore.EObject)
*/
@Override
public boolean isRelevantFor(EObject context) {
public boolean isRelevantFor(final EObject context) {
return context instanceof SequenceFlow ;
}
......@@ -85,9 +85,9 @@ public class ComparisonExpressionProvider implements IExpressionProvider {
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionProvider#getExpressionEditor(org.bonitasoft.studio.model.expression.Expression)
*/
@Override
public IExpressionEditor getExpressionEditor(Expression expression,EObject context) {
public IExpressionEditor getExpressionEditor(final Expression expression,final EObject context) {
if(context != null){
return new ComparisonExpressionEditor(context.eResource(),context);
return new ComparisonExpressionEditor(context);
}
return null;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment