Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
#include <berryContributionManager.h>
Public Member Functions | |
berryObjectMacro (berry::ContributionManager) | |
~ContributionManager () override | |
void | Add (QAction *action, const QString &id) override |
void | Add (const SmartPointer< IContributionItem > &item) override |
void | AppendToGroup (const QString &groupName, QAction *action, const QString &id) override |
void | AppendToGroup (const QString &groupName, const SmartPointer< IContributionItem > &item) override |
SmartPointer< IContributionItem > | Find (const QString &id) const override |
QList< SmartPointer< IContributionItem > > | GetItems () const override |
int | GetSize () |
SmartPointer< IContributionManagerOverrides > | GetOverrides () override |
int | IndexOf (const QString &id) |
void | Insert (int index, const SmartPointer< IContributionItem > &item) |
void | InsertAfter (const QString &ID, const SmartPointer< IContributionItem > &item) override |
void | InsertBefore (const QString &ID, const SmartPointer< IContributionItem > &item) override |
bool | IsDirty () const override |
bool | IsEmpty () const override |
void | MarkDirty () override |
void | PrependToGroup (const QString &groupName, const SmartPointer< IContributionItem > &item) override |
SmartPointer< IContributionItem > | Remove (const QString &ID) override |
SmartPointer< IContributionItem > | Remove (const SmartPointer< IContributionItem > &item) override |
void | RemoveAll () override |
bool | ReplaceItem (const QString &identifier, const SmartPointer< IContributionItem > &replacementItem) |
void | SetOverrides (const SmartPointer< IContributionManagerOverrides > &newOverrides) |
Public Member Functions inherited from berry::IContributionManager | |
berryObjectMacro (berry::IContributionManager) | |
virtual void | Update (bool force)=0 |
Public Member Functions inherited from berry::Object | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) const |
virtual QString | ToString () const |
virtual uint | HashCode () 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 |
virtual bool | operator== (const Object *) const |
Protected Member Functions | |
ContributionManager () | |
virtual bool | AllowItem (IContributionItem *itemToAdd) |
void | DumpStatistics () |
bool | HasDynamicItems () const |
int | IndexOf (const SmartPointer< IContributionItem > &item) const |
void | ItemAdded (const SmartPointer< IContributionItem > &item) |
void | ItemRemoved (const SmartPointer< IContributionItem > &item) |
void | SetDirty (bool dirty) |
void | InternalSetItems (const QList< SmartPointer< IContributionItem > > &items) |
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::Object | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
Abstract base class for all contribution managers, and standard implementation of IContributionManager
. This class provides functionality common across the specific managers defined by this framework.
This class maintains a list of contribution items and a dirty flag, both as internal state. In addition to providing implementations of most IContributionManager
methods, this class automatically coalesces adjacent separators, hides beginning and ending separators, and deals with dynamically changing sets of contributions. When the set of contributions does change dynamically, the changes are propagated to the control via the update
method, which subclasses must implement.
Note: A ContributionItem
cannot be shared between different ContributionManager
s.
Definition at line 42 of file berryContributionManager.h.
|
override |
|
protected |
Creates a new contribution manager.
|
overridevirtual |
Adds a contribution item to this manager.
item | the contribution item, this cannot be null |
Implements berry::IContributionManager.
|
overridevirtual |
Adds an action as a contribution item to this manager. Equivalent to Add(IContributionItem::Pointer(new QActionContributionItem(action, id)))
.
action | the action, this cannot be null |
id | the unique action id |
Implements berry::IContributionManager.
|
protectedvirtual |
This method allows subclasses of ContributionManager
to prevent certain items in the contributions list. ContributionManager
will either block or allow an addition based on the result of this method call. This can be used to prevent duplication, for example.
itemToAdd | The contribution item to be added; may be null . |
true
if the addition should be allowed; false
otherwise. The default implementation allows all items.
|
overridevirtual |
Adds a contribution item to this manager at the end of the group with the given name.
groupName | the name of the group |
item | the contribution item |
ctkInvalidArgumentException | if there is no group with the given name |
Implements berry::IContributionManager.
|
overridevirtual |
Adds a contribution item for the given action at the end of the group with the given name. Equivalent to AppendToGroup(groupName,IContributionItem::Pointer(new QActionContributionItem(action, id)))
.
groupName | the name of the group |
action | the action |
id | the unique action id |
ctkInvalidArgumentException | if there is no group with the given name |
Implements berry::IContributionManager.
berry::ContributionManager::berryObjectMacro | ( | berry::ContributionManager | ) |
|
protected |
Internal debug method for printing statistics about this manager to cout
.
|
overridevirtual |
Finds the contribution item with the given id.
id | the contribution item id |
null
if no item with the given id can be found Implements berry::IContributionManager.
|
overridevirtual |
Returns all contribution items known to this manager.
Implements berry::IContributionManager.
|
overridevirtual |
The ContributionManager
implementation of this method declared on IContributionManager
returns the current overrides. If there is no overrides it lazily creates one which overrides no item state.
Implements berry::IContributionManager.
Reimplemented in berry::MenuManager.
int berry::ContributionManager::GetSize | ( | ) |
Return the number of contributions in this manager.
|
protected |
Returns whether this contribution manager contains dynamic items. A dynamic contribution item contributes items conditionally, dependent on some internal state.
true
if this manager contains dynamic items, and false
otherwise int berry::ContributionManager::IndexOf | ( | const QString & | id | ) |
Returns the index of the item with the given id.
id | The id of the item whose index is requested. |
int
the index or -1 if the item is not found
|
protected |
Returns the index of the object in the internal structure. This is different from indexOf(String id)
since some contribution items may not have an id.
item | The contribution item |
void berry::ContributionManager::Insert | ( | int | index, |
const SmartPointer< IContributionItem > & | item | ||
) |
Insert the item at the given index.
index | The index to be used for insertion |
item | The item to be inserted |
|
overridevirtual |
Inserts a contribution item after the item with the given id.
id | the contribution item id |
item | the contribution item to insert |
IllegalArgumentException | if there is no item with the given id |
Implements berry::IContributionManager.
|
overridevirtual |
Inserts a contribution item before the item with the given id.
id | the contribution item id |
item | the contribution item to insert |
IllegalArgumentException | if there is no item with the given id |
Implements berry::IContributionManager.
|
protected |
An internal method for setting the order of the contribution items.
items | the contribution items in the specified order |
|
overridevirtual |
Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.
true
if this manager is dirty, and false
if it is up-to-date Implements berry::IContributionManager.
Reimplemented in berry::MenuManager.
|
overridevirtual |
Returns whether this manager has any contribution items.
true
if there are no items, and false
otherwise Implements berry::IContributionManager.
|
protected |
The given item was added to the list of contributions. Marks the manager as dirty and updates the number of dynamic items, and the memento.
item | the item to be added |
|
protected |
The given item was removed from the list of contributions. Marks the manager as dirty and updates the number of dynamic items.
item | remove given parent from list of contributions |
|
overridevirtual |
Marks this contribution manager as dirty.
Implements berry::IContributionManager.
Reimplemented in berry::MenuManager.
|
overridevirtual |
Adds a contribution item to this manager at the beginning of the group with the given name.
groupName | the name of the group |
item | the contribution item |
IllegalArgumentException | if there is no group with the given name |
Implements berry::IContributionManager.
|
overridevirtual |
Removes and returns the contribution item with the given id from this manager. Returns null
if this manager has no contribution items with the given id.
id | the contribution item id |
null
if none Implements berry::IContributionManager.
|
overridevirtual |
Removes the given contribution item from the contribution items known to this manager.
item | the contribution item |
item
parameter if the item was removed, and null
if it was not found Implements berry::IContributionManager.
|
overridevirtual |
Removes all contribution items from this manager.
Implements berry::IContributionManager.
bool berry::ContributionManager::ReplaceItem | ( | const QString & | identifier, |
const SmartPointer< IContributionItem > & | replacementItem | ||
) |
Replaces the item of the given identifier with another contribution item. This can be used, for example, to replace large contribution items with placeholders to avoid memory leaks. If the identifier cannot be found in the current list of items, then this does nothing. If multiple occurrences are found, then the replacement items is put in the first position and the other positions are removed.
identifier | The identifier to look for in the list of contributions; should not be null . |
replacementItem | The contribution item to replace the old item; must not be null . Use ContributionManager#Remove if that is what you want to do. |
true
if the given identifier can be
|
protected |
Sets whether this manager is dirty. When dirty, the list of contributions is not accurately reflected in the corresponding widgets.
dirty | true if this manager is dirty, and false if it is up-to-date |
void berry::ContributionManager::SetOverrides | ( | const SmartPointer< IContributionManagerOverrides > & | newOverrides | ) |
Sets the overrides for this contribution manager
newOverrides | the overrides for the items of this manager |