OptionShell Class Reference
[Plug-In Shells]

A base class for plug-in shells or plug-in instances. More...

#include <OptionShell.h>

Inheritance diagram for OptionShell:

Inheritance graph

List of all members.

Public Member Functions

 OptionShell ()
virtual ~OptionShell ()
QWidget * getWidget ()
const std::string & getOptionName ()

Protected Member Functions

virtual QWidget * createOptionsWidget ()=0
virtual QWidget * getStoredWidget ()
void setOptionName (const std::string &name)


Detailed Description

A base class for plug-in shells or plug-in instances.

This class provides a default implementation of the Option plug-in interfaces.

This class should generally NOT be subclassed directly, instead try using OptionQWidgetWrapper.

See also:
Option, OptionQWidgetWrapper

Definition at line 30 of file OptionShell.h.


Constructor & Destructor Documentation

OptionShell::OptionShell (  ) 

Creates the option plug-in.

The constructor sets the plug-in type to PlugInManagerServices::OptionType().

See also:
getType()

virtual OptionShell::~OptionShell (  )  [virtual]

Destroys the option plug-in.


Member Function Documentation

QWidget* OptionShell::getWidget (  )  [virtual]

Returns the widget that will be displayed to the user.

The widget will only be displayed when the user selects the option in the options dialog. This widget should only be instantiated once per instance of this plug-in. This widget will be owned by this plug-in and should be destroyed when the plug-in is destroyed. Please note, that the option dialog that this widget will be displayed in is resizable, so ensure the Qt layout for this widget resizes properly.

Warning:
The QWidget* returned by this method should NEVER be instantiated in the constructor of this plug-in. When the application is run in batch mode, it will attempt to create this plug-in and if this plug-in attempts to create a QWidget* in it's constructor, the application will crash.
Returns:
Returns the widget that will be displayed to the user.

Default Implementation:
The default implementation will call createOptionsWidget() once per instance of this plug-in.

Implements Option.

const std::string& OptionShell::getOptionName (  )  [virtual]

Returns the name of the option.

This will be displayed to the user in a tree view, allowing them to show the widget returned by getWidget() for this option. This string can include '/', which will then create a group in the tree view. For instance, a returned string of "Windows/Workspace/Cube" would create a tree heirarchy like the following:

  • Windows
    • Workspace
      • Cube

If the string needs to actually include a '/', it can be escaped by using '//'. When placing option plug-ins into a heirarchy please attempt to put them into the already provided application heirarchy where possible. If not possible, please create a top-level node with the name of the plug-in suite and place option plug-ins under that node.

Returns:
Returns the name of the option.

Default Implementation:
The default implementation will return value provided to setOptionName().

Implements Option.

virtual QWidget* OptionShell::createOptionsWidget (  )  [protected, pure virtual]

This method should be implemented in subclasses and can directly new the QWidget* and initialize it.

It guaranteed to called at most once per instance of this plug-in.

Implemented in OptionQWidgetWrapper< OptionWidget >.

virtual QWidget* OptionShell::getStoredWidget (  )  [protected, virtual]

Returns the currently stored QWidget*.

If getWidget() has not yet been called NULL will be returned. Otherwise, the value of createOptionsWidget() will have been stored and that value is returned.

void OptionShell::setOptionName ( const std::string &  name  )  [protected]

Sets the option name that will be returned from getOptionName().

Parameters:
name the option name. Please see Option::getOptionName() for how the string is interpreted.
See also:
Option::getOptionName()


Software Development Kit - Opticks 4.9.0 Build 16218