public class WeightedController extends java.lang.Object implements Controller
| Modifier and Type | Field and Description | 
|---|---|
static Controller | 
NOOP_CONTROLLER
A generic controller that disables the action and does nothing to handle it. 
 | 
static Controller | 
USE_ACTIVE_VIEW_CONTROLLER
A generic controller that redirects to the active view. 
 | 
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGED| Constructor and Description | 
|---|
WeightedController()  | 
WeightedController(Controller firstController, Controller lastController)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addController(Controller controller, double weight)
Adds a controller to the list. 
 | 
boolean | 
handleEvent(IdeAction action, Context context)
This method is called when a user interaction with a  
View triggers the execution of a command. | 
void | 
removeController(Controller controller)  | 
boolean | 
update(IdeAction action, Context context)
This method updates the enabled status of the specified action within the specified context. 
 | 
public static final Controller USE_ACTIVE_VIEW_CONTROLLER
public static final Controller NOOP_CONTROLLER
public WeightedController()
public WeightedController(Controller firstController, Controller lastController)
firstController - This is guaranteed to be the first controller. Can be null.lastController - This is guaranteed to be the last controller. Can be null.public void addController(Controller controller, double weight)
weight - Small value means higher priority: The controllers with the lower values are invoked before the others.public void removeController(Controller controller)
public boolean update(IdeAction action, Context context)
Controllerupdate in interface Controlleraction - action whose command is to be executed.context - the current contextpublic boolean handleEvent(IdeAction action, Context context)
ControllerView triggers the execution of a command.handleEvent in interface Controlleraction - action whose command is to be executed.