diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt.log/src/internal/berryLogView.h b/BlueBerry/Bundles/org.blueberry.ui.qt.log/src/internal/berryLogView.h index 7b189cc2b2..86e9424210 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt.log/src/internal/berryLogView.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt.log/src/internal/berryLogView.h @@ -1,47 +1,46 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef BERRYLOGVIEW_H_ #define BERRYLOGVIEW_H_ #include #include "../berryQtViewPart.h" namespace berry { -class LogView : public QObject, public QtViewPart +class LogView : public QtViewPart { Q_OBJECT - Q_INTERFACES(berry::IViewPart) public: LogView(); LogView(const LogView& other); void SetFocus(); protected: void CreateQtPartControl(QWidget* parent); }; } // namespace berry #endif /*BERRYLOGVIEW_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/src/internal/berryObjectBrowserView.h b/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/src/internal/berryObjectBrowserView.h index 186f48b055..a5a0bf59a2 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/src/internal/berryObjectBrowserView.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt.objectinspector/src/internal/berryObjectBrowserView.h @@ -1,103 +1,102 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef BERRY_OBJECTINSPECTORVIEW_H_INCLUDED #define BERRY_OBJECTINSPECTORVIEW_H_INCLUDED #include #include #include #include "berryQtObjectTableModel.h" #include #include class QAbstractProxyModel; namespace berry { /*! * \ingroup org_blueberry_ui_qt_objectinspector_internal * * \brief Object Inspector * * You need to reimplement the methods SetFocus() and CreateQtPartControl(QWidget*) * from berry::QtViewPart * * \sa berry::QtViewPart */ -class ObjectBrowserView : public QObject, public berry::QtViewPart +class ObjectBrowserView : public berry::QtViewPart { Q_OBJECT - Q_INTERFACES(berry::IViewPart) public: static const std::string VIEW_ID; ObjectBrowserView(); ObjectBrowserView(const ObjectBrowserView& other); void Init(IViewSite::Pointer site, IMemento::Pointer memento); /*! * \brief Gives focus to a specific control in the view * This method is called from the framework when the view is activated. */ void SetFocus(); void SaveState(IMemento::Pointer memento); protected slots: void ResetAction(bool checked); void SelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); void ContextMenuRequested(const QPoint&); void ToggleBreakpoint(bool checked); protected: /*! * \brief Builds the user interface of the view * This method is called from the framework. The parent widget has no layout, so * you should set one adapted to your needs. */ void CreateQtPartControl(QWidget* parent); void RestoreGuiState(IMemento::Pointer memento); private: Ui::QtObjectBrowserView m_Controls; QtObjectTableModel* m_ObjectModel; QAbstractProxyModel* m_ProxyModel; QAction m_ActionToggleBreakpoint; QAction m_ActionEnableBreakpoint; QAction m_ActionDisableBreakpoint; QMenu m_ContextMenu; IMemento::Pointer m_StateMemento; bool m_Useful; }; } //namespace berry #endif /*BERRY_OBJECTINSPECTORVIEW_H_INCLUDED*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/files.cmake b/BlueBerry/Bundles/org.blueberry.ui/files.cmake index 18bf959667..f056717823 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/files.cmake +++ b/BlueBerry/Bundles/org.blueberry.ui/files.cmake @@ -1,225 +1,228 @@ SET(MOC_H_FILES src/internal/berryWorkbenchPlugin.h + src/berryWorkbenchPart.h + src/berryEditorPart.h + src/berryViewPart.h ) SET(CACHED_RESOURCE_FILES plugin.xml ) SET(SRC_CPP_FILES berryAbstractSourceProvider.cpp berryAbstractUIPlugin.cpp berryAbstractUICTKPlugin.cpp berryConstants.cpp berryDisplay.cpp berryEditorPart.cpp berryFileEditorInput.cpp berryGeometry.cpp berryIEditorRegistry.cpp berryImageDescriptor.cpp berryIMemento.cpp berryIPageLayout.cpp berryIPartListener.cpp berryIPerspectiveListener.cpp berryIPropertyChangeListener.cpp berryISaveablePart.cpp berryISaveablesLifecycleListener.cpp berryISelectionChangedListener.cpp berryISelectionListener.cpp berryIShellListener.cpp berryISizeProvider.cpp berryISourceProviderListener.cpp berryISources.cpp berryIWindowListener.cpp berryIWorkbenchListener.cpp berryIWorkbenchPage.cpp berryIWorkbenchPartConstants.cpp berryPlatformUI.cpp berryPoint.cpp berryPropertyChangeEvent.cpp berryRectangle.cpp berrySameShellProvider.cpp berrySaveable.cpp berrySaveablesLifecycleEvent.cpp berrySelectionChangedEvent.cpp berryShell.cpp berryShellEvent.cpp berryUIException.cpp berryViewPart.cpp berryWindow.cpp berryWorkbenchPart.cpp berryWorkbenchPreferenceConstants.cpp berryXMLMemento.cpp #application application/berryActionBarAdvisor.cpp application/berryWorkbenchAdvisor.cpp application/berryWorkbenchWindowAdvisor.cpp #commands #commands/berryAbstractContributionFactory.cpp #commands/berryCommandContributionItem.cpp #commands/berryCommandContributionItemParameter.cpp #commands/berryContributionItem.cpp #commands/berryContributionManager.cpp #commands/berryICommandImageService.cpp #commands/berryICommandService.cpp #commands/berryIContributionManagerOverrides.cpp #commands/berryIMenuItem.cpp #commands/berryIMenuItemListener.cpp #commands/berryIMenuListener.cpp #commands/berryIToolItemListener.cpp #commands/berryIUIElementListener.cpp #commands/berryMenuManager.cpp #commands/berrySubContributionItem.cpp #commands/berryUIElement.cpp #dialogs dialogs/berryIDialog.cpp dialogs/berryMessageDialog.cpp #guitk guitk/berryGuiTkControlEvent.cpp guitk/berryGuiTkEvent.cpp guitk/berryGuiTkIControlListener.cpp guitk/berryGuiTkIMenuListener.cpp guitk/berryGuiTkISelectionListener.cpp guitk/berryGuiTkSelectionEvent.cpp #handlers handlers/berryHandlerUtil.cpp handlers/berryIHandlerActivation.cpp handlers/berryShowViewHandler.cpp #src intro/berryIntroPart.cpp #tweaklets tweaklets/berryDnDTweaklet.cpp tweaklets/berryGuiWidgetsTweaklet.cpp tweaklets/berryImageTweaklet.cpp tweaklets/berryMessageDialogTweaklet.cpp tweaklets/berryWorkbenchPageTweaklet.cpp tweaklets/berryWorkbenchTweaklet.cpp #presentations presentations/berryIPresentablePart.cpp presentations/berryIPresentationFactory.cpp presentations/berryIStackPresentationSite.cpp presentations/berryStackDropResult.cpp presentations/berryStackPresentation.cpp #testing testing/berryTestableObject.cpp #util util/berrySafeRunnable.cpp ) SET(INTERNAL_CPP_FILES #intro intro/berryEditorIntroAdapterPart.cpp intro/berryIntroConstants.cpp intro/berryIntroDescriptor.cpp intro/berryIntroPartAdapterSite.cpp intro/berryIntroRegistry.cpp intro/berryViewIntroAdapterPart.cpp intro/berryWorkbenchIntroManager.cpp berryAbstractPartSelectionTracker.cpp berryAbstractSelectionService.cpp berryBundleUtility.cpp berryContainerPlaceholder.cpp berryDetachedPlaceHolder.cpp berryDefaultSaveable.cpp berryDefaultStackPresentationSite.cpp berryDetachedWindow.cpp berryDragUtil.cpp berryEditorAreaHelper.cpp berryEditorDescriptor.cpp berryEditorManager.cpp berryEditorReference.cpp berryEditorRegistry.cpp berryEditorRegistryReader.cpp berryEditorSashContainer.cpp berryEditorSite.cpp berryErrorViewPart.cpp berryFileEditorMapping.cpp berryFolderLayout.cpp berryIDragOverListener.cpp berryLayoutHelper.cpp berryLayoutPart.cpp berryLayoutPartSash.cpp berryLayoutTree.cpp berryLayoutTreeNode.cpp berryNullEditorInput.cpp berryPageLayout.cpp berryPagePartSelectionTracker.cpp berryPageSelectionService.cpp berryPartList.cpp berryPartPane.cpp berryPartPlaceholder.cpp berryPartSashContainer.cpp berryPartService.cpp berryPartSite.cpp berryPartStack.cpp berryPartTester.cpp berryPerspective.cpp berryPerspectiveDescriptor.cpp berryPerspectiveExtensionReader.cpp berryPerspectiveHelper.cpp berryPerspectiveRegistry.cpp berryPerspectiveRegistryReader.cpp berryPlaceholderFolderLayout.cpp berryPreferenceConstants.cpp berryPresentablePart.cpp berryPresentationFactoryUtil.cpp berryPresentationSerializer.cpp berryRegistryReader.cpp berrySaveablesList.cpp berryServiceLocator.cpp berryServiceLocatorCreator.cpp berryShellPool.cpp berrySourcePriorityNameMapping.cpp berryStackablePart.cpp berryStickyViewDescriptor.cpp berryStickyViewManager.cpp berryTweaklets.cpp berryViewDescriptor.cpp berryViewFactory.cpp berryViewLayout.cpp berryViewReference.cpp berryViewRegistry.cpp berryViewRegistryReader.cpp berryViewSashContainer.cpp berryViewSite.cpp berryWorkbenchPage.cpp berryWindowManager.cpp berryWindowPartSelectionTracker.cpp berryWindowSelectionService.cpp berryWorkbench.cpp berryWorkbenchConfigurer.cpp berryWorkbenchConstants.cpp berryWorkbenchPagePartList.cpp berryWorkbenchPartReference.cpp berryWorkbenchPlugin.cpp berryWorkbenchRegistryConstants.cpp berryWorkbenchServiceRegistry.cpp berryWorkbenchTestable.cpp berryWorkbenchWindow.cpp berryWorkbenchWindowConfigurer.cpp berryWWinPartService.cpp ) SET(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryEditorPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryEditorPart.h index 59a1690bcb..881a0fbb39 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryEditorPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryEditorPart.h @@ -1,248 +1,251 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef BERRYEDITORPART_H_ #define BERRYEDITORPART_H_ #include #include "berryIEditorPart.h" #include "berryIEditorInput.h" #include "berryIEditorSite.h" #include "berryWorkbenchPart.h" namespace berry { /** * \ingroup org_blueberry_ui * * Abstract base implementation of all workbench editors. *

