28 class PropChangedRunnable :
public SafeRunnable
34 IPropertyChangeListener::Events::EventType::AbstractDelegate* delegate;
42 delegate->Execute(event);
58 m_ContentDescription(
"")
63 void WorkbenchPart::InternalSetContentDescription(
64 const QString& description)
69 if (this->m_ContentDescription == description)
73 this->m_ContentDescription = description;
78 void WorkbenchPart::InternalSetPartName(
const QString& partName)
85 if (this->m_PartName == partName)
89 this->m_PartName = partName;
109 this->m_PartSite = site;
121 if (this->m_TitleImage.cacheKey() == titleImage.cacheKey())
125 this->m_TitleImage = titleImage;
133 if (this->m_ToolTip == toolTip)
137 this->m_ToolTip = toolTip;
144 InternalSetPartName(partName);
151 InternalSetContentDescription(description);
157 const QString& oldValue,
const QString& newValue)
164 typedef IPropertyChangeListener::Events::EventType::ListenerList
ListenerList;
167 const ListenerList& listeners =
169 for (
auto iter = listeners.begin(); iter
170 != listeners.end(); ++iter)
172 runnable->delegate = *iter;
184 typedef IPropertyChangeListener::Events::EventType::ListenerList
ListenerList;
187 const ListenerList& listeners =
189 for (
auto iter = listeners.begin(); iter
190 != listeners.end(); ++iter)
192 runnable->delegate = *iter;
208 const QString& value)
210 QHash<QString, QString>::iterator iter = partProperties.find(key);
212 if (iter != partProperties.end())
213 oldValue = iter.value();
217 partProperties.remove(key);
221 partProperties.insert(key, value);
228 QHash<QString, QString>::const_iterator itr = partProperties.find(key);
229 if (itr == partProperties.end())
return "";
236 return partProperties;
241 return this->m_PartSite;
246 return this->m_PartName;
251 return this->m_ContentDescription;
256 return this->m_TitleImage;
262 return this->m_ToolTip;
269 m_ConfigElement = cfig;
272 m_PartName = cfig->GetAttribute(
"name");
273 m_Title = m_PartName;
276 QString strIcon = cfig->GetAttribute(
"icon");
277 if (strIcon.isEmpty())
283 m_ConfigElement->GetContributor()->GetName(), strIcon);
void RemoveListener(IPropertyChangeListener *listener)
static void Run(ISafeRunnable::Pointer code)
virtual void SetPartName(const QString &partName)
void SetInitializationData(const IConfigurationElement::Pointer &cfig, const QString &propertyName, const Object::Pointer &data) override
static const int PROP_PART_NAME
void SetSite(IWorkbenchPartSite::Pointer site)
void SetPartProperty(const QString &key, const QString &value) override
berry::SmartPointer< Self > Pointer
QIcon GetTitleImage() const override
#define berryObjectMacro(...)
void AddPropertyListener(IPropertyChangeListener *l) override
static const int PROP_TITLE
static const int PROP_CONTENT_DESCRIPTION
const QHash< QString, QString > & GetPartProperties() const override
void FirePropertyChanged(const QString &key, const QString &oldValue, const QString &newValue)
virtual void CheckSite(IWorkbenchPartSite::Pointer site)
void AddListener(IPropertyChangeListener *listener)
QString GetPartName() const override
virtual void SetTitleToolTip(const QString &toolTip)
virtual void SetContentDescription(const QString &description)
void FirePropertyChange(int propertyId)
static const QString INTEGER_PROPERTY
void RemovePropertyListener(IPropertyChangeListener *l) override
QString GetContentDescription() const override
virtual void SetTitleImage(const QIcon &titleImage)
static QIcon ImageDescriptorFromPlugin(const QString &pluginId, const QString &imageFilePath)
void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage)
~WorkbenchPart() override
QString GetTitleToolTip() const override
QString GetPartProperty(const QString &key) const override
IWorkbenchPartSite::Pointer GetSite() const override