public code v1
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package flintstones.method.todim.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
@SuppressWarnings("javadoc")
|
||||
public class Messages {
|
||||
|
||||
public String method_name;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
method_name=Interactive and Multicriteria Decision Making (TODIM)
|
||||
+1
@@ -0,0 +1 @@
|
||||
method_name=Método de toma de decisión multicriterio interactivo (TODIM)
|
||||
@@ -0,0 +1,41 @@
|
||||
package flintstones.method.todim;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
|
||||
import flintstones.entity.validatedmethod.ValidatedMethod;
|
||||
import flintstones.entity.valuation.Valuation;
|
||||
import flintstones.helper.chainvalidator.ChainValidator;
|
||||
import flintstones.helper.chainvalidator.operation.method.ValuationTypeOperation;
|
||||
import flintstones.method.todim.messages.Messages;
|
||||
import flintstones.valuation.numeric.NumericValuation;
|
||||
|
||||
public class todimMethod extends ValidatedMethod {
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return messages.method_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void reloadValidator() {
|
||||
|
||||
validator = ContextInjectionFactory.make(ChainValidator.class, context);
|
||||
|
||||
Valuation[] valuations = valuationService.getAll();
|
||||
String valuationsEntity = valuationMessages.Valuation_entity;
|
||||
ValuationTypeOperation valuationTypeOperator =
|
||||
new ValuationTypeOperation(valuationsEntity, NumericValuation.class.getSimpleName(), valuations);
|
||||
|
||||
validator.setReturn(this.getName())
|
||||
.custom(valuationTypeOperator)
|
||||
.named("valuations");//$NON-NLS-1$
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user