Extension SDK

oracle.jdeveloper.model
Class JProjectStructureController

java.lang.Object
  extended byoracle.jdeveloper.model.JProjectStructureController
All Implemented Interfaces:
Addin, Controller

public class JProjectStructureController
extends java.lang.Object
implements Controller, Addin

The JProjectStructureController controller is responsible for handling the project structuring commands. The controller's handleEvent(oracle.ide.IdeAction, oracle.ide.addin.Context) method gets called with the appropriate Command specified. If the Controller does not handle the requested command it delegates the Command to a supervising Controller. Controllers are also responsible for determining the availability of a specific command. The update(oracle.ide.IdeAction, oracle.ide.addin.Context) method is called to do just that.

See Also:
Command, Controller, IdeAction

Field Summary
static int ADD_TO_PROJECT_CMD_ID
           
static int CATEGORY_VIEW_CMD_ID
           
static int DIRECTORY_TREE_VIEW_CMD_ID
           
static int FILE_LIST_VIEW_CMD_ID
           
static int PACKAGE_LIST_VIEW_CMD_ID
           
static int PACKAGE_TREE_VIEW_CMD_ID
           
static int VIEW_ALL_FILES_CMD_ID
           
 
Constructor Summary
JProjectStructureController()
          Default constructor for JProjectStructureController
 
Method Summary
 boolean canShutdown()
          This method is called by the IDE to confirm that the ide can shutdown.
 void checkCommands(Context context, Controller activeController)
          checkCommands() should be called on the controller associated with the active view whenever the Context changes.
static ChildFilter findFilter(TNode tnode, int filterType)
           
 boolean handleEvent(IdeAction action, Context context)
          This method is called when a user interaction with a View triggers the execution of a command.
 float ideVersion()
          This method is called to determine the ide version number for which this feature was implemented.
 void initialize()
          This method is called by the IDE to request that the feature be initialized.
static boolean isFilteredBy(TNode tnode, int filterType)
           
static boolean isFilterSupported(TNode tnode, int filter)
          Call to determine if the specified tnode can be viewed using the specified filter.
static boolean isInCategoryView(Context context)
           
static boolean isInCategoryView(TNode tnode)
           
static boolean isInProject(TNode tnode)
          Call to determine if the specified tnode is the descendent of a project.
 void shutdown()
          This method is called by the IDE to request that the feature release any resources held before the ide shuts down.
 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.
 float version()
          This method is called to determine the feature version number, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_TO_PROJECT_CMD_ID

public static final int ADD_TO_PROJECT_CMD_ID

CATEGORY_VIEW_CMD_ID

public static final int CATEGORY_VIEW_CMD_ID

DIRECTORY_TREE_VIEW_CMD_ID

public static final int DIRECTORY_TREE_VIEW_CMD_ID

FILE_LIST_VIEW_CMD_ID

public static final int FILE_LIST_VIEW_CMD_ID

PACKAGE_LIST_VIEW_CMD_ID

public static final int PACKAGE_LIST_VIEW_CMD_ID

PACKAGE_TREE_VIEW_CMD_ID

public static final int PACKAGE_TREE_VIEW_CMD_ID

VIEW_ALL_FILES_CMD_ID

public static final int VIEW_ALL_FILES_CMD_ID
Constructor Detail

JProjectStructureController

public JProjectStructureController()
Default constructor for JProjectStructureController

Method Detail

isFilterSupported

public static boolean isFilterSupported(TNode tnode,
                                        int filter)
Call to determine if the specified tnode can be viewed using the specified filter.


findFilter

public static ChildFilter findFilter(TNode tnode,
                                     int filterType)

isFilteredBy

public static boolean isFilteredBy(TNode tnode,
                                   int filterType)

isInProject

public static boolean isInProject(TNode tnode)
Call to determine if the specified tnode is the descendent of a project. That is the tnode is contained within a project.


isInCategoryView

public static boolean isInCategoryView(Context context)

isInCategoryView

public static boolean isInCategoryView(TNode tnode)

supervisor

public Controller supervisor()
Gets the supervising controller

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

handleEvent

public boolean handleEvent(IdeAction action,
                           Context context)
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)
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)
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.

initialize

public void initialize()
This method is called by the IDE to request that the feature be initialized.

Specified by:
initialize in interface Addin
See Also:
AddinManager

shutdown

public void shutdown()
This method is called by the IDE to request that the feature release any resources held before the ide shuts down.

Specified by:
shutdown in interface Addin

canShutdown

public boolean canShutdown()
This method is called by the IDE to confirm that the ide can shutdown.

Specified by:
canShutdown in interface Addin

version

public float version()
This method is called to determine the feature version number, i.e. 1.0

Specified by:
version in interface Addin
Returns:
the feature version number.

ideVersion

public float ideVersion()
This method is called to determine the ide version number for which this feature was implemented.

Specified by:
ideVersion in interface Addin
Returns:
the ide version number, i.e. 5.0 .

Extension SDK

 

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