Component Class

Component Class

This Package | All Packages

public class Component
implements IComponent, IResourceLoader

Represents a base class implementation of IComponent.

Constructors
Name Description
Component() Creates a Component object.

Methods
Name Description
addEventHandler(Object key, Delegate handler) Adds an event handler for a specified key in the event list.
addOnDispose(EventHandler value) Adds an OnDispose event handler.
componentChanged() Calls the ISite.componentChanged method if the component is sited in a container.
dispose() Removes this component from the container if it is sited.
fireEvent(Object key, Event e) Fires an event from this component.
getChildOf(IComponent component) Checks if this component is a child of the specified component.
getContainer() Returns the container to which this component is sited if there is one.
getDesignMode() Determines if the component is currently in design mode.
getDisposing() Determines if the component is currently being disposed.
getEventHandler(Object key) Retrieves a specified event handler.
getName() Retrieves the component name as maintained by the component's site.
getResource(String name) Retrieves a named resource.
getService(Class service) Retrieves the service provided by the site.
getSite() Retrieves the site of this component.
onDispose(Event e) Calls an event handler when being disposed.
removeEventHandler(Object key, Delegate handler) Removes an OnDispose event handler.
removeEventHandlers() Removes all event handlers from this component.
removeOnDispose(EventHandler value) Removes an OnDispose event handler.
setName(String value) Sets the name of the component held by the site.
setSite(ISite value) Sets the site of this component.

Constructors

Component.Component

Syntax
public Component();
Description

Creates a Component object.

Methods

Component.addEventHandler

Syntax
protected void addEventHandler( Object key, Delegate handler );
Parameters
key
The object in the event list to add the handler to.
handler
The delegate that references the event handler for the key object.
Description

Adds an event handler for a specified key in the event list.

Component.addOnDispose

Syntax
public void addOnDispose( EventHandler value );
Description

Adds an OnDispose event handler.

See Also
addOnDispose

Component.componentChanged

Syntax
public void componentChanged();
Description

Calls the ISite.componentChanged method if the component is sited in a container.

Component.dispose

Syntax
public void dispose();
Description

Removes this component from the container if it is sited.

See Also
dispose

Component.fireEvent

Syntax
protected void fireEvent( Object key, Event e );
Description

Fires an event from this component.

Component.getChildOf

Syntax
public boolean getChildOf( IComponent component );
Description

Checks if this component is a child of the specified component.

See Also
getChildOf

Component.getContainer

Syntax
public IContainer getContainer();
Description

Returns the container to which this component is sited if there is one.

Component.getDesignMode

Syntax
public boolean getDesignMode();
Description

Determines if the component is currently in design mode.

Component.getDisposing

Syntax
public boolean getDisposing();
Description

Determines if the component is currently being disposed.

Component.getEventHandler

Syntax
protected Delegate getEventHandler( Object key );
Parameters
key
The object in the event list.
Description

Retrieves a specified event handler.

Component.getName

Syntax
public String getName();
Return Value

Returns the Site.name string, or returns null if the component is not sited.

Description

Retrieves the component name as maintained by the component's site.

Component.getResource

Syntax
public IDataStream getResource( String name );
Description

Retrieves a named resource.

Component.getService

Syntax
public Object getService( Class service );
Return Value

Returns null currently.

Description

Retrieves the service provided by the site.

Component.getSite

Syntax
public ISite getSite();
Return Value

Returns the site of this component.

Description

Retrieves the site of this component.

See Also
IComponent.getSite, wfc.core.ISite

Component.onDispose

Syntax
protected void onDispose( Event e );
Description

Calls an event handler when being disposed.

See Also
onDispose

Component.removeEventHandler

Syntax
protected void removeEventHandler( Object key, Delegate handler );
Description

Removes an OnDispose event handler.

Component.removeEventHandlers

Syntax
protected void removeEventHandlers();
Description

Removes all event handlers from this component.

Component.removeOnDispose

Syntax
public void removeOnDispose( EventHandler value );
Description

Removes an OnDispose event handler.

See Also
removeOnDispose

Component.setName

Syntax
public void setName( String value );
Parameters
value
The new name of the component.
Description

Sets the name of the component held by the site.

Component.setSite

Syntax
public void setSite( ISite value );
Parameters
value
The site of this component.
Description

Sets the site of this component.

See Also
IComponent.setSite, wfc.core.ISite