Runtime

## org.eclipse.gmf.runtime.diagram.ui.properties.views
Class TextChangeHelper

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.properties.views.TextChangeHelper

All Implemented Interfaces:
  Listener

    public abstract class TextChangeHelper

extends java.lang.Object
implements Listener

TextChangeHelper notifies the listner of text lifecycle events on behalf of the widget(s) it listens to.

Constructor Summary
`TextChangeHelper()`

Method Summary
`void` `finishNonUserChange()` Clients who call startNonUserChange() should call finishNonUserChange() as soon as possible after the change is done.
`void` `handleEvent(Event event)`
`boolean` `isNonUserChange()` Returns true if a programmatic change is in progress.
`void` `startListeningForEnter(Control control)` Registers this helper with the given control to listen for the Enter key.
`void` `startListeningTo(Control control)` Registers this helper with the given control to listen for events which indicate that a change is in progress (or done).
`void` `startNonUserChange()` Marks the start of a programmatic change to the widget contents.
`void` `stopListeningTo(Control control)` Unregisters this helper from a control previously passed to startListeningTo() and/or startListeningForEnter().
`abstract void` `textChanged(Control control)` Abstract method notified when a text field has been changed.

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

Constructor Detail

### TextChangeHelper

    public TextChangeHelper()

Method Detail

### startNonUserChange

    public void startNonUserChange()

  Marks the start of a programmatic change to the widget contents. Clients must call startNonUserChange() before directly setting the widget contents to avoid unwanted lifecycle events.

  Throws:
    `java.lang.IllegalArgumentException` - if a programmatic change is already in progress.

### finishNonUserChange

    public void finishNonUserChange()

  Clients who call startNonUserChange() should call finishNonUserChange() as soon as possible after the change is done.

  Throws:
    `java.lang.IllegalArgumentException` - if no change is in progress.

### isNonUserChange

    public boolean isNonUserChange()

  Returns true if a programmatic change is in progress.

  Returns:
    `true` if a programmatic change is in progress, `false` otherwise

### handleEvent

    public void handleEvent(Event event)

  Specified by:
    `handleEvent` in interface `Listener`
  See Also:
    `Listener.handleEvent(org.eclipse.swt.widgets.Event)`

### textChanged

    public abstract void textChanged(Control control)

  Abstract method notified when a text field has been changed.

  Parameters:
    `control` -

### startListeningTo

    public void startListeningTo(Control control)

  Registers this helper with the given control to listen for events which indicate that a change is in progress (or done).

  Parameters:
    `control` - `Control` on which listeners will be registered

### startListeningForEnter

    public void startListeningForEnter(Control control)

  Registers this helper with the given control to listen for the Enter key. When Enter is pressed, the change is considered done (this is only appropriate for single-line Text widgets).

  Parameters:
    `control` - `Control` on which enter listener will be registered

### stopListeningTo

    public void stopListeningTo(Control control)

  Unregisters this helper from a control previously passed to startListeningTo() and/or startListeningForEnter().

  Parameters:
    `control` - `Control` from which listeners will be removed

Runtime

Guidelines for using Eclipse APIs.

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