Extension SDK

oracle.ide.layout
Class LayoutController

java.lang.Object
  extended byoracle.ide.layout.LayoutController
All Implemented Interfaces:
Controller

public class LayoutController
extends java.lang.Object
implements Controller

LayoutController class. LayoutController that manages the creation, and activation of layouts.


Field Summary
static int ACTIVATE_LAYOUT_CMD_ID
           
static int DELETE_LAYOUT_CMD_ID
           
static int EDIT_LAYOUT_CMD_ID
           
static int NEW_LAYOUT_CMD_ID
           
 
Constructor Summary
  LayoutController(Layouts layouts, LayoutsPanel panel)
           
protected LayoutController(LayoutsPanel panel)
           
 
Method Summary
protected  boolean activateLayout(Layout layout)
           
 void checkCommands(Context context, Controller activeController)
          checkCommands() should be called on the controller associated with the active view whenever the Context changes.
protected  boolean deleteLayout(Layout layout)
           
 boolean handleEvent(IdeAction action, Context context)
          This method is called when a user interaction with a View triggers the execution of a command.
protected  boolean newLayout(Layout layout)
           
protected  boolean renameLayout(Layout layout, Context context)
           
protected  void setLayouts(Layouts layouts)
           
 Controller supervisor()
          Gets the supervising 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

NEW_LAYOUT_CMD_ID

public static final int NEW_LAYOUT_CMD_ID

ACTIVATE_LAYOUT_CMD_ID

public static final int ACTIVATE_LAYOUT_CMD_ID

EDIT_LAYOUT_CMD_ID

public static final int EDIT_LAYOUT_CMD_ID

DELETE_LAYOUT_CMD_ID

public static final int DELETE_LAYOUT_CMD_ID
Constructor Detail

LayoutController

public LayoutController(Layouts layouts,
                        LayoutsPanel panel)

LayoutController

protected LayoutController(LayoutsPanel panel)
Method Detail

supervisor

public Controller supervisor()
Description copied from interface: Controller
Gets the supervising controller

Specified by:
supervisor in interface Controller
Returns:
the supervising controller.

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.

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. Note that checkCommands() uses a non-overlapping upwards delegation model to update the enabled status of all actions, whereas update() provides a 'virtual-like' mechanism for allowing the most-specific controllers to determine the enabled status of each action being checked.

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.

checkCommands

public void checkCommands(Context context,
                          Controller activeController)
Description copied from interface: Controller
checkCommands() should be called on the controller associated with the active view whenever the Context changes. The method gives the controller a chance to assign the enabled/disabled status of each of the context-sensitive Actions it owns. Calling this method on the active controller should cause all context-sensitive Actions owned by this controller and its supervisor's to be updated. No two controllers should attempt to update the status of the same action or else we would have redundant checking, which we want to avoid. checkCommands() should end by calling supervisor().checkCommands() to make sure actions dealt with by higher-level controllers get updated as well. This method is implemented by BaseController to call checkCommands() on the Ide itself. Note that the only context-sensitive Actions should be updated inside a checkCommands() method. Updating the enabled/disabled state of an action is handled by the update() command.

Specified by:
checkCommands in interface Controller
Parameters:
context - the current context. Null values are acceptable.
activeController - the controller associated with the active view. Null values are acceptable.

deleteLayout

protected boolean deleteLayout(Layout layout)

renameLayout

protected boolean renameLayout(Layout layout,
                               Context context)

activateLayout

protected boolean activateLayout(Layout layout)

newLayout

protected boolean newLayout(Layout layout)

setLayouts

protected void setLayouts(Layouts layouts)

Extension SDK

 

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