## org.w3c.tools.resources
Class AbstractContainer

    java.lang.Object
      |
      +--org.w3c.tools.resources.AttributeHolder
            |
            +--org.w3c.tools.resources.Resource
                  |
                  +--org.w3c.tools.resources.FramedResource
                        |
                        +--org.w3c.tools.resources.AbstractContainer

Direct Known Subclasses:
  ConfigResource, ContainerResource, ControlResource

public abstract class AbstractContainer
extends FramedResource
implements ContainerInterface, StructureChangedListener, AttributeChangedListener

The top level class for Resource Container.

Field Summary
`static java.lang.String` `ur`

Fields inherited from class org.w3c.tools.resources.FramedResource
`ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener`

Fields inherited from class org.w3c.tools.resources.Resource
`ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id`

Fields inherited from class org.w3c.tools.resources.AttributeHolder
`attributes, values`

Constructor Summary
`AbstractContainer()`

Method Summary
`void` `attributeChanged(AttributeChangedEvent evt)` Gets called when a property changes.
`abstract ResourceReference` `createDefaultResource(java.lang.String name)` Create a default child resource in that container.
`abstract void` `delete(java.lang.String name)` Remove a child resource from that container.
`java.util.Enumeration` `enumerateResourceIdentifiers()`
`abstract java.util.Enumeration` `enumerateResourceIdentifiers(boolean all)` Enumerate children resource identifiers.
`abstract ResourceReference` `lookup(java.lang.String name)` Lookup a children in the container.
`abstract void` `registerResource(java.lang.String name, Resource resource, java.util.Hashtable defs)` Initialize and register the given resource within that container.
`void` `resourceCreated(StructureChangedEvent evt)` A new resource has been created in some space.
`void` `resourceModified(StructureChangedEvent evt)` This handles the `RESOURCE_MODIFIED` kind of events.
`void` `resourceRemoved(StructureChangedEvent evt)` A resource is about to be removed This handles the `RESOURCE_REMOVED` kind of events.
`void` `resourceUnloaded(StructureChangedEvent evt)` A resource is about to be unloaded This handles the `RESOURCE_UNLOADED` kind of events.
`protected ResourceContext` `updateDefaultChildAttributes(java.util.Hashtable attrs)` Ask our frames to update default child attributes.

Methods inherited from class org.w3c.tools.resources.FramedResource

`addAttributeChangedListener, addStructureChangedListener, collectFramesReference, delete, disableEvent, displayEvent, enableEvent, eventDisabled, fireAttributeChangeEvent, fireStructureChangedEvent, fireStructureChangedEvent, frameAdded, frameModified, frameRemoved, getClone, getFrame, getFrame, getFrameReference, getFrameReference, getFramesReference, getOid, initialize, lookup, markModified, notifyUnload, perform, performFrames, postAttributeChangeEvent, postEvent, postStructureChangedEvent, postStructureChangedEvent, processEvent, registerFrame, registerFrameIfNone, removeAttributeChangedListener, removeStructureChangedListener, setSilentValue, setSilentValue, setValue, unregisterFrame`

Methods inherited from class org.w3c.tools.resources.Resource

`acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getSpaceEntry, getStoreEntry, getURLPath, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, unsafeGetContext, unsafeGetIdentifier, unsafeGetValue, updateAttributes`

Methods inherited from class org.w3c.tools.resources.AttributeHolder
`definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeGetString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ur

    public static java.lang.String ur

Constructor Detail

### AbstractContainer

    public AbstractContainer()

Method Detail

### resourceModified

    public void resourceModified(StructureChangedEvent evt)

  This handles the `RESOURCE_MODIFIED` kind of events.
  Specified by:
    resourceModified in interface StructureChangedListener
  Parameters:
    `evt` - The StructureChangeEvent.

### resourceCreated

    public void resourceCreated(StructureChangedEvent evt)

  A new resource has been created in some space. This handles the `RESOURCE_CREATED` kind of events.
  Specified by:
    resourceCreated in interface StructureChangedListener
  Parameters:
    `evt` - The event describing the change.

### resourceRemoved

    public void resourceRemoved(StructureChangedEvent evt)

  A resource is about to be removed This handles the `RESOURCE_REMOVED` kind of events.
  Specified by:
    resourceRemoved in interface StructureChangedListener
  Parameters:
    `evt` - The event describing the change.

### resourceUnloaded

    public void resourceUnloaded(StructureChangedEvent evt)

  A resource is about to be unloaded This handles the `RESOURCE_UNLOADED` kind of events.
  Specified by:
    resourceUnloaded in interface StructureChangedListener
  Parameters:
    `evt` - The event describing the change.

### attributeChanged

    public void attributeChanged(AttributeChangedEvent evt)

  Gets called when a property changes.
  Specified by:
    attributeChanged in interface AttributeChangedListener
  Parameters:
    `evt` - The AttributeChangeEvent describing the change.

### enumerateResourceIdentifiers

    public abstract java.util.Enumeration enumerateResourceIdentifiers(boolean all)

  Enumerate children resource identifiers.
  Specified by:
    enumerateResourceIdentifiers in interface ContainerInterface
  Parameters:
    `all` - Should all resources be enumerated ? Resources are often created on demand only, this flag allows the caller to tell the container about wether it is interested only in already created resources, or in all resources (even the one that have not yet been created).
  Returns:
    An String enumeration, one element per child.

### enumerateResourceIdentifiers

    public java.util.Enumeration enumerateResourceIdentifiers()

### updateDefaultChildAttributes

    protected ResourceContext updateDefaultChildAttributes(java.util.Hashtable attrs)

  Ask our frames to update default child attributes.
  Parameters:
    `attrs` - A hashtable.

### lookup

    public abstract ResourceReference lookup(java.lang.String name)

  Lookup a children in the container.
  Specified by:
    lookup in interface ContainerInterface
  Parameters:
    `name` - The name of the children to lookup. the resource from its store.

### delete

    public abstract void delete(java.lang.String name)
                         throws MultipleLockException

  Remove a child resource from that container.
  Specified by:
    delete in interface ContainerInterface
  Parameters:
    `name` - The name of the child to remove.
  Throws:
    MultipleLockException - If someone else has locked the resource.

### createDefaultResource

    public abstract ResourceReference createDefaultResource(java.lang.String name)

  Create a default child resource in that container. This method is called by the editor to add a default resource in the container under the given name. The meaning of default is left up to the container here.
  Parameters:
    `name` - The identifier for the new resource.

### registerResource

    public abstract void registerResource(java.lang.String name,
                                          Resource resource,
                                          java.util.Hashtable defs)
                                   throws InvalidResourceException

  Initialize and register the given resource within that container.
  Specified by:
    registerResource in interface ContainerInterface
  Parameters:
    `name` - The identifier for the resource.
    `resource` - An unitialized resource instance.
    `defs` - A default set of init attribute values (may be null).
  Throws:
    InvalidResourceException - If an error occurs during the registration.