* This class should be subclassed by clients wishing to define new editors. * The name of the subclass should be given as the "class" * attribute in a editor extension contributed to the workbench's * editor extension point (named "org.mitk.ui.editors"). * For example, the plug-in's XML markup might contain: *

  * <extension point="org.blueberry.ui.editors">
  *      <editor id="com.example.myplugin.ed"
  *         name="My Editor"
  *         icon="./images/cedit.gif"
  *       extensions="foo"
  *       class="com.example.myplugin.MyFooEditor"
  *       contributorClass="com.example.myplugin.MyFooEditorContributor"
  *      />
  * </extension>
  * 
* where com.example.myplugin.MyEditor is the name of the * EditorPart subclass. *

*

* Subclasses must implement the following methods: *

    *
  • IEditorPart.init - to initialize editor when assigned its site
  • *
  • IWorkbenchPart.createPartControl - to create the editor's controls
  • *
  • IWorkbenchPart.setFocus - to accept focus
  • *
  • IEditorPart.isDirty - to decide whether a significant change has * occurred
  • *
  • IEditorPart.doSave - to save contents of editor
  • *
  • IEditorPart.doSaveAs - to save contents of editor
  • *
  • IEditorPart.isSaveAsAllowed - to control Save As
  • *
*

*

* Subclasses may extend or reimplement the following methods as required: *

    *
  • IExecutableExtension.setInitializationData - extend to provide additional * initialization when editor extension is instantiated
  • *
  • IWorkbenchPart.dispose - extend to provide additional cleanup
  • *
  • IAdaptable.getAdapter - reimplement to make the editor * adaptable
  • *
