Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::QActionContributionItem Class Reference

#include <berryQActionContributionItem.h>

Inheritance diagram for berry::QActionContributionItem:
Collaboration diagram for berry::QActionContributionItem:

Public Member Functions

 QActionContributionItem (QAction *action, const QString &id)
 
 ~QActionContributionItem ()
 
bool operator== (const Object *o) const override
 
uint HashCode () const override
 
void Fill (QStatusBar *parent) override
 
void Fill (QMenu *parent, QAction *before) override
 
void Fill (QToolBar *parent, QAction *before) override
 
QAction * GetAction () const
 
Modes GetMode () const
 
bool IsDynamic () const override
 
bool IsEnabled () const override
 
bool IsVisible () const override
 
void SetMode (Modes mode)
 
void Update () override
 
void Update (const QString &propertyName) override
 
- Public Member Functions inherited from berry::ContributionItem
 berryObjectMacro (ContributionItem) enum Mode
 
void Fill (QStatusBar *parent) override
 
void Fill (QMenuBar *menu, QAction *before) override
 
void SaveWidgetState () override
 
QString GetId () const override
 
IContributionManagerGetParent () const
 
bool IsDirty () const override
 
bool IsGroupMarker () const override
 
bool IsSeparator () const override
 
void SetVisible (bool visible) override
 
QString ToString () const override
 
void SetParent (IContributionManager *parent) override
 
void SetId (const QString &itemId)
 
- Public Member Functions inherited from berry::IContributionItem
 berryObjectMacro (berry::IContributionItem) virtual void Fill(QStatusBar *parent)=0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 

Protected Member Functions

bool IsEnabledAllowed () const
 
- Protected Member Functions inherited from berry::ContributionItem
 ContributionItem ()
 
 ContributionItem (const QString &id)
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 

Additional Inherited Members

- Public Types inherited from berry::ContributionItem
enum  Style { STYLE_PUSH, STYLE_CHECK, STYLE_RADIO, STYLE_PULLDOWN }
 
- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A contribution item which delegates to a QAction.

This class may be instantiated; it is not intended to be subclassed.

This class is not intended to be subclassed by clients.

Definition at line 32 of file berryQActionContributionItem.h.

Constructor & Destructor Documentation

berry::QActionContributionItem::QActionContributionItem ( QAction *  action,
const QString &  id 
)

Creates a new contribution item from the given action and id.

Parameters
actionthe action

Definition at line 27 of file berryQActionContributionItem.cpp.

berry::QActionContributionItem::~QActionContributionItem ( )

Definition at line 183 of file berryQActionContributionItem.cpp.

Member Function Documentation

void berry::QActionContributionItem::Fill ( QStatusBar *  parent)
override

The QActionContributionItem implementation of this IContributionItem method creates an SWT Button for the action using the action's style. If the action's checked property has been set, the button is created and primed to the value of the checked property.

Definition at line 46 of file berryQActionContributionItem.cpp.

void berry::QActionContributionItem::Fill ( QMenu *  parent,
QAction *  before 
)
overridevirtual

The ActionContributionItem implementation of this IContributionItem method creates an SWT MenuItem for the action using the action's style. If the action's checked property has been set, a button is created and primed to the value of the checked property. If the action's menu creator property has been set, a cascading submenu is created.

Reimplemented from berry::ContributionItem.

Definition at line 86 of file berryQActionContributionItem.cpp.

References Update().

void berry::QActionContributionItem::Fill ( QToolBar *  parent,
QAction *  before 
)
overridevirtual

The ActionContributionItem implementation of this , IContributionItem method creates an SWT ToolItem for the action using the action's style. If the action's checked property has been set, a button is created and primed to the value of the checked property. If the action's menu creator property has been set, a drop-down tool item is created.

Reimplemented from berry::ContributionItem.

Definition at line 134 of file berryQActionContributionItem.cpp.

QAction * berry::QActionContributionItem::GetAction ( ) const

Returns the action associated with this contribution item.

Returns
the action

Definition at line 178 of file berryQActionContributionItem.cpp.

ContributionItem::Modes berry::QActionContributionItem::GetMode ( ) const

Returns the presentation mode, which is the bitwise-or of the MODE_* constants. The default mode setting is 0, meaning that for menu items, both text and image are shown (if present), but for tool items, the text is shown only if there is no image.

Returns
the presentation mode settings

Definition at line 188 of file berryQActionContributionItem.cpp.

uint berry::QActionContributionItem::HashCode ( ) const
overridevirtual

Returns a hash code value for the object.

Reimplemented from berry::Object.

Definition at line 41 of file berryQActionContributionItem.cpp.

References qHash().

bool berry::QActionContributionItem::IsDynamic ( ) const
overridevirtual

The action item implementation of this IContributionItem method returns true for menu items and false for everything else.

Reimplemented from berry::ContributionItem.

Definition at line 193 of file berryQActionContributionItem.cpp.

bool berry::QActionContributionItem::IsEnabled ( ) const
overridevirtual

The default implementation of this IContributionItem method returns true. Subclasses may override.

Reimplemented from berry::ContributionItem.

Definition at line 211 of file berryQActionContributionItem.cpp.

bool berry::QActionContributionItem::IsEnabledAllowed ( ) const
protected

Returns true if this item is allowed to enable, false otherwise.

Returns
if this item is allowed to be enabled

Definition at line 507 of file berryQActionContributionItem.cpp.

References berry::IContributionManager::GetOverrides(), and berry::ContributionItem::GetParent().

bool berry::QActionContributionItem::IsVisible ( ) const
overridevirtual

The ActionContributionItem implementation of this ContributionItem method extends the super implementation by also checking whether the command corresponding to this action is active.

Reimplemented from berry::ContributionItem.

Definition at line 216 of file berryQActionContributionItem.cpp.

References berry::ContributionItem::IsVisible().

bool berry::QActionContributionItem::operator== ( const Object o) const
overridevirtual

Compares this action contribution item with another object. Two action contribution items are equal if they refer to the identical QAction.

Reimplemented from berry::Object.

Definition at line 32 of file berryQActionContributionItem.cpp.

void berry::QActionContributionItem::SetMode ( Modes  mode)

Sets the presentation mode, which is the bitwise-or of the MODE_* constants.

Parameters
modethe presentation mode settings

Definition at line 221 of file berryQActionContributionItem.cpp.

References Update().

void berry::QActionContributionItem::Update ( )
overridevirtual

The action item implementation of this IContributionItem method calls update(null).

Reimplemented from berry::ContributionItem.

Definition at line 227 of file berryQActionContributionItem.cpp.

Referenced by Fill(), and SetMode().

void berry::QActionContributionItem::Update ( const QString &  propertyName)
overridevirtual

Synchronizes the UI with the given property.

Parameters
propertyNamethe name of the property, or null meaning all applicable properties

Reimplemented from berry::ContributionItem.

Definition at line 232 of file berryQActionContributionItem.cpp.


The documentation for this class was generated from the following files: