Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app.update
Class ServerComponentUpdate

    java.lang.Object
      nextapp.echo2.app.update.ServerComponentUpdate

All Implemented Interfaces:
  java.io.Serializable

    public class ServerComponentUpdate

extends java.lang.Object
implements java.io.Serializable

A description of a server-side update to a single component, i.e., an update which has occurred on the server and must be propagated to the client. Describes the addition and removal of children to the component. Describes modifications to properties of the component. Describes modifications to the `LayoutData` states of children of the component.

See Also:
  Serialized Form

Constructor Summary
`ServerComponentUpdate(Component parent)` Creates a new `ServerComponentUpdate` representing the given `parent` `Component`.

Method Summary
`void` | `addChild(Component child)` Adds a description of an added child to the `ServerComponentUpdate`.
`void` | `appendRemovedDescendants(ServerComponentUpdate update)` Appends the removed child and descendant components of the given `ServerComponentUpdate` to this `ServerComponentUpdate`'s list of removed descendants.
`void` | `cancelUpdateProperty(java.lang.String propertyName)` Cancels an update to a property.
`Component[]` | `getAddedChildren()` Returns the child components which have been added to the parent.
`Component` | `getParent()` Returns the parent component being updated.
`Component[]` | `getRemovedChildren()` Returns the child components which have been removed from the parent.
`Component[]` | `getRemovedDescendants()` Returns all descendants of the child components which have been removed from the parent.
`Component[]` | `getUpdatedLayoutDataChildren()` Returns the child components whose `LayoutData` properties have been updated.
`PropertyUpdate` | `getUpdatedProperty(java.lang.String name)` Returns a `PropertyUpdate` describing an update to the property with the given `name`.
`java.lang.String[]` | `getUpdatedPropertyNames()` Returns the names of all properties being updated in this update.
`boolean` | `hasAddedChild(Component component)` Determines if the specified component has been added as a child in this update.
`boolean` | `hasAddedChildren()` Determines if the update is adding any children to the parent component.
`boolean` | `hasRemovedChild(Component component)` Determines if the specified child was removed from the parent component.
`boolean` | `hasRemovedChildren()` Determines if the update is removing children from the parent component.
`boolean` | `hasRemovedDescendants()` Determines if the update is removing children from the parent that have descendants.
`boolean` | `hasUpdatedLayoutDataChildren()` Determines if the update has child components whose `LayoutData` states have changed.
`boolean` | `hasUpdatedProperties()` Determines if the update is updating properties of the parent component.
`void` | `removeChild(Component child)` Adds a description of a removed child to the `ServerComponentUpdate`.
`void` | `removeDescendant(Component descendant)` Recursive method to add descriptions of descendants which were removed.
`java.lang.String` | `toString()` Display debug representation.
`void` | `updateLayoutData(Component child)` Adds a description of an update to a child component's `LayoutData` information to the `ServerComponentUpdate`.
`void` | `updateProperty(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)` Adds a description of an update to a property of the parent component to the `ServerComponentUpdate`.

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

Constructor Detail

### ServerComponentUpdate

    public ServerComponentUpdate(Component parent)

  Creates a new `ServerComponentUpdate` representing the given `parent` `Component`.

Method Detail

### addChild

    public void addChild(Component child)

  Adds a description of an added child to the `ServerComponentUpdate`.

  Parameters:
    `child` - the child being added

### cancelUpdateProperty

    public void cancelUpdateProperty(java.lang.String propertyName)

  Cancels an update to a property. A cancellation of a property update is performed when the update manager discovers that the state of a property is already correct on the client.

  Parameters:
    `propertyName` - the property update to cancel

### appendRemovedDescendants

    public void appendRemovedDescendants(ServerComponentUpdate update)

  Appends the removed child and descendant components of the given `ServerComponentUpdate` to this `ServerComponentUpdate`'s list of removed descendants. This method is invoked by the `ServerUpdateManager` when a component is removed that is an ancestor of a component that has been updated. In such a case, the descendant `ServerComponentUpdate` is destroyed, and thus its removed descendant components must be stored in the ancestor `ServerComponentUpdate`.

  Parameters:
    `update` - the `ServerComponentUpdate` whose removed descendants are to be appended

### getAddedChildren

    public Component[] getAddedChildren()

  Returns the child components which have been added to the parent.

  Returns:
    the added child components

### getParent

    public Component getParent()

  Returns the parent component being updated.

  Returns:
    the parent component

### getRemovedChildren

    public Component[] getRemovedChildren()

  Returns the child components which have been removed from the parent. These components may or may not have ever been rendered by the container, e.g., if a component was added and removed in a single synchronization it will show up as a removed component even though the container may have never rendered it.

  Returns:
    the removed child components
  See Also:
    `getRemovedDescendants()`

### getRemovedDescendants

    public Component[] getRemovedDescendants()

  Returns all descendants of the child components which have been removed from the parent. This returned array DOES NOT contain the children which were directly removed from the parent component. These components may or may not have ever been rendered by the container, e.g., if a component was added and removed in a single synchronization it will show up as a removed descendant even though the container may have never rendered it.

  Returns:
    the removed descendant components
  See Also:
    `getRemovedChildren()`

### getUpdatedLayoutDataChildren

    public Component[] getUpdatedLayoutDataChildren()

  Returns the child components whose `LayoutData` properties have been updated.

  Returns:
    the changed child components

### getUpdatedProperty

    public PropertyUpdate getUpdatedProperty(java.lang.String name)

  Returns a `PropertyUpdate` describing an update to the property with the given `name`.

  Parameters:
    `name` - the name of the property being updated
  Returns:
    the `PropertyUpdate`, or null if none exists
  See Also:
    `getUpdatedPropertyNames()`

### getUpdatedPropertyNames

    public java.lang.String[] getUpdatedPropertyNames()

  Returns the names of all properties being updated in this update.

  Returns:
    the names of all updated properties
  See Also:
    `getUpdatedPropertyNames()`

### hasAddedChild

    public boolean hasAddedChild(Component component)

  Determines if the specified component has been added as a child in this update.

  Parameters:
    `component` - the component to test
  Returns:
    true if the component was added

### hasAddedChildren

    public boolean hasAddedChildren()

  Determines if the update is adding any children to the parent component.

  Returns:
    true if children are being added

### hasRemovedChild

    public boolean hasRemovedChild(Component component)

  Determines if the specified child was removed from the parent component.

  Parameters:
    `component` - the potentially removed child
  Returns:
    true if the child was removed

### hasRemovedChildren

    public boolean hasRemovedChildren()

  Determines if the update is removing children from the parent component.

  Returns:
    true if children are being removed

### hasRemovedDescendants

    public boolean hasRemovedDescendants()

  Determines if the update is removing children from the parent that have descendants. Having removed descendants implies having removed children. If none of the children being removed have children, this method will return false.

  Returns:
    true if descendants are being removed

### hasUpdatedLayoutDataChildren

    public boolean hasUpdatedLayoutDataChildren()

  Determines if the update has child components whose `LayoutData` states have changed.

  Returns:
    true if `LayoutData` properties are being updated

### hasUpdatedProperties

    public boolean hasUpdatedProperties()

  Determines if the update is updating properties of the parent component.

  Returns:
    true if properties are being updated

### removeChild

    public void removeChild(Component child)

  Adds a description of a removed child to the `ServerComponentUpdate`.

  Parameters:
    `child` - the child being removed

### removeDescendant

    public void removeDescendant(Component descendant)

  Recursive method to add descriptions of descendants which were removed.

  Parameters:
    `descendant` - the removed descendant

### toString

    public java.lang.String toString()

  Display debug representation.

  Overrides:
    `toString` in class `java.lang.Object`
  See Also:
    `Object.toString()`

### updateLayoutData

    public void updateLayoutData(Component child)

  Adds a description of an update to a child component's `LayoutData` information to the `ServerComponentUpdate`.

  Parameters:
    `child` - the updated child

### updateProperty

    public void updateProperty(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)

  Adds a description of an update to a property of the parent component to the `ServerComponentUpdate`.

  Parameters:
    `propertyName` - the name of the property
    `oldValue` - the previous value of the property
    `newValue` - the current value of the property

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD