Package org.eclipse.ui
Interface IWorkbenchPartReference
- All Known Subinterfaces:
IEditorReference
,IViewReference
- All Known Implementing Classes:
EditorReference
,ViewReference
,WorkbenchPartReference
public interface IWorkbenchPartReference
Implements a reference to a IWorkbenchPart. The IWorkbenchPart will not be
instantiated until the part becomes visible or the API getPart is sent with
true;
This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener for changes in the arbitrary properties set.void
addPropertyListener
(IPropertyListener listener) Returns the content description for the part (or the empty string if none)getId()
getPage()
getPart
(boolean restore) Returns the IWorkbenchPart referenced by this object.Returns the name of the part, as it should be shown in tabs.getPartProperty
(String key) Return an arbitrary property from the reference.getTitle()
boolean
isDirty()
Returns whether the part is dirty (i.e. has unsaved changes).void
Remove a listener for changes in the arbitrary properties set.void
removePropertyListener
(IPropertyListener listener)
-
Method Details
-
getPart
Returns the IWorkbenchPart referenced by this object.- Parameters:
restore
- tries to restore the part iftrue
.- Returns:
- the part, or
null
if the part was not instantiated or it failed to be restored.
-
getTitle
String getTitle()- Returns:
- the title of the part
- See Also:
-
getTitleImage
Image getTitleImage()- Returns:
- the title image of the part
- See Also:
-
getTitleToolTip
String getTitleToolTip()- Returns:
- the title tooltip
- See Also:
-
getId
String getId()- Returns:
- the ID of the part
- See Also:
-
addPropertyListener
- Parameters:
listener
- the property listener- See Also:
-
removePropertyListener
- Parameters:
listener
- the poperty listener to remove- See Also:
-
getPage
IWorkbenchPage getPage()- Returns:
- the workbench page that contains this part
-
getPartName
String getPartName()Returns the name of the part, as it should be shown in tabs.- Returns:
- the part name
- Since:
- 3.0
-
getContentDescription
String getContentDescription()Returns the content description for the part (or the empty string if none)- Returns:
- the content description for the part
- Since:
- 3.0
-
isDirty
boolean isDirty()Returns whether the part is dirty (i.e. has unsaved changes).- Returns:
true
if the part is dirty,false
otherwise- Since:
- 3.2 (previously existed on IEditorReference)
-
getPartProperty
Return an arbitrary property from the reference. If the part has been instantiated, it just delegates to the part. If not, then it looks in its own cache of properties. If the property is not available or the part has never been instantiated, it can returnnull
.- Parameters:
key
- The property to return. Must not benull
.- Returns:
- The String property, or
null
. - Since:
- 3.3
-
addPartPropertyListener
Add a listener for changes in the arbitrary properties set.- Parameters:
listener
- Must not benull
.- Since:
- 3.3
-
removePartPropertyListener
Remove a listener for changes in the arbitrary properties set.- Parameters:
listener
- Must not benull
.- Since:
- 3.3
-