Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.util
Class WeightedController

java.lang.Object
  extended by oracle.ide.util.WeightedController
All Implemented Interfaces:
Controller

public class WeightedController
extends java.lang.Object
implements Controller

A WeightedController allows to chain controllers using a weight to control the order. A weighted controller is typically set on an action and exposed by the creator of the action.


Field Summary
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.
 
Fields inherited from interface oracle.ide.controller.Controller
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGED
 
Constructor Summary
WeightedController()
           
WeightedController(Controller firstController, Controller lastController)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_ACTIVE_VIEW_CONTROLLER

public static final Controller USE_ACTIVE_VIEW_CONTROLLER
A generic controller that redirects to the active view. It is sometimes usefull to give the active view a crack at the action before another controller takes it.


NOOP_CONTROLLER

public static final Controller NOOP_CONTROLLER
A generic controller that disables the action and does nothing to handle it. An action is not disabled when nobody handles it. This type of controller can therefore be usefull as last controller.

Constructor Detail

WeightedController

public WeightedController()

WeightedController

public WeightedController(Controller firstController,
                          Controller lastController)
Parameters:
firstController - This is guaranteed to be the first controller. Can be null.
lastController - This is guaranteed to be the last controller. Can be null.
Method Detail

addController

public void addController(Controller controller,
                          double weight)
Adds a controller to the list.

Parameters:
weight - Small value means higher priority: The controllers with the lower values are invoked before the others.

removeController

public void removeController(Controller controller)

update

public boolean update(IdeAction action,
                      Context context)
Description copied from interface: Controller
This method updates the enabled status of the specified action within the specified context. It should generally be called on the controller associated with the active view to allow that controller to take the first crack at determining its enabled status. If that controller wants to update its enabled status, it does so and returns true to indicate that further controllers do not need to be consulted. If the controller does not deal with setting the enabled status of an action, it delegates the request to its supervising controller, all the way up to the Ide. The Ide has a special implementation of update(xx) that further delegates the request to root controllers, until one of them returns true indicating the request was handled by the controller.

Specified by:
update in interface Controller
Parameters:
action - action whose command is to be executed.
context - the current context
Returns:
true if the controller handles the specified command.

handleEvent

public boolean handleEvent(IdeAction action,
                           Context context)
Description copied from interface: Controller
This method is called when a user interaction with a View triggers the execution of a command.

Specified by:
handleEvent in interface Controller
Parameters:
action - action whose command is to be executed.
Returns:
true if the controller handles the specified command.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.