com.google.gwt.event.logical.shared

## Class AttachEvent

- java.lang.Object
- - com.google.web.bindery.event.shared.Event<H>
  - - com.google.gwt.event.shared.GwtEvent<AttachEvent.Handler>
    - - com.google.gwt.event.logical.shared.AttachEvent

    public class AttachEvent
    extends GwtEvent<AttachEvent.Handler>

Fired when the event source is attached to the browser's document or detached from it.

### Nested Class Summary

Nested Classes
`static interface` `AttachEvent.Handler` Implemented by objects that handle `AttachEvent`.

### Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent

`GwtEvent.Type<H>`

### Field Summary

Fields
`(package private) static GwtEvent.Type<AttachEvent.Handler>` `TYPE` The event type.

### Constructor Summary

Constructors
`protected` `AttachEvent(boolean attached)` Construct a new `AttachEvent`.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected void` `dispatch(AttachEvent.Handler handler)` Should only be called by `HandlerManager`.
`static <S extends HasAttachHandlers> void` `fire(S source, boolean attached)` Fires an `AttachEvent` on all registered handlers in the handler source.
`GwtEvent.Type<AttachEvent.Handler>` `getAssociatedType()` Returns the `Event.Type` used to register this event, allowing an `EventBus` to find handlers of the appropriate class.
`static GwtEvent.Type<AttachEvent.Handler>` `getType()` Ensures the existence of the handler hook and then returns it.
`boolean` `isAttached()` Returns true if this event announces that the source has been attached, false if it has been detached.
`java.lang.String` `toDebugString()` This is a method used primarily for debugging.

### Methods inherited from class com.google.gwt.event.shared.GwtEvent

`assertLive, getSource, isLive, kill, revive`

### Methods inherited from class com.google.web.bindery.event.shared.Event

`setSource, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### TYPE

    static GwtEvent.Type<AttachEvent.Handler> TYPE

The event type.

### Constructor Detail

#### AttachEvent

    protected AttachEvent(boolean attached)

Construct a new `AttachEvent`.

Parameters:
  `attached` - true if the source has been attached

### Method Detail

#### fire

    public static <S extends HasAttachHandlers> void fire(S source,
                                                          boolean attached)

Fires an `AttachEvent` on all registered handlers in the handler source.

Type Parameters:
  `S` - The handler source type
Parameters:
  `source` - the source of the handlers
  `attached` - whether to announce an attach or detach

#### getType

    public static GwtEvent.Type<AttachEvent.Handler> getType()

Ensures the existence of the handler hook and then returns it.

Returns:
  returns a handler hook

#### getAssociatedType

    public final GwtEvent.Type<AttachEvent.Handler> getAssociatedType()

Description copied from class: `Event`
Returns the `Event.Type` used to register this event, allowing an `EventBus` to find handlers of the appropriate class.

Specified by:
  `getAssociatedType` in class `GwtEvent<AttachEvent.Handler>`
Returns:
  the type

#### isAttached

    public boolean isAttached()

Returns true if this event announces that the source has been attached, false if it has been detached.

#### toDebugString

    public java.lang.String toDebugString()

Description copied from class: `Event`
This is a method used primarily for debugging. It gives a string representation of the event details. This does not override the toString method because the compiler cannot always optimize toString out correctly. Event types should override as desired.

Overrides:
  `toDebugString` in class `Event<AttachEvent.Handler>`
Returns:
  a string representing the event's specifics.

#### dispatch

    protected void dispatch(AttachEvent.Handler handler)

Description copied from class: `GwtEvent`
Should only be called by `HandlerManager`. In other words, do not use or call.

Specified by:
  `dispatch` in class `GwtEvent<AttachEvent.Handler>`
Parameters:
  `handler` - handler
See Also:
  `EventBus.dispatchEvent(Event, Object)`