*

*/ class BERRY_UI EditorPart : public WorkbenchPart , public IEditorPart { + Q_OBJECT + Q_INTERFACES(berry::IEditorPart) + public: berryObjectMacro(EditorPart); private: /** * Editor input, or null if none. */ IEditorInput::Pointer editorInput; protected: /** * Creates a new workbench editor. */ EditorPart(); /** * Sets the input to this editor. This method simply updates the internal * member variable. * *

Unlike most of the other set methods on this class, this method does * not fire a property change. Clients that call this method from a subclass * must ensure that they fire an IWorkbenchPartConstants.PROP_INPUT property * change after calling this method but before leaving whatever public method * they are in. Clients that expose this method as public API must fire * the property change within their implementation of setInput.

* *

Note that firing a property change may cause listeners to immediately * reach back and call methods on this editor. Care should be taken not to * fire the property change until the editor has fully updated its internal * state to reflect the new input.

* * @param input the editor input * * @see #setInputWithNotify(IEditorInput) */ virtual void SetInput(IEditorInput::Pointer input) ; /** * Sets the input to this editor and fires a PROP_INPUT property change if * the input has changed. This is the convenience method implementation. * *

Note that firing a property change may cause other objects to reach back * and invoke methods on the editor. Care should be taken not to call this method * until the editor has fully updated its internal state to reflect the * new input.

* * @since 3.2 * * @param input the editor input */ virtual void SetInputWithNotify(IEditorInput::Pointer input); /* (non-Javadoc) * @see org.blueberry.ui.part.WorkbenchPart#setContentDescription(java.lang.String) */ virtual void SetContentDescription(const std::string& description); /* (non-Javadoc) * @see org.blueberry.ui.part.WorkbenchPart#setPartName(java.lang.String) */ virtual void SetPartName(const std::string& partName); /** * Checks that the given site is valid for this type of part. * The site for an editor must be an IEditorSite. * * @param site the site to check * @since 3.1 */ void CheckSite(IWorkbenchPartSite::Pointer site); public: /* (non-Javadoc) * Saves the contents of this editor. *

* Subclasses must override this method to implement the open-save-close lifecycle * for an editor. For greater details, see IEditorPart *

* * @see IEditorPart */ virtual void DoSave(/*IProgressMonitor monitor*/) = 0; /* (non-Javadoc) * Saves the contents of this editor to another object. *

* Subclasses must override this method to implement the open-save-close lifecycle * for an editor. For greater details, see IEditorPart *

* * @see IEditorPart */ virtual void DoSaveAs() = 0; /* (non-Javadoc) * Method declared on IEditorPart. */ IEditorInput::Pointer GetEditorInput() const; /* (non-Javadoc) * Method declared on IEditorPart. */ IEditorSite::Pointer GetEditorSite() const; /* (non-Javadoc) * Gets the title tool tip text of this part. * * @return the tool tip text */ std::string GetTitleToolTip() const; /* (non-Javadoc) * Initializes the editor part with a site and input. *

* Subclasses of EditorPart must implement this method. Within * the implementation subclasses should verify that the input type is acceptable * and then save the site and input. Here is sample code: *

*
      *    if (!(input instanceof IFileEditorInput))
      *      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
      *    setSite(site);
      *    setInput(input);
      * 
*/ virtual void Init(IEditorSite::Pointer site, IEditorInput::Pointer input) = 0; /* (non-Javadoc) * Returns whether the contents of this editor have changed since the last save * operation. *

* Subclasses must override this method to implement the open-save-close lifecycle * for an editor. For greater details, see IEditorPart *

* * @see IEditorPart */ virtual bool IsDirty() const = 0; /* (non-Javadoc) * Returns whether the "save as" operation is supported by this editor. *

* Subclasses must override this method to implement the open-save-close lifecycle * for an editor. For greater details, see IEditorPart *

* * @see IEditorPart */ virtual bool IsSaveAsAllowed() const = 0; /* (non-Javadoc) * Returns whether the contents of this editor should be saved when the editor * is closed. *

* This method returns true if and only if the editor is dirty * (isDirty). *

*/ virtual bool IsSaveOnCloseNeeded() const; }; } #endif /*BERRYEDITORPART_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryViewPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryViewPart.h index 0370539998..a8fbfffac6 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryViewPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryViewPart.h @@ -1,103 +1,105 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef BERRYVIEWPART_H_ #define BERRYVIEWPART_H_ #include "berryIViewPart.h" #include "berryIViewSite.h" #include "berryWorkbenchPart.h" #include "berryIMemento.h" namespace berry { /** * \ingroup org_blueberry_ui * * Abstract base implementation of all workbench views. *

