Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
#include <berryMenuManager.h>
Public Member Functions | |
berryObjectMacro (MenuManager) | |
Q_SIGNAL void | AboutToShow (IMenuManager *mm) |
Q_SIGNAL void | AboutToHide (IMenuManager *mm) |
MenuManager (const QString &text, const QString &id=QString()) | |
~MenuManager () override | |
MenuManager (const QString &text, const QIcon &image, const QString &id) | |
bool | IsDirty () const override |
QMenu * | CreateContextMenu (QWidget *parent) |
QMenuBar * | CreateMenuBar (QWidget *parent) |
void | AddMenuListener (QObject *listener) override |
void | RemoveMenuListener (QObject *listener) override |
void | Fill (QStatusBar *parent) override |
void | Fill (QToolBar *parent, QAction *index) override |
void | Fill (QMenu *parent, QAction *before) override |
void | Fill (QMenuBar *parent, QAction *before) override |
IMenuManager::Pointer | FindMenuUsingPath (const QString &path) const override |
IContributionItem::Pointer | FindUsingPath (const QString &path) const override |
QString | GetId () const override |
QMenu * | GetMenu () const |
QString | GetMenuText () const |
QIcon | GetImage () const |
SmartPointer< IContributionManagerOverrides > | GetOverrides () override |
IContributionManager * | GetParent () const |
bool | GetRemoveAllWhenShown () const override |
bool | IsDynamic () const override |
bool | IsEnabled () const override |
bool | IsGroupMarker () const override |
bool | IsSeparator () const override |
bool | IsVisible () const override |
void | MarkDirty () override |
void | SaveWidgetState () override |
void | SetOverrides (SmartPointer< IContributionManagerOverrides > newOverrides) |
void | SetParent (IContributionManager *manager) override |
void | SetRemoveAllWhenShown (bool removeAll) override |
void | SetVisible (bool visible) override |
void | SetCommandId (const QString &definitionId) |
void | Update () override |
void | Update (const QString &property) override |
void | Update (bool force) override |
void | UpdateAll (bool force) override |
Public Member Functions inherited from berry::ContributionManager | |
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 () |
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 | IsEmpty () const 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) | |
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 |
Public Member Functions inherited from berry::IMenuManager | |
berryObjectMacro (berry::IMenuManager) | |
Public Member Functions inherited from berry::IContributionItem | |
berryObjectMacro (berry::IContributionItem) | |
Protected Member Functions | |
void | DoItemFill (IContributionItem::Pointer ci, QAction *before) |
void | Update (bool force, bool recursive) |
Protected Member Functions inherited from berry::ContributionManager | |
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 |
Protected Attributes | |
bool | visible |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
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 () |
A menu manager is a contribution manager which realizes itself and its items in a menu control; either as a menu bar, a sub-menu, or a context menu.
This class may be instantiated; it may also be subclassed.
Definition at line 37 of file berryMenuManager.h.
berry::MenuManager::MenuManager | ( | const QString & | text, |
const QString & | id = QString() |
||
) |
Creates a menu manager with the given text and id. Typically no text is given when creating a context menu. Supply a text and id for creating a sub-menu, where it needs to be referred to by the id.
text | the text for the menu, or "" if none |
id | the menu id, or "" if it is to have no id |
|
override |
berry::MenuManager::MenuManager | ( | const QString & | text, |
const QIcon & | image, | ||
const QString & | id | ||
) |
Creates a menu manager with the given text, image, and id. Typically used for creating a sub-menu, where it needs to be referred to by id.
text | the text for the menu, or "" if none |
image | the image for the menu, or ImageDescriptor::Pointer(0) if none |
id | the menu id, or "" if it is to have no id |
Q_SIGNAL void berry::MenuManager::AboutToHide | ( | IMenuManager * | mm | ) |
Q_SIGNAL void berry::MenuManager::AboutToShow | ( | IMenuManager * | mm | ) |
|
overridevirtual |
Adds a menu listener to this menu. Has no effect if an identical listener is already registered.
listener | a menu listener |
Implements berry::IMenuManager.
berry::MenuManager::berryObjectMacro | ( | MenuManager | ) |
QMenu* berry::MenuManager::CreateContextMenu | ( | QWidget * | parent | ) |
Creates and returns a Qt menu control for this menu, and installs all registered contributions. Does not create a new control if one already exists.
Note that the menu is not expected to be dynamic.
parent | the parent control |
QMenuBar* berry::MenuManager::CreateMenuBar | ( | QWidget * | parent | ) |
Creates and returns a Qt menu bar control for this menu, for use in the given QWidget
, and installs all registered contributions. Does not create a new control if one already exists.
parent | the parent decorations |
|
protected |
Call an IContributionItem
's fill method with the implementation's widget. The default is to use the Menu
widget.
fill(Menu menu, int index)
ci | An IContributionItem whose fill() method should be called. |
before | The position the fill() method should start inserting at. |
|
overridevirtual |
Fills the given menu with controls representing this contribution item. Used by MenuManager
.
parent | the parent menu |
before |
Implements berry::IContributionItem.
|
overridevirtual |
Fills the given menu bar with controls representing this contribution item. Used by MenuBarManager
.
parent | the parent menu |
before |
Implements berry::IContributionItem.
|
overridevirtual |
Fills the given status bar control with controls representing this contribution item. Used by StatusLineManager
.
parent | the parent control |
Implements berry::IContributionItem.
|
overridevirtual |
Fills the given tool bar with controls representing this contribution item. Used by ToolBarManager
.
parent | the parent tool bar |
before |
Implements berry::IContributionItem.
|
overridevirtual |
Finds the manager for the menu at the given path. A path consists of contribution item ids separated by the separator character. The path separator character is '/'
.
Convenience for findUsingPath(path)
which extracts an IMenuManager
if possible.
path | the path string |
null
if there is no such contribution item or if the item does not have an associated menu manager Implements berry::IMenuManager.
|
overridevirtual |
Finds the contribution item at the given path. A path consists of contribution item ids separated by the separator character. The path separator character is '/'
.
path | the path string |
null
if there is no such contribution item Implements berry::IMenuManager.
|
overridevirtual |
Returns the menu id. The menu id is used when creating a contribution item for adding this menu as a sub menu of another.
Implements berry::IContributionItem.
QIcon berry::MenuManager::GetImage | ( | ) | const |
Returns the image for this menu as an image descriptor.
null
if this menu has no image QMenu* berry::MenuManager::GetMenu | ( | ) | const |
Returns the SWT menu control for this menu manager.
QString berry::MenuManager::GetMenuText | ( | ) | const |
Returns the text shown in the menu, potentially with a shortcut appended.
|
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.
Reimplemented from berry::ContributionManager.
IContributionManager* berry::MenuManager::GetParent | ( | ) | const |
Returns the parent contribution manager of this manager.
|
overridevirtual |
Returns whether all items should be removed when the menu is about to show, but before notifying menu listeners. The default is false
.
true
if all items should be removed when shown, false
if not Implements berry::IMenuManager.
|
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 Reimplemented from berry::ContributionManager.
|
overridevirtual |
Returns whether this contribution item is dynamic. A dynamic contribution item contributes items conditionally, dependent on some internal state.
true
if this item is dynamic, and false
for normal items Implements berry::IContributionItem.
|
overridevirtual |
Returns whether this menu should be enabled or not. Used to enable the menu item containing this menu when it is realized as a sub-menu.
The default implementation of this framework method returns true
. Subclasses may reimplement.
true
if enabled, and false
if disabled Implements berry::IMenuManager.
|
overridevirtual |
Returns whether this contribution item is a group marker. This information is used when adding items to a group.
true
if this item is a group marker, and false
for normal itemsImplements berry::IContributionItem.
|
overridevirtual |
Returns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.
true
if this item is a separator, and false
for normal items Implements berry::IContributionItem.
|
overridevirtual |
Returns whether this contribution item is visible within its manager.
true
if this item is visible, and false
otherwise Implements berry::IContributionItem.
|
overridevirtual |
The MenuManager
implementation of this ContributionManager
method also propagates the dirty flag up the parent chain.
Reimplemented from berry::ContributionManager.
|
overridevirtual |
Removes the given menu listener from this menu. Has no effect if an identical listener is not registered.
listener | the menu listener |
Implements berry::IMenuManager.
|
overridevirtual |
Saves any state information of the control(s) owned by this contribution item. The contribution manager calls this method before disposing of the controls.
Implements berry::IContributionItem.
void berry::MenuManager::SetCommandId | ( | const QString & | definitionId | ) |
Sets the command id of this action. This simply allows the menu item text to include a short cut if available. It can be used to notify a user of a key combination that will open a quick menu.
definitionId | the command definition id |
void berry::MenuManager::SetOverrides | ( | SmartPointer< IContributionManagerOverrides > | newOverrides | ) |
Sets the overrides for this contribution manager
newOverrides | the overrides for the items of this manager |
|
overridevirtual |
Sets the parent manager of this item
parent | the parent contribution manager |
Implements berry::IContributionItem.
|
overridevirtual |
Sets whether all items should be removed when the menu is about to show, but before notifying menu listeners.
removeAll | true if all items should be removed when shown, false if not |
Implements berry::IMenuManager.
|
overridevirtual |
Sets whether this contribution item is visible within its manager.
visible | true if this item should be visible, and false otherwise |
Implements berry::IContributionItem.
|
overridevirtual |
Updates any controls cached by this contribution item with any changes which have been made to this contribution item since the last update. Called by contribution manager update methods.
Implements berry::IContributionItem.
|
overridevirtual |
The MenuManager
implementation of this IContributionManager
updates this menu, but not any of its submenus.
Implements berry::IContributionManager.
|
protected |
Incrementally builds the menu from the contribution items. This method leaves out double separators and separators in the first or last position.
force | true means update even if not dirty, and false for normal incremental updating |
recursive | true means recursively update all submenus, and false means just this menu |
|
overridevirtual |
Updates any controls cached by this contribution item with changes for the the given property.
id | the id of the changed property |
Implements berry::IContributionItem.
|
overridevirtual |
Incrementally builds the menu from the contribution items, and does so recursively for all submenus.
force | true means update even if not dirty, and false for normal incremental updating |
Implements berry::IMenuManager.
|
protected |
Indicates this item is visible in its manager; true
by default.
Definition at line 109 of file berryMenuManager.h.