/**
   * Returns all extension elements.
   *
   * @return all extension elements.
   * @throws FrameworkException
   */
  private void initLoaders() throws FrameworkException {

    IExtensionRegistry registry = Platform.getExtensionRegistry();

    if (registry == null) {
      return;
    }

    IExtensionPoint extensionPoint =
        registry.getExtensionPoint(EXTENSION_CONFIG_LOADER_CONTRIBUTOR);

    if (extensionPoint == null) {
      return;
    }

    for (IExtension extension : extensionPoint.getExtensions()) {
      if (extension != null) {
        IConfigurationElement[] elements = extension.getConfigurationElements();

        if (elements != null) {
          for (IConfigurationElement element : elements) {
            if (element != null) {
              IDefaultConfigLoader loader =
                  (IDefaultConfigLoader) element.createExecutableExtension("class");
              loaders.add(loader);
            }
          }
        }
      }
    }

    Collections.sort(
        loaders,
        new Comparator<IDefaultConfigLoader>() {

          public int compare(IDefaultConfigLoader arg0, IDefaultConfigLoader arg1) {
            return arg0.getPriority() - arg1.getPriority();
          }
        });
  }
  /**
   * populate the extended extensions information.
   *
   * @param name
   * @param aggrFunc
   * @param elem
   * @param aggrWrapper
   */
  private void populateExtendedAggrInfo(
      String name,
      IAggregation aggrFunc,
      IConfigurationElement elem,
      AggrFunctionWrapper aggrWrapper)
      throws DataException {
    IConfigurationElement[] uiInfo = elem.getChildren(ELEMENT_UIINFO);
    assert (uiInfo != null && uiInfo.length == 1);
    String paramInfo = uiInfo[0].getAttribute(ATTRIBUTE_PARAMETER_META_INFO);
    String textInfo = uiInfo[0].getAttribute(ATTRIBUTE_TEXT_DATA);
    aggrWrapper.setDisplayName(textInfo);
    // populate parameters to the aggrWrapper
    List paramList = new ArrayList();
    String[] paramInfos = paramInfo.split(","); // $NON-NLS-1$
    boolean[] paramFlags = aggrFunc.getParameterDefn();
    if (paramInfos != null && paramInfos.length > 0 && paramFlags != null) {
      if (paramInfos.length != paramFlags.length)
        throw new DataException(ResourceConstants.INCONSISTENT_AGGREGATION_ARGUMENT_DEFINITION);
      // populateDataFiledParameterDefn( paramList );
      for (int k = 0; k < paramInfos.length; k++) {
        final String s = paramInfos[k].trim();
        int index = s.indexOf(' ');
        String paramName = null;
        if (index > 0) {
          paramName = s.substring(index + 1).trim();
        } else {
          paramName = paramInfos[k];
        }

        ParameterDefn paramDefn = new ParameterDefn(paramName, paramName, !paramFlags[k], true);
        paramList.add(paramDefn);
      }
    }
    IParameterDefn[] params = new IParameterDefn[paramList.size()];
    paramList.toArray(params);
    aggrWrapper.setParameterDefn(params);
  }