org.netbeans.spi.viewmodel/2 1.32.1

org.netbeans.spi.viewmodel
Interface AsynchronousModelFilter

All Superinterfaces:
Model

public interface AsynchronousModelFilter
extends Model

Change threading of implemented models. Methods implemented in TreeModel, NodeModel (ExtendedNodeModel) and TableModel can be called synchronously in AWT thread as a direct response to user action (this is the default behavior), or asynchronously in a Request Processor or other thread. Register an implementation of this along with other models, if you need to change the original threading.

Since:
1.20

Nested Class Summary
static class AsynchronousModelFilter.CALL
          This enumeration identifies method(s) of view models for which threading information is provided by asynchronous(java.util.concurrent.Executor, org.netbeans.spi.viewmodel.AsynchronousModelFilter.CALL, java.lang.Object) method.
 
Field Summary
static Executor CURRENT_THREAD
          Executor for invocation of models method calls in the current thread.
static Executor DEFAULT
          Executor, which uses a shared RequestProcessor with throughoutput = 1 for models method calls, making the method invocation asynchronous.
 
Method Summary
 Executor asynchronous(Executor original, AsynchronousModelFilter.CALL asynchCall, Object node)
          Change the threading information for view models method calls.
 

Field Detail

CURRENT_THREAD

static final Executor CURRENT_THREAD
Executor for invocation of models method calls in the current thread. This will make method invocation synchronous. It's important that the methods execute fast so that they do not block AWT thread. This is the default executor for AsynchronousModelFilter.CALL.DISPLAY_NAME and AsynchronousModelFilter.CALL.SHORT_DESCRIPTION.


DEFAULT

static final Executor DEFAULT
Executor, which uses a shared RequestProcessor with throughoutput = 1 for models method calls, making the method invocation asynchronous. The UI gives a visual feedback to the user if models method calls take a long time. Use this to keep the UI responsive. This is the default executor for AsynchronousModelFilter.CALL.CHILDREN and AsynchronousModelFilter.CALL.VALUE.

Method Detail

asynchronous

Executor asynchronous(Executor original,
                      AsynchronousModelFilter.CALL asynchCall,
                      Object node)
                      throws UnknownTypeException
Change the threading information for view models method calls. The returned Executor is used to call methods identified by AsynchronousModelFilter.CALL enum.

Parameters:
original - The original Executor
asynchCall - Identification of the method call
node - Object node
Returns:
an instance of Executor
Throws:
UnknownTypeException

org.netbeans.spi.viewmodel/2 1.32.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.