Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvActionSelectionHandler Class Reference

Links an IlvActionHistory object to its context. More...

#include <ilviews/base/action.h>

Public Member Functions

 IlvActionSelectionHandler ()
 
virtual ~IlvActionSelectionHandler ()
 Destructor.
 
void addToResult (IlUInt c, const IlvValueInterface **r)
 Adds an object to the result of the execution of a list of commands. More...
 
virtual void commit ()
 Called after a list of commands has been executed. More...
 
virtual IlvDisplaygetDisplay ()
 Returns the display instance of this handler. More...
 
virtual IlvValueInterface *const * getSelection (IlUInt &count, IlvActionHistory *h)
 Returns the current selection of the document object. More...
 
virtual void handleError (IlvAction *action)
 Handles an error returned by an action. More...
 
void removeFromResult (const IlvValueInterface *result)
 Removes an object from the result of the execution of a list of commands. More...
 
virtual void reset ()
 Called before a list of commands is about to be executed. More...
 
void setResult (IlUInt n, const IlvValueInterface **result)
 Sets the result of the execution of a list of commands. More...
 

Detailed Description

Links an IlvActionHistory object to its context.

Library: views

IlvActionSelectionHandler objects handle contextual information related to an action (or command) and its associated document or IlvManager.

You should not derive the class IlvActionHistory to implement a history handling mechanism specific to a document class (such as a manager or a container command history). Instead, you should derive for a given document class a customized selection handler that links the action history to its context. The class IlvActionHistory should be derived only to implement special operations specific to the manipulation of IlvCommand and IlvAction objects. Examples of these special commands are smart repeat, log command histories, reading a list of commands, recording macros to perform a series of actions, and so on.
Similarly, you should consider implementing observers for the action history instead of creating a subclass to implement new features. For example, the modified flag for the manager is handled by an observer rather than by a specialized subclass of command history.

Objects that handle an attached IlvActionHistory should create a subclass of IlvActionSelectionHandler that implements the document-specific features of action history handling, and attach it to an IlvActionHistory with the method IlvActionHistory::setSelectionHandler().

See also
IlvActionHistory, IlvCommand, IlvCommandHistory.

Constructor & Destructor Documentation

§ IlvActionSelectionHandler()

IlvActionSelectionHandler::IlvActionSelectionHandler ( )

Constructor

Member Function Documentation

§ addToResult()

void IlvActionSelectionHandler::addToResult ( IlUInt  c,
const IlvValueInterface **  r 
)

Adds an object to the result of the execution of a list of commands.

Parameters
rAn array of objects representing the result of the list of commands. The array is copied.
cThe number of objects in r.

§ commit()

virtual void IlvActionSelectionHandler::commit ( )
virtual

Called after a list of commands has been executed.

Enables, for example, the view to be refreshed after commands have been executed.

§ getDisplay()

virtual IlvDisplay* IlvActionSelectionHandler::getDisplay ( )
virtual

Returns the display instance of this handler.

This method should be redefined in subclasses to return the current display that may be used by commands that need to access a display.

§ getSelection()

virtual IlvValueInterface* const* IlvActionSelectionHandler::getSelection ( IlUInt count,
IlvActionHistory h 
)
virtual

Returns the current selection of the document object.

For example, the special IlvActionSelectionHandler attached to an IlvManager class will return the result of IlvManager::getSelection().

Other classes of documents can implement their own selection mechanism, allowing commands that are repeated to retrieve their parameters from the current selection.

Parameters
countThis parameter is set to the number of returned objects.
hThe action history associated with this IlvSelectionHandler.
Returns
An array of objects currently selected and that could be provided as parameters to a command or an action.

§ handleError()

virtual void IlvActionSelectionHandler::handleError ( IlvAction action)
virtual

Handles an error returned by an action.

This method should be redefined in subclasses to define error notification to users or enable error recovery by the document class.

Parameters
actionThe action whose execution reports an error.

§ removeFromResult()

void IlvActionSelectionHandler::removeFromResult ( const IlvValueInterface result)

Removes an object from the result of the execution of a list of commands.

Parameters
resultThe object to be removed from the result.

§ reset()

virtual void IlvActionSelectionHandler::reset ( )
virtual

Called before a list of commands is about to be executed.

Prepares, for example, the view for refresh before commands are executed.

§ setResult()

void IlvActionSelectionHandler::setResult ( IlUInt  n,
const IlvValueInterface **  result 
)

Sets the result of the execution of a list of commands.

Parameters
resultAn array of objects representing the result of the list of commands. The array is copied.
nThe number of objects in result.

© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.