blob: d976842fdb36bb0d255e5cdc7bea515d8b618986 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IValueProvider;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
* @author Donald G. Dunne
*/
public class AtsXNumberValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
String name = widgetDef.getXWidgetName();
if ("XFloatDam".equals(name) || "XIntegerDam".equals(name)) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
if (!result.isValid()) {
return result;
}
return isValid(provider, widgetDef);
}
return result;
}
}