DialogEngine  CATEditAgent
Usage: you must use this class as is. You should never derive it.
 public class CATEditAgent
 Class representing an agent to edit an object in a workbench different from the
 current one.
 Role: An edition agent is a specific agent which enables the user to
 edit an object inside a state command. This agent is itself a state command which,
 when it is activated, launchs the workbench specified by the  method. Once the end user has clicked on the workbench's exit button, the edition agent is completed, the edited object is put 
 into the CSO, and the state chart of the original command resumes. 
 
The object to edit is provided by a method given as argument of the
 
 method. 
Note: As every state command used as an agent,
 an edition agent must be the only agent added to a given state.
 Constructor and Destructor Index
 
 -  o 
    CATEditAgent(CATString&,CATClassId)
 -   Constructs an edition agent.
 
 -  o 
    ~CATEditAgent()
 -  
 
 Method Index
 
 -  o 
    GetValue()
 -   Returns the path of the edited object.
 
 -  o 
    SetCommandSet(CATStackableCommandSet*)
 -   Sets the commands available during the edition.
 
 -  o 
    SetElementProvider(CATBaseUnknown*,ElementProvider)
 -   Sets the method to provide the object to edit.
 
 -  o 
    SetPanel(CATDialog*)
 -   Sets the dialog object, if any, representing the command.
 
 -  o 
    SetWorkbench(CATString&)
 -   Sets the workbench used during the edition.
 
 Constructor and Destructor
 
  o CATEditAgent
  |   public   CATEditAgent( |  const   | iId, | 
 |   | iType | =NULL)   | 
  - 
 Constructs an edition agent.
 
  -  Parameters:
  
 - 
    
    -  iId
   
 -    The agent identifier. It is used to retrieve the undo/redo titles in 
   the command resource file.
 
 
    -  iType
   
 -    The type corresponds to an interface. 
   
It is given to be an argument of the ElementProvider method given 
   as argument of the  
 method. This ElementProvider    method can use or not this input parameter to check the object to edit.
 
 
  o ~CATEditAgent
  |   public virtual   ~CATEditAgent( | )   | 
  - 
 
 Methods
 
  o GetValue
  
  - 
 Returns the path of the edited object.
 
Role:This method returns the value returned by the 
 ElementProvider method. Since this ElementProvider method is
 called just before the edition, the value is valid only after the edition. 
 
  -  Returns: 
  
 -      The path of the edited object. 
 
Lifecycle rules deviation: This method doesn't AddRef the 
 returned value.
 
 
  o SetCommandSet
  |   public   SetCommandSet( |   | iCommandSet)   | 
  - 
 Sets the commands available during the edition.
 
Role: This method enables you to specify the available
 commands for the activated workbench. 
 
If this method is never called, or if NULL is given as argument,
 an empty instance of the 
 class will be used by the agent. A minimum set of commands will then be available, including the one
 to leave the workbench.
 
  -  Parameters:
  
 - 
    
    -  iCommandSet
   
 -    The command set.
   
Cyclic reference: iCommandSet is kept and AddRef'ed.
   It is Released at the end of the agent before the agent destructor call. 
 
 
  o SetElementProvider
  |   public   SetElementProvider( |   | iObject, | 
 |   | iMethod)   | 
  - 
 Sets the method to provide the object to edit.
 
Role: This method enables you to specify the name of a 
 ElementProvider method, and an instance of the class defining this method. 
 This ElementProvider method will be called just before
 the edition to provide to the agent the object to edit .
 
 _myAgent = new CATEditAgent("EditAgentId");
 _myAgent->SetElementProvider(this, 
              (CATEditAgent::ElementProvider) &MyStateCommand::ObjectProviderMethod);
 
 
  -  Parameters:
  
 - 
    
    -  iObject
   
 -    The pointer to the class instance defining iMethod
 
 
    -  iMethod
   
 -    The method to execute before edition.
 
 
 
  o SetPanel
  |   public   SetPanel( |   | iDialog)   | 
  - 
 Sets the dialog object, if any, representing the command.
 
Role: This dialog object will be desactivated during the edition
 (but it won't be hidden by the edition agent) and reactivated after the edition.
 
  -  Parameters:
  
 - 
    
    -  iDialog
   
 -    The dialog object.
 
 
 
  o SetWorkbench
  |   public   SetWorkbench( |  const   | iWorkbench)   | 
  - 
 Sets the workbench used during the edition.
 
Role: This method sets the name of the workbench that must be activated
 to edit the object.
 For workshops with only one workbench or without workbench (like Sketcher), this method 
 is useless.
 
  -  Parameters:
  
 - 
    
    -  iWorkbench
   
 -    The workbench name
 
 
 
 This object is included in the file: CATEditAgent.h
If needed, your Imakefile.mk should include the module: CATDialogEngine
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.