* This class should be subclassed by clients wishing to define new views. * The name of the subclass should be given as the "class" * attribute in a view extension contributed to the workbench's * view extension point (named "org.blueberry.ui.views"). * For example, the plug-in's XML markup might contain: *

  * <extension point="org.blueberry.ui.views">
  *      <view id="com.example.myplugin.view"
  *         name="My View"
  *         class="com.example.myplugin.MyView"
  *         icon="images/eview.gif"
  *      />
  * </extension>
  * 
* where com.example.myplugin.MyView is the name of the * ViewPart subclass. *

*

* Subclasses must implement the following methods: *

    *
  • createPartControl - to create the view's controls
  • *
  • setFocus - to accept focus
  • *
*

*

* Subclasses may extend or reimplement the following methods as required: *

    *
  • setInitializationData - extend to provide additional * initialization when view extension is instantiated
  • *
  • init(IWorkbenchPartSite) - extend to provide additional * initialization when view is assigned its site
  • *
  • dispose - extend to provide additional cleanup
  • *
  • getAdapter - reimplement to make their view adaptable
  • *
*

*/ class BERRY_UI ViewPart : public WorkbenchPart, public IViewPart { + Q_OBJECT + Q_INTERFACES(berry::IViewPart) protected: ViewPart(); /** * Checks that the given site is valid for this type of part. * The site for a view must be an IViewSite. * * @param site the site to check * @since 3.1 */ void CheckSite(IWorkbenchPartSite::Pointer site); public: berryObjectMacro(ViewPart); void Init(IViewSite::Pointer site, IMemento::Pointer memento = IMemento::Pointer(0)); void SaveState(IMemento::Pointer memento); /* * Method declared on IViewPart. */ IViewSite::Pointer GetViewSite(); }; } // namespace berry #endif /*BERRYVIEWPART_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryWorkbenchPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryWorkbenchPart.h index fe07cf12e5..b76f4425c3 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryWorkbenchPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryWorkbenchPart.h @@ -1,256 +1,258 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __BERRY_WORKBENCH_PART_H__ #define __BERRY_WORKBENCH_PART_H__ #include "berryIWorkbenchPart.h" #include "berryIWorkbenchPartSite.h" #include #include #include "berryImageDescriptor.h" namespace berry { /** * \ingroup org_blueberry_ui * * Abstract base implementation of all workbench parts. *

* This class is not intended to be subclassed by clients outside this * package; clients should instead subclass ViewPart or * EditorPart. *

* * @see org.blueberry.ui.part.ViewPart * @see org.blueberry.ui.part.EditorPart * @noextend This class is not intended to be subclassed by clients. */ -class BERRY_UI WorkbenchPart : public virtual IWorkbenchPart, - public IExecutableExtension +class BERRY_UI WorkbenchPart : public QObject, + public virtual IWorkbenchPart, public IExecutableExtension { + Q_OBJECT + Q_INTERFACES(berry::IExecutableExtension) public: berryObjectMacro(WorkbenchPart); ~WorkbenchPart(); private: std::string m_Title; SmartPointer m_ImageDescriptor; void* m_TitleImage; std::string m_ToolTip; IConfigurationElement::Pointer m_ConfigElement; IWorkbenchPartSite::Pointer m_PartSite; std::string m_PartName; std::string m_ContentDescription; std::map partProperties; IPropertyChangeListener::Events partChangeEvents; void InternalSetContentDescription(const std::string& description); void InternalSetPartName(const std::string& partName); protected: WorkbenchPart(); /** * Returns the configuration element for this part. The configuration element * comes from the plug-in registry entry for the extension defining this part. * * @return the configuration element for this part */ IConfigurationElement::Pointer GetConfigurationElement() const { return m_ConfigElement; } /** * Returns the default title image. * * @return the default image */ // protected Image getDefaultImage() { // return PlatformUI.getWorkbench().getSharedImages().getImage( // ISharedImages.IMG_DEF_VIEW); // } /** * Sets the part site. *

* Subclasses must invoke this method from IEditorPart.init * and IViewPart.init. * * @param site the workbench part site */ void SetSite(IWorkbenchPartSite::Pointer site); /** * Checks that the given site is valid for this type of part. * The default implementation does nothing. * * @param site the site to check */ virtual void CheckSite(IWorkbenchPartSite::Pointer site); /** * Sets or clears the title image of this part. * * @param titleImage the title image, or null to clear */ virtual void SetTitleImage(void* titleImage); /** * Sets or clears the title tool tip text of this part. Clients should * call this method instead of overriding getTitleToolTip * * @param toolTip the new tool tip text, or null to clear */ virtual void SetTitleToolTip(const std::string& toolTip); /** * Sets the name of this part. The name will be shown in the tab area for * the part. Clients should call this method instead of overriding getPartName. * Setting this to the empty string will cause a default part name to be used. * * @param partName the part name, as it should be displayed in tabs. */ virtual void SetPartName(const std::string& partName); /** * Sets the content description for this part. The content description is typically * a short string describing the current contents of the part. Setting this to the * empty string will cause a default content description to be used. Clients should * call this method instead of overriding getContentDescription(). For views, the * content description is shown (by default) in a line near the top of the view. For * editors, the content description is shown beside the part name when showing a * list of editors. If the editor is open on a file, this typically contains the path * to the input file, without the filename or trailing slash. * * @param description the content description */ virtual void SetContentDescription(const std::string& description); void FirePropertyChanged(const std::string& key, const std::string& oldValue, const std::string& newValue); void FirePropertyChange(int propertyId); public: /* (non-Javadoc) * Method declared on IWorkbenchPart. */ void AddPropertyListener(IPropertyChangeListener::Pointer l); void RemovePropertyListener(IPropertyChangeListener::Pointer l); void SetPartProperty(const std::string& key, const std::string& value); /* (non-Javadoc) * @see org.blueberry.ui.IWorkbenchPart3#getPartProperty(java.lang.String) */ std::string GetPartProperty(const std::string& key) const; /* (non-Javadoc) * @see org.blueberry.ui.IWorkbenchPart3#getPartProperties() */ const std::map& GetPartProperties() const; /** * {@inheritDoc} * The WorkbenchPart implementation of this * IExecutableExtension records the configuration element in * and internal state variable (accessible via getConfigElement). * It also loads the title image, if one is specified in the configuration element. * Subclasses may extend. * * Should not be called by clients. It is called by the core plugin when creating * this executable extension. */ void SetInitializationData(IConfigurationElement::Pointer cfig, const std::string& propertyName, Object::Pointer data); /* * Creates the controls for this workbench part. *

* Subclasses must implement this method. For a detailed description of the * requirements see IWorkbenchPart *

* * @param parent the parent control * @see IWorkbenchPart */ virtual void CreatePartControl(void* parent) = 0; /* (non-Javadoc) * Asks this part to take focus within the workbench. *

* Subclasses must implement this method. For a detailed description of the * requirements see IWorkbenchPart *

* * @see IWorkbenchPart */ virtual void SetFocus() = 0; /* * Method declared on IWorkbenchPart. */ IWorkbenchPartSite::Pointer GetSite() const; /** * {@inheritDoc} *

* It is considered bad practise to overload or extend this method. * Parts should call setPartName to change their part name. *

*/ std::string GetPartName() const; /** * {@inheritDoc} *

* It is considered bad practise to overload or extend this method. * Parts should call setContentDescription to change their content description. *

*/ std::string GetContentDescription() const; /* (non-Javadoc) * Method declared on IWorkbenchPart. */ void* GetTitleImage() const; /* (non-Javadoc) * Gets the title tool tip text of this part. * * @return the tool tip text */ std::string GetTitleToolTip() const; }; } // namespace berry #endif // __BERRY_WORKBENCH_PART_H__