dsto.dfc.swt.forms
Class NumberEndpoint

java.lang.Object
  extended by dsto.dfc.swt.forms.AbstractPipe
      extended by dsto.dfc.swt.forms.PipeEndpoint
          extended by dsto.dfc.swt.forms.NumberEndpoint
All Implemented Interfaces:
Pipe, Disposable, EventListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class NumberEndpoint
extends PipeEndpoint
implements org.eclipse.swt.events.SelectionListener

A pipe endpoint that connects its input to SWT number-like widgets (Scale, Slider, and Spinner currently). Has the ability to batch changes in the text-like widget rather than sending them through individually.

Version:
$Revision$
Author:
WeberD

Field Summary
static int COMMIT_DEFAULT
          Commit changes as soon as the selection changes.
static int COMMIT_LATER
          Commit changes after a period of inactivity of delay milliseconds.
 int commitMode
          Controls when to commit changes to the parent pipe.
 int delay
          Used when commitMode == COMMIT_LATER to control how long a period of inactivity should pass before committing changes to the parent.
 
Fields inherited from class dsto.dfc.swt.forms.AbstractPipe
errorHandler, parent
 
Constructor Summary
NumberEndpoint(org.eclipse.swt.widgets.Control scale)
           
NumberEndpoint(org.eclipse.swt.widgets.Control scale, int commitMode)
           
 
Method Summary
 void dispose()
          Default implementation: does nothing.
 boolean flush()
          Cause any uncommitted changes to any pipe segments in the tree to be pushed back into the pipe sequence (using Pipe.output(Object)).
 void flushLater()
           
 boolean input(Object value)
          Input a value into the pipe tree.
 boolean isDisposed()
          Test if pipe has been disposed.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
           
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
           
 
Methods inherited from class dsto.dfc.swt.forms.PipeEndpoint
connect, output
 
Methods inherited from class dsto.dfc.swt.forms.AbstractPipe
getParent, handlePipeError, setErrorHandler, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMIT_DEFAULT

public static int COMMIT_DEFAULT
Commit changes as soon as the selection changes. May result in lots of events.


COMMIT_LATER

public static int COMMIT_LATER
Commit changes after a period of inactivity of delay milliseconds.


commitMode

public int commitMode
Controls when to commit changes to the parent pipe. Default: COMMIT_DEFAULT. Possible values: COMMIT_DEFAULT, or COMMIT_LATER.


delay

public int delay
Used when commitMode == COMMIT_LATER to control how long a period of inactivity should pass before committing changes to the parent.

Constructor Detail

NumberEndpoint

public NumberEndpoint(org.eclipse.swt.widgets.Control scale)

NumberEndpoint

public NumberEndpoint(org.eclipse.swt.widgets.Control scale,
                      int commitMode)
Method Detail

dispose

public void dispose()
Description copied from class: AbstractPipe
Default implementation: does nothing.

Specified by:
dispose in interface Pipe
Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractPipe

isDisposed

public boolean isDisposed()
Description copied from interface: Pipe
Test if pipe has been disposed.

Specified by:
isDisposed in interface Pipe

input

public boolean input(Object value)
Description copied from interface: Pipe
Input a value into the pipe tree.

Specified by:
input in interface Pipe
Specified by:
input in class PipeEndpoint
Returns:
True if the operation completed successfully.
See Also:
for more info on handling errors.

flush

public boolean flush()
Description copied from interface: Pipe
Cause any uncommitted changes to any pipe segments in the tree to be pushed back into the pipe sequence (using Pipe.output(Object)). This is designed for use by pipes connect editors such as text fields that are not committed immediately: most pipes will simply forward this call on to their children.

Specified by:
flush in interface Pipe
Specified by:
flush in class PipeEndpoint
Returns:
True if the operation completed successfully.
See Also:
for more info on handling errors.

flushLater

public void flushLater()

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener


Copyright © 2008 Commonwealth of Australia