示例#1
0
 public static Indicator createUserDefIndicator(IndicatorDefinition indicatorDefinition) {
   UserDefIndicator userDefIndicator = IndicatorSqlFactory.eINSTANCE.createUserDefIndicator();
   IndicatorParameters indicParams = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
   userDefIndicator.setParameters(indicParams);
   userDefIndicator.setName(indicatorDefinition.getName());
   return userDefIndicator;
 }
 private boolean isUserDefinedIndicator(IndicatorDefinition indicator) {
   EList<IndicatorCategory> categories = indicator.getCategories();
   if (categories != null && categories.size() > 0) {
     String categoryLabel = categories.get(0).getLabel();
     if (categoryLabel != null && categoryLabel.startsWith("User Define")) { // $NON-NLS-1$
       return true;
     }
   }
   return false;
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public IndicatorDefinition getIndicatorDefinition() {
   if (indicatorDefinition != null && indicatorDefinition.eIsProxy()) {
     InternalEObject oldIndicatorDefinition = (InternalEObject) indicatorDefinition;
     indicatorDefinition = (IndicatorDefinition) eResolveProxy(oldIndicatorDefinition);
     if (indicatorDefinition != oldIndicatorDefinition) {
       if (eNotificationRequired())
         eNotify(
             new ENotificationImpl(
                 this,
                 Notification.RESOLVE,
                 PropertiesPackage.TDQ_INDICATOR_DEFINITION_ITEM__INDICATOR_DEFINITION,
                 oldIndicatorDefinition,
                 indicatorDefinition));
     }
   }
   return indicatorDefinition;
 }
示例#4
0
  @Deprecated
  public static Indicator createIndicator(IndicatorDefinition indicatorDefinition) {
    IndicatorCategory category = UDIHelper.getUDICategory(indicatorDefinition);
    Indicator indicator = null;
    if (category != null) {
      if (category.equals(DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory())) {
        indicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
      } else if (category.equals(
          DefinitionHandler.getInstance().getUserDefinedMatchIndicatorCategory())) {
        indicator = IndicatorsFactory.eINSTANCE.createRegexpMatchingIndicator();
      } else if (category.equals(
          DefinitionHandler.getInstance().getUserDefinedFrequencyIndicatorCategory())) {
        indicator = IndicatorsFactory.eINSTANCE.createFrequencyIndicator();
      }

      if (indicator != null) {
        IndicatorParameters indicParams = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
        indicator.setParameters(indicParams);
        indicator.setName(indicatorDefinition.getName());
      }
    }
    return indicator;
  }