Extension SDK

oracle.ide.log
Class AbstractLogManager

java.lang.Object
  extended byoracle.ide.addin.BaseController
      extended byoracle.ide.log.AbstractLogManager
All Implemented Interfaces:
Controller, LogManager

public abstract class AbstractLogManager
extends BaseController
implements LogManager

The AbstractLogManager class provides the basic support for managing and showing a log page's context menu. LogMangagers should extend this class in order to get the default context menu support. The default context menu provides two menu items: Close and Clear.


Field Summary
protected static int CLEAR_LOG_CMD_ID
          Clear command identifier.
protected static int CLOSE_ALL_LOGS_CMD_ID
          Close all logs command identifier.
protected static int CLOSE_LOG_CMD_ID
          Close command identifier.
protected static int CLOSE_OTHER_LOGS_CMD_ID
          Close other logs command identifier.
 
Constructor Summary
AbstractLogManager()
           
 
Method Summary
 void addPage(LogPage page)
          Classes that extend the AbstractLogManager class should override this method from where they should call this method to install the appropriate mouse listener on the specified page.
protected  Context getContext(java.util.EventObject event)
          Classes that extend the AbstractLogManager class should override this method in order to return the appropriate context.
 ContextMenu getContextMenu()
          Get the ContextMenu.
 int getPageCount()
          Concrete implementations must override this method and return the number of opened pages.
 LogPage[] getPages()
          Concrete implementations must override this method and return the list of opened pages.
protected  void installContextMenuListener()
          The installContextMenuListener method adds a ContextMenuListener to the ContextMenu.
protected  void installMouseListener(LogPage page)
          The installMouseListener method adds a MouseListener to the specified LogPage.
 void removePage(LogPage page)
          Classes that extend the AbstractLogManager class should override this method from where they should call this method to install the remove any mouse listener installed on the specified page
protected  void triggerPopup(java.awt.event.MouseEvent e)
          The triggerPopup method is called from the menu listener.
 boolean update(IdeAction action, Context context)
          This method updates the enabled status of the specified action within the specified context.
 
Methods inherited from class oracle.ide.addin.BaseController
checkCommands, checkToolbarCommands, checkToolbarCommands, getView, handleEvent, supervisor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.log.LogManager
getLogWindow, getMsgPage, getSelectedPage, hideLog, initialize, isLogVisible, showLog, shutdown, toggleLog
 
Methods inherited from interface oracle.ide.addin.Controller
checkCommands, handleEvent, supervisor
 

Field Detail

CLOSE_LOG_CMD_ID

protected static final int CLOSE_LOG_CMD_ID
Close command identifier.


CLEAR_LOG_CMD_ID

protected static final int CLEAR_LOG_CMD_ID
Clear command identifier.


CLOSE_OTHER_LOGS_CMD_ID

protected static final int CLOSE_OTHER_LOGS_CMD_ID
Close other logs command identifier.


CLOSE_ALL_LOGS_CMD_ID

protected static final int CLOSE_ALL_LOGS_CMD_ID
Close all logs command identifier.

Constructor Detail

AbstractLogManager

public AbstractLogManager()
Method Detail

addPage

public void addPage(LogPage page)
Classes that extend the AbstractLogManager class should override this method from where they should call this method to install the appropriate mouse listener on the specified page. Installing the mouse listener is necessary for popping up the context menu when the user clicks on the page.

Specified by:
addPage in interface LogManager
Parameters:
page - the page to add.

removePage

public void removePage(LogPage page)
Classes that extend the AbstractLogManager class should override this method from where they should call this method to install the remove any mouse listener installed on the specified page

Specified by:
removePage in interface LogManager
Parameters:
page - the page to removed.

getContextMenu

public ContextMenu getContextMenu()
Description copied from interface: LogManager
Get the ContextMenu. In general, subclasses should get the context menu to add custom menu items.

Specified by:
getContextMenu in interface LogManager
Returns:
the context menu.

getPageCount

public int getPageCount()
Concrete implementations must override this method and return the number of opened pages. This implementation always returns zero.

Specified by:
getPageCount in interface LogManager
Returns:
the number of log pages opened.

getPages

public LogPage[] getPages()
Concrete implementations must override this method and return the list of opened pages. This implementation always returns an empty array.

Specified by:
getPages in interface LogManager
Returns:
The list of pages opened.

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
Overrides:
update in class BaseController
Parameters:
action - action whose command is to be executed.
context - the current context
Returns:
true if the controller handles the specified command.

getContext

protected Context getContext(java.util.EventObject event)
Classes that extend the AbstractLogManager class should override this method in order to return the appropriate context. This method is called just before the context menu is about to be shown.


triggerPopup

protected void triggerPopup(java.awt.event.MouseEvent e)
The triggerPopup method is called from the menu listener. It is responsible from popping up the context menu. Just before popping up a context menu, a call is made to the getContext method.


installContextMenuListener

protected void installContextMenuListener()
The installContextMenuListener method adds a ContextMenuListener to the ContextMenu. The listener adds the Close and Clear menu items to the context menu.


installMouseListener

protected void installMouseListener(LogPage page)
The installMouseListener method adds a MouseListener to the specified LogPage. The listener is reponsible for popping up the context menu when the user clicks on the page.


Extension SDK

 

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