Exemplo n.º 1
0
  /** Adds a component. */
  protected void addComponent(HTMLComponent component) {

    // add component to list
    fHTMLComponents.addElement(component);

    // add recognized features and set default states
    String[] features = component.getRecognizedFeatures();
    addRecognizedFeatures(features);
    int featureCount = features != null ? features.length : 0;
    for (int i = 0; i < featureCount; i++) {
      Boolean state = component.getFeatureDefault(features[i]);
      if (state != null) {
        setFeature(features[i], state.booleanValue());
      }
    }

    // add recognized properties and set default values
    String[] properties = component.getRecognizedProperties();
    addRecognizedProperties(properties);
    int propertyCount = properties != null ? properties.length : 0;
    for (int i = 0; i < propertyCount; i++) {
      Object value = component.getPropertyDefault(properties[i]);
      if (value != null) {
        setProperty(properties[i], value);
      }
    }
  } // addComponent(HTMLComponent)