Runtime

## org.eclipse.gmf.runtime.emf.type.core
Class MultiClientContext

    java.lang.Object
      org.eclipse.gmf.runtime.emf.type.core.MultiClientContext

All Implemented Interfaces:
  IClientContext

    public class MultiClientContext

extends java.lang.Object
implements IClientContext

Implements a multi-context, which is a compound context representing a group of client contexts.

It's matcher matches an `EObject` if all of child contexts match that `EObject`.

It includes an `IElementType` or an `IEditHelperAdviceDescriptor` if all of the child contexts include that `IElementType` or `IEditHelperAdviceDescriptor`.

Field Summary
`static java.lang.String` `MULTI_CLIENT_CONTEXT_ID` The ID of all multi-contexts.

Constructor Summary
`MultiClientContext(java.util.Collection childContexts)` Initializes me with my child contexts.

Method Summary
`void` `add(IClientContext context)` Adds the given context to this multi-context.
`void` `bindId(java.lang.String typeId)` Binds the `typeId` to each of my children.
`void` `bindPattern(java.util.regex.Pattern pattern)` Binds the `pattern` to each of my children.
`boolean` `equals(java.lang.Object obj)` The children fully determine equality.
`java.util.Collection` `getChildren()` Returns a list of `IClientContext`s contained in this multi-context, or an empty list if this is not a multi-context.
`java.lang.String` `getId()` Returns the context ID defined by the client if this is not a multi-context.
`IElementMatcher` `getMatcher()` Matches an `EObject` if all of my children match that `EObject`.
`int` `hashCode()` The children fully determine equality.
`boolean` `includes(org.eclipse.gmf.runtime.emf.type.core.internal.descriptors.IEditHelperAdviceDescriptor advice)` Includes the `advice` if all of my child contexts include the `advice`.
`boolean` `includes(IElementType elementType)` Includes the `elementType` if all of my child contexts include the `elementType`.
`boolean` `includes(IElementTypeDescriptor elementTypeDescriptor)` Includes the `elementTypeDescriptor` if all of my child contexts include the `elementTypeDescriptor`.
`boolean` `isMultiClientContext()` I am a multi-clientContext.
`java.lang.String` `toString()`

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

Field Detail

### MULTI_CLIENT_CONTEXT_ID

    public static final java.lang.String MULTI_CLIENT_CONTEXT_ID

  The ID of all multi-contexts.

  See Also:
    Constant Field Values

Constructor Detail

### MultiClientContext

    public MultiClientContext(java.util.Collection childContexts)

  Initializes me with my child contexts.

  Parameters:
    `children` - the `IClientContext`s that I represent

Method Detail

### isMultiClientContext

    public boolean isMultiClientContext()

  I am a multi-clientContext.

  Specified by:
    `isMultiClientContext` in interface `IClientContext`
  Returns:
    `true` for a multi-context, `false` otherwise

### add

    public void add(IClientContext context)

  Adds the given context to this multi-context. If `context` is a multi-context, adds its children instead of itself.

  Parameters:
    `status` - the new child context

### getId

    public final java.lang.String getId()

  Description copied from interface: `IClientContext`
  Returns the context ID defined by the client if this is not a multi-context. It is is a mult-context, returns the multi-context ID.

  Specified by:
    `getId` in interface `IClientContext`
  Returns:
    my context ID

### getChildren

    public java.util.Collection getChildren()

  Description copied from interface: `IClientContext`
  Returns a list of `IClientContext`s contained in this multi-context, or an empty list if this is not a multi-context.

  Specified by:
    `getChildren` in interface `IClientContext`
  Returns:
    an array of client context objects

### getMatcher

    public final IElementMatcher getMatcher()

  Matches an `EObject` if all of my children match that `EObject`.

  Specified by:
    `getMatcher` in interface `IClientContext`
  Returns:
    my selector

### bindId

    public void bindId(java.lang.String typeId)

  Binds the `typeId` to each of my children.

  Specified by:
    `bindId` in interface `IClientContext`
  Parameters:
    `typeId` - the ID of a element type or advice that is to be bound to me

### bindPattern

    public void bindPattern(java.util.regex.Pattern pattern)

  Binds the `pattern` to each of my children.

  Specified by:
    `bindPattern` in interface `IClientContext`
  Parameters:
    `pattern` - the pattern of element type and advice IDs that are bound to me

### includes

    public boolean includes(IElementTypeDescriptor elementTypeDescriptor)

  Includes the `elementTypeDescriptor` if all of my child contexts include the `elementTypeDescriptor`.

  Specified by:
    `includes` in interface `IClientContext`
  Parameters:
    `elementTypeDescriptor` - an element type descriptor
  Returns:
    `true` if I am bound to the `elementTypeDescriptor`; `false`, otherwise

### includes

    public boolean includes(IElementType elementType)

  Includes the `elementType` if all of my child contexts include the `elementType`.

  Specified by:
    `includes` in interface `IClientContext`
  Parameters:
    `elementType` - an element type
  Returns:
    `true` if I am bound to the `elementType`; `false`, otherwise

### includes

    public boolean includes(org.eclipse.gmf.runtime.emf.type.core.internal.descriptors.IEditHelperAdviceDescriptor advice)

  Includes the `advice` if all of my child contexts include the `advice`.

  Specified by:
    `includes` in interface `IClientContext`
  Returns:
    `true` if I am bound to the `a`; `false`, otherwise

### equals

    public boolean equals(java.lang.Object obj)

  The children fully determine equality.

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  The children fully determine equality.

  Overrides:
    `hashCode` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.