Commit 5cdada19 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

some cleanup of converters and validators

refs 288
parent e9aaf7fe
......@@ -31,7 +31,7 @@ import org.fortiss.af3.project.model.typesystem.ITerm;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 6B24C79597350DFF9733B73F9F8DDC45
* @ConQAT.Rating YELLOW Hash: 7F13BFA104EF10D5E75F6AFADD3DCFB4
*/
public class ActionsToStringConverter extends Converter {
......@@ -44,12 +44,11 @@ public class ActionsToStringConverter extends Converter {
@SuppressWarnings("unchecked")
@Override
public Object convert(Object fromObject) {
final StringBuffer sb = new StringBuffer();
for (final Action action : (List<Action>) fromObject) {
StringBuffer sb = new StringBuffer();
for (Action action : (List<Action>) fromObject) {
if (sb.length() > 0) {
sb.append("; ");
}
Var variable = action.getVariable();
ITerm value = action.getValue();
sb.append(variable.getIdentifier()).append("=")
......
......@@ -27,7 +27,7 @@ import org.fortiss.af3.project.model.typesystem.ITerm;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 09EDBC14717398094018BB8BE67B9D3D
* @ConQAT.Rating YELLOW Hash: DB50E186A2AAC702110AFA4EE080E251
*/
public class GuardToStringConverter extends Converter {
......@@ -40,9 +40,9 @@ public class GuardToStringConverter extends Converter {
@Override
public String convert(Object fromObject) {
Guard condition = (Guard) fromObject;
if (condition == null)
if (condition == null) {
return "";
}
ITerm expression = condition.getExpression();
return expression.toString();
}
......
......@@ -17,17 +17,18 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.behavior;
import static org.fortiss.af3.component.AF3ComponentActivator.getDefault;
import static org.fortiss.af3.project.ui.utils.ParsingUtils.splitString;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.AF3ComponentActivator;
import org.fortiss.af3.component.model.behavior.common.Action;
import org.fortiss.af3.component.model.behavior.common.CommonFactory;
import org.fortiss.af3.expression.model.terms.Var;
import org.fortiss.af3.expression.ui.databinding.StringToITermConverter;
import org.fortiss.af3.project.ui.utils.ParsingUtils;
import org.fortiss.tooling.kernel.utils.LoggingUtils;
import org.fortiss.af3.expression.ui.databinding.convert.StringToIExpressionTermConverter;
/**
* Converts a semi-colon separated string into a set of actions.
......@@ -35,32 +36,34 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 5C3FACA3411E71B0106B782AC98E5307
* @ConQAT.Rating YELLOW Hash: 713302CD805FC4126F7689DB00EA8D9B
*/
public class StringToActionsConverter extends Converter {
/** The converter of a single string. */
private final StringToITermConverter singleStringConverter;
private final StringToIExpressionTermConverter singleStringConverter;
/** Constructor. */
public StringToActionsConverter(EObject editedObject) {
public StringToActionsConverter() {
super(String.class, EList.class);
singleStringConverter = new StringToITermConverter(editedObject);
singleStringConverter = new StringToIExpressionTermConverter();
}
/** {@inheritDoc} */
@Override
public Object convert(Object fromObject) {
// TODO (FH): compile into statement term and test for sequence of
// assignments
EList<EObject> actions = new BasicEList<EObject>();
for (String str : ParsingUtils.splitString((String) fromObject, ";")) {
for (String str : splitString((String) fromObject, ";")) {
Action action = CommonFactory.eINSTANCE.createAction();
try {
String[] strs = ParsingUtils.splitString(str, "=");
String[] strs = splitString(str, "=");
action.setVariable((Var) singleStringConverter.convert(strs[0]));
action.setValue(singleStringConverter.convert(strs[1]));
actions.add(action);
} catch (Exception e) {
LoggingUtils.error(AF3ComponentActivator.getDefault(),
error(getDefault(),
"Conversion problems not caught by the validator!", e);
}
}
......
......@@ -17,14 +17,16 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.behavior;
import static org.eclipse.core.databinding.validation.ValidationStatus.cancel;
import static org.eclipse.core.databinding.validation.ValidationStatus.ok;
import static org.fortiss.af3.project.ui.utils.ParsingUtils.splitString;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.expression.language.ParseException;
import org.fortiss.af3.project.services.ITypeSystemService;
import org.fortiss.af3.project.typesystem.ITypeSystemCompiler;
import org.fortiss.af3.project.ui.utils.ParsingUtils;
/**
* Validates whether a string represents a valid set of actions.
......@@ -47,17 +49,19 @@ public class StringToActionsValidator implements IValidator {
/** {@inheritDoc} */
@Override
public IStatus validate(Object value) {
for (String str : ParsingUtils.splitString(((String) value), ";")) {
// TODO (FH): compile into statement term and test for sequence of
// assignments
for (String str : splitString(((String) value), ";")) {
ITypeSystemCompiler compiler = ITypeSystemService.INSTANCE
.getHandler(editedObject).getTypeSystemCompiler();
try {
String[] strs = ParsingUtils.splitString(str, "=");
String[] strs = splitString(str, "=");
compiler.compileTerm(strs[0]);
compiler.compileTerm(strs[1]);
} catch (ParseException e) {
return ValidationStatus.cancel(e.getMessage());
return cancel(e.getMessage());
}
}
return ValidationStatus.ok();
return ok();
}
}
\ No newline at end of file
......@@ -17,14 +17,13 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.behavior;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.getDefault;
import static org.fortiss.af3.component.utils.BehaviorModelElementFactory.createGuard;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.behavior.common.CommonFactory;
import org.fortiss.af3.component.model.behavior.common.Guard;
import org.fortiss.af3.component.ui.AF3ComponentUIActivator;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.ui.databinding.StringToITermConverter;
import org.fortiss.tooling.kernel.utils.LoggingUtils;
import org.fortiss.af3.expression.ui.databinding.convert.StringToIExpressionTermConverter;
/**
* Converts a string into a guard.
......@@ -32,33 +31,31 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: C15F3ECECBDC88AA23B52C4BEC5C1D66
* @ConQAT.Rating YELLOW Hash: 3D22F801F699A6C4106AB0E96A54701F
*/
public class StringToGuardConverter extends Converter {
/** The converter of a single string. */
private final StringToITermConverter singleStringConverter;
private final StringToIExpressionTermConverter singleStringConverter;
/** Constructor. */
public StringToGuardConverter(EObject editedObject) {
public StringToGuardConverter() {
super(String.class, Guard.class);
singleStringConverter = new StringToITermConverter(editedObject);
singleStringConverter = new StringToIExpressionTermConverter();
}
/** {@inheritDoc} */
@Override
public Object convert(Object fromObject) {
if (((String) fromObject).trim().length() == 0)
if (((String) fromObject).trim().length() == 0) {
return null;
Guard guard = CommonFactory.eINSTANCE.createGuard();
}
try {
guard.setExpression((IExpressionTerm) singleStringConverter
.convert(fromObject));
return createGuard(singleStringConverter.convert(fromObject));
} catch (Exception e) {
LoggingUtils.error(AF3ComponentUIActivator.getDefault(),
error(getDefault(),
"Conversion problems not caught by the validator!", e);
}
return guard;
return null;
}
}
......@@ -17,15 +17,11 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.behavior;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import static org.eclipse.core.databinding.validation.ValidationStatus.ok;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.expression.language.ParseException;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.project.model.typesystem.ITerm;
import org.fortiss.af3.project.services.ITypeSystemService;
import org.fortiss.af3.project.typesystem.ITypeSystemCompiler;
import org.fortiss.af3.expression.ui.databinding.validate.StringToIExpressionTermValidator;
/**
* Validates whether a string represents a valid guard.
......@@ -33,36 +29,22 @@ import org.fortiss.af3.project.typesystem.ITypeSystemCompiler;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 9FCB2026559A7E64CA13D6CB6B68641E
* @ConQAT.Rating YELLOW Hash: 985CB274A68F97291800FF525DC9E0CD
*/
public class StringToGuardValidator implements IValidator {
/** The edited object (e.g. specification) to which this guard will belong. */
private final EObject editedObject;
public class StringToGuardValidator extends StringToIExpressionTermValidator {
/** Constructor */
public StringToGuardValidator(EObject editedObject) {
this.editedObject = editedObject;
super(editedObject);
}
/** {@inheritDoc} */
@Override
public IStatus validate(Object value) {
String term = ((String) value).trim();
if (term.length() == 0)
return ValidationStatus.ok();
ITypeSystemCompiler compiler = ITypeSystemService.INSTANCE.getHandler(
editedObject).getTypeSystemCompiler();
try {
ITerm condition = compiler.compileTerm(term);
if (!(condition instanceof IExpressionTerm)) {
return ValidationStatus
.cancel("The guard condition should be an expression.");
}
} catch (ParseException e) {
return ValidationStatus.cancel(e.getMessage());
if (term.length() == 0) {
return ok();
}
return ValidationStatus.ok();
return super.validate(value);
}
}
\ No newline at end of file
......@@ -25,9 +25,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ColumnViewer;
import org.fortiss.af3.component.model.behavior.common.CommonPackage;
import org.fortiss.af3.component.model.behavior.common.DataStateVariable;
import org.fortiss.af3.expression.ui.databinding.StringToTypeConverter;
import org.fortiss.af3.expression.ui.databinding.StringToTypeValidator;
import org.fortiss.af3.expression.ui.databinding.TypeToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToTypeConverter;
import org.fortiss.af3.expression.ui.databinding.convert.TypeToStringConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToTypeValidator;
import org.fortiss.tooling.base.ui.databinding.AbstractDecoratedTextCellDatabindingEditingSupport;
import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
......@@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
* @author hoelzlf
* @author $Author: hoelzlf $
* @version $Rev: 5261 $
* @ConQAT.Rating YELLOW Hash: 3F48422D2DF75B9DCEED336FEECA41EF
* @ConQAT.Rating YELLOW Hash: 5397995BBCBEDAE4151486189026DC3A
*/
class DataStateTypeEditingSupport extends
AbstractDecoratedTextCellDatabindingEditingSupport {
......@@ -68,7 +68,7 @@ class DataStateTypeEditingSupport extends
/** {@inheritDoc} */
@Override
protected IConverter getTextToModelConverter() {
return new StringToTypeConverter(model);
return new StringToTypeConverter();
}
/** {@inheritDoc} */
......
......@@ -25,9 +25,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ColumnViewer;
import org.fortiss.af3.component.model.behavior.common.CommonPackage;
import org.fortiss.af3.component.model.behavior.common.DataStateVariable;
import org.fortiss.af3.expression.ui.databinding.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.StringToITermConverter;
import org.fortiss.af3.expression.ui.databinding.StringToITermValidator;
import org.fortiss.af3.expression.ui.databinding.convert.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToIExpressionTermConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToIExpressionTermValidator;
import org.fortiss.tooling.base.ui.databinding.AbstractDecoratedTextCellDatabindingEditingSupport;
import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
......@@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
* @author hoelzlf
* @author $Author: hoelzlf $
* @version $Rev: 5261 $
* @ConQAT.Rating YELLOW Hash: 38ED8C20D7F1EDC1F227898231FEBF7E
* @ConQAT.Rating YELLOW Hash: E7686CB2CF23E246BE7A281DC3647B33
*/
class DataStateValueEditingSupport extends
AbstractDecoratedTextCellDatabindingEditingSupport {
......@@ -68,12 +68,12 @@ class DataStateValueEditingSupport extends
/** {@inheritDoc} */
@Override
protected IConverter getTextToModelConverter() {
return new StringToITermConverter(model);
return new StringToIExpressionTermConverter();
}
/** {@inheritDoc} */
@Override
protected IValidator getTextValidator() {
return new StringToITermValidator(model);
return new StringToIExpressionTermValidator(model);
}
}
\ No newline at end of file
......@@ -25,9 +25,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ColumnViewer;
import org.fortiss.af3.component.model.behavior.common.CommonPackage;
import org.fortiss.af3.component.model.behavior.common.DataStateVariable;
import org.fortiss.af3.expression.ui.databinding.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.StringToITermValidator;
import org.fortiss.af3.expression.ui.databinding.StringToVarConverter;
import org.fortiss.af3.expression.ui.databinding.convert.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToVarConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToITermValidator;
import org.fortiss.tooling.base.ui.databinding.AbstractDecoratedTextCellDatabindingEditingSupport;
import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
......@@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
* @author hoelzlf
* @author $Author: hoelzlf $
* @version $Rev: 5261 $
* @ConQAT.Rating YELLOW Hash: 3C4D51E2C65A6B807B49D7DAF476C844
* @ConQAT.Rating YELLOW Hash: F3D641E80132B8250BB6E2EFB2356684
*/
class DataStateVariableNameEditingSupport extends
AbstractDecoratedTextCellDatabindingEditingSupport {
......@@ -68,7 +68,7 @@ class DataStateVariableNameEditingSupport extends
/** {@inheritDoc} */
@Override
protected IConverter getTextToModelConverter() {
return new StringToVarConverter(model);
return new StringToVarConverter();
}
/** {@inheritDoc} */
......
......@@ -36,9 +36,9 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.fortiss.af3.component.model.behavior.code.CodePackage;
import org.fortiss.af3.component.model.behavior.code.CodeSpecification;
import org.fortiss.af3.expression.ui.databinding.StatementSequenceToStringConverter;
import org.fortiss.af3.expression.ui.databinding.StringToStatementSequenceConverter;
import org.fortiss.af3.expression.ui.databinding.StringToStatementSequenceValidator;
import org.fortiss.af3.expression.ui.databinding.convert.StatementSequenceToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToStatementSequenceConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToStatementSequenceValidator;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.ui.fieldassist.FieldAssist;
import org.fortiss.tooling.base.ui.fieldassist.IProposalProvider;
......@@ -51,7 +51,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: F9E4F1457222C29E90F835CF88CFC69D
* @ConQAT.Rating YELLOW Hash: 6DB455B47CBCB2D1A42770B7435B3A05
*/
public final class CodeSpecificationPropertySection extends PropertySectionBase {
......@@ -116,7 +116,7 @@ public final class CodeSpecificationPropertySection extends PropertySectionBase
CodePackage.Literals.CODE_SPECIFICATION__BODY);
performComplexTextBinding(dbc, definitionText, modelObservable,
new StatementSequenceToStringConverter(true),
new StringToStatementSequenceConverter(specification),
new StringToStatementSequenceConverter(),
new StringToStatementSequenceValidator(specification), null);
}
......
......@@ -30,12 +30,12 @@ import org.fortiss.af3.component.model.AF3ComponentPackage;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.component.model.PortSpecification;
import org.fortiss.af3.component.ui.AF3ComponentUIActivator;
import org.fortiss.af3.expression.ui.databinding.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.StringToITermConverter;
import org.fortiss.af3.expression.ui.databinding.StringToITermValidator;
import org.fortiss.af3.expression.ui.databinding.StringToTypeConverter;
import org.fortiss.af3.expression.ui.databinding.StringToTypeValidator;
import org.fortiss.af3.expression.ui.databinding.TypeToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.ITermToStringConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToIExpressionTermConverter;
import org.fortiss.af3.expression.ui.databinding.convert.StringToTypeConverter;
import org.fortiss.af3.expression.ui.databinding.convert.TypeToStringConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToIExpressionTermValidator;
import org.fortiss.af3.expression.ui.databinding.validate.StringToTypeValidator;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
/**
......@@ -44,7 +44,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 4A48FB0889B45B789225F8E4AD648E38
* @ConQAT.Rating YELLOW Hash: 139D1C5C1AA528E829CB5654E9257045
*/
public final class PortSpecificationPropertySection extends PropertySectionBase
implements PortDataPropagation.PortDataAccess {
......@@ -107,16 +107,15 @@ public final class PortSpecificationPropertySection extends PropertySectionBase
IObservableValue modelObservable = observeValue(specification,
AF3ComponentPackage.Literals.PORT_SPECIFICATION__TYPE);
performComplexTextBinding(dbc, typeText, modelObservable,
new TypeToStringConverter(), new StringToTypeConverter(
specification),
new TypeToStringConverter(), new StringToTypeConverter(),
new StringToTypeValidator(specification), null);
modelObservable = observeValue(specification,
AF3ComponentPackage.Literals.PORT_SPECIFICATION__INITIAL_VALUE);
performComplexTextBinding(dbc, initialValueText, modelObservable,
new ITermToStringConverter(), new StringToITermConverter(
specification), new StringToITermValidator(
specification), null);
new ITermToStringConverter(),
new StringToIExpressionTermConverter(),
new StringToIExpressionTermValidator(specification), null);
}
/** Copies port data. */
......
......@@ -12,6 +12,8 @@ Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.af3.expression.ui,
org.fortiss.af3.expression.ui.compose,
org.fortiss.af3.expression.ui.databinding,
org.fortiss.af3.expression.ui.databinding.convert,
org.fortiss.af3.expression.ui.databinding.validate,
org.fortiss.af3.expression.ui.editor,
org.fortiss.af3.expression.ui.handler,
org.fortiss.af3.expression.ui.properties,
......
......@@ -18,12 +18,8 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.af3.expression.ui.databinding;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.dummies.DummyTypeSystemHandler;
import org.fortiss.af3.project.model.typesystem.ITypeSystem;
import org.fortiss.af3.project.services.ITypeSystemService;
import org.fortiss.af3.expression.language.TypeSystemHandler;
import org.fortiss.af3.project.typesystem.ITypeSystemCompiler;
import org.fortiss.af3.project.typesystem.ITypeSystemHandler;
/**
* Base class for all converters based on the compiler.
......@@ -31,7 +27,7 @@ import org.fortiss.af3.project.typesystem.ITypeSystemHandler;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash: 561318B4BF595C80BAF241E1405EFBEE
* @ConQAT.Rating YELLOW Hash: 75367669D534BF0472D9D34102145A33
*/
public abstract class CompilerBasedConverterBase extends Converter {
......@@ -39,14 +35,8 @@ public abstract class CompilerBasedConverterBase extends Converter {
protected ITypeSystemCompiler compiler;
/** Constructor */
public CompilerBasedConverterBase(Object fromType, Object toType,
EObject model) {
public CompilerBasedConverterBase(Object fromType, Object toType) {
super(fromType, toType);
ITypeSystemHandler<? extends ITypeSystem> handler = ITypeSystemService.INSTANCE
.getHandler(model);
if (handler == null) {
handler = new DummyTypeSystemHandler();
}
this.compiler = handler.getTypeSystemCompiler();
this.compiler = TypeSystemHandler.INSTANCE.getTypeSystemCompiler();
}
}
......@@ -19,9 +19,8 @@ package org.fortiss.af3.expression.ui.databinding;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.dummies.DummyTypeSystemHandler;
import org.fortiss.af3.expression.language.TypeSystemHandler;
import org.fortiss.af3.project.model.ProjectConfiguration;
import org.fortiss.af3.project.services.ITypeSystemService;
import org.fortiss.af3.project.typesystem.ITypeSystemCompiler;
import org.fortiss.af3.project.typesystem.ITypeSystemHandler;
import org.fortiss.af3.project.utils.ProjectUtils;
......@@ -32,7 +31,7 @@ import org.fortiss.af3.project.utils.ProjectUtils;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash: E5CE7CACE951285ED3C3E9A670454953
* @ConQAT.Rating YELLOW Hash: F91C1DFC5CE20BA8E6F6A74E952A356C
*/
public abstract class CompilerBasedValidatorBase implements IValidator {
......@@ -43,16 +42,11 @@ public abstract class CompilerBasedValidatorBase implements IValidator {
protected ITypeSystemHandler<?> handler;
/** Project configuration. */
protected ProjectConfiguration config;
protected ProjectConfiguration configuration;
/** Constructor */
public CompilerBasedValidatorBase(EObject model) {
handler = ITypeSystemService.INSTANCE.getHandler(model);
if (handler == null) {
handler = new DummyTypeSystemHandler();
}
this.compiler = handler.getTypeSystemCompiler();
config = ProjectUtils.getProjectConfiguration(model);
this.compiler = TypeSystemHandler.INSTANCE.getTypeSystemCompiler();
configuration = ProjectUtils.getProjectConfiguration(model);
}
}
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.expression.ui.databinding;
package org.fortiss.af3.expression.ui.databinding.convert;
import org.eclipse.core.databinding.conversion.Converter;