|
Eclipse eRCP Release 1.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.part.WorkbenchPart
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
.
ViewPart
,
org.eclipse.ui.part.EditorPart
Field Summary |
---|
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
Constructor Summary | |
---|---|
protected |
WorkbenchPart()
Creates a new workbench part. |
Method Summary | |
---|---|
void |
addPropertyListener(IPropertyListener l)
Adds a listener for changes to properties of this workbench part. |
protected void |
checkSite(IWorkbenchPartSite site)
Checks that the given site is valid for this type of part. |
abstract void |
createPartControl(Composite parent)
Creates the SWT controls for this workbench part. |
void |
dispose()
The WorkbenchPart implementation of this
IWorkbenchPart method disposes the title image
loaded by setInitializationData . |
protected void |
firePropertyChange(int propertyId)
Fires a property changed event. |
Object |
getAdapter(Class adapter)
{@inheritDoc} Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted). |
protected IConfigurationElement |
getConfigurationElement()
Returns the configuration element for this part. |
String |
getContentDescription()
Returns the content description of this part. The content description is an optional user-readable string that describes what is currently being displayed in the part. By default, the workbench will display the content description in a line near the top of the view or editor. An empty string indicates no content description text. If this value changes the part must fire a property listener event with IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION .
It is considered bad practise to overload or extend this method.
|
protected Image |
getDefaultImage()
Returns the default title image. |
int |
getOrientation()
Return the orientation of this part. |
String |
getPartName()
Returns the name of this part. If this value changes the part must fire a property listener event with IWorkbenchPartConstants.PROP_PART_NAME .
It is considered bad practise to overload or extend this method.
|
IWorkbenchPartSite |
getSite()
Returns the site for this workbench part. |
String |
getTitle()
Returns the title of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE .
The title is used to populate the title bar of this part's visual container. It is considered bad practise to overload or extend this method. |
Image |
getTitleImage()
Returns the title image of this workbench part. |
String |
getTitleToolTip()
Returns the title tool tip text of this workbench part. |
void |
removePropertyListener(IPropertyListener l)
Removes the given property listener from this workbench part. |
protected void |
setContentDescription(String description)
Sets the content description for this part. |
abstract void |
setFocus()
Asks this part to take focus within the workbench. |
void |
setInitializationData(IConfigurationElement cfig,
String propertyName,
Object data)
{@inheritDoc} The WorkbenchPart implementation of this
IExecutableExtension records the configuration element in
and internal state variable (accessible via getConfigElement ).
|
protected void |
setPartName(String partName)
Sets the name of this part. |
protected void |
setSite(IWorkbenchPartSite site)
Sets the part site. |
protected void |
setTitle(String title)
Deprecated. new code should use setPartName and setContentDescription |
protected void |
setTitleImage(Image titleImage)
Sets or clears the title image of this part. |
protected void |
setTitleToolTip(String toolTip)
Sets or clears the title tool tip text of this part. |
void |
showBusy(boolean busy)
Show that this part is busy due to a Job running that it is listening to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected WorkbenchPart()
Method Detail |
public void addPropertyListener(IPropertyListener l)
IWorkbenchPart
The property ids are defined in IWorkbenchPartConstants
.
addPropertyListener
in interface IWorkbenchPart
l
- a property listenerpublic abstract void createPartControl(Composite parent)
IWorkbenchPart
Clients should not call this method (the workbench calls this method when it needs to, which may be never).
For implementors this is a multi-step process:
IActionService
.IActionService
.ISelectionService
(optional).
createPartControl
in interface IWorkbenchPart
parent
- the parent controlpublic void dispose()
WorkbenchPart
implementation of this
IWorkbenchPart
method disposes the title image
loaded by setInitializationData
. Subclasses may extend.
dispose
in interface IWorkbenchPart
protected void firePropertyChange(int propertyId)
propertyId
- the id of the property that changedpublic Object getAdapter(Class adapter)
protected IConfigurationElement getConfigurationElement()
protected Image getDefaultImage()
public IWorkbenchPartSite getSite()
IWorkbenchPart
null
while the workbench part is being initialized. After
the initialization is complete, this value must be non-null
for the remainder of the part's life cycle.
getSite
in interface IWorkbenchPart
null
if the part
has not yet been initializedpublic String getTitle()
PROP_TITLE
.
The title is used to populate the title bar of this part's visual container.
It is considered bad practise to overload or extend this method. Parts should set their title by calling setPartName and/or setContentDescription.
getTitle
in interface IWorkbenchPart
null
)public Image getTitleImage()
IWorkbenchPart
PROP_TITLE
.
The title image is usually used to populate the title bar of this part's visual container. Since this image is managed by the part itself, callers must not dispose the returned image.
getTitleImage
in interface IWorkbenchPart
public String getTitleToolTip()
IWorkbenchPart
PROP_TITLE
.
The tool tip text is used to populate the title bar of this part's visual container.
getTitleToolTip
in interface IWorkbenchPart
null
)public void removePropertyListener(IPropertyListener l)
IWorkbenchPart
removePropertyListener
in interface IWorkbenchPart
l
- a property listenerpublic abstract void setFocus()
IWorkbenchPart
Clients should not call this method (the workbench calls this method at
appropriate times). To have the workbench activate a part, use
IWorkbenchPage.activate(IWorkbenchPart) instead
.
setFocus
in interface IWorkbenchPart
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data)
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.
protected void setSite(IWorkbenchPartSite site)
Subclasses must invoke this method from IEditorPart.init
and IViewPart.init
.
site
- the workbench part siteprotected void checkSite(IWorkbenchPartSite site)
site
- the site to checkprotected void setTitle(String title)
This may change a title that was previously set using setPartName or setContentDescription.
title
- the title, or null
to clearprotected void setTitleImage(Image titleImage)
titleImage
- the title image, or null
to clearprotected void setTitleToolTip(String toolTip)
getTitleToolTip
toolTip
- the new tool tip text, or null
to clearpublic void showBusy(boolean busy)
busy
- boolean to indicate that the busy state has started
or ended.org.eclipse.ui.progress.IWorkbenchSiteProgressService#showBusyForFamily(Object)
public String getPartName()
IWorkbenchPartConstants.PROP_PART_NAME
.
It is considered bad practise to overload or extend this method. Parts should call setPartName to change their part name.
getPartName
in interface IWorkbenchPart2
null
)protected void setPartName(String partName)
setPartName and setContentDescription are intended to replace setTitle. This may change a value that was previously set using setTitle.
partName
- the part name, as it should be displayed in tabs.public String getContentDescription()
IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION
.
It is considered bad practise to overload or extend this method. Parts should call setContentDescription to change their content description.
getContentDescription
in interface IWorkbenchPart2
null
)protected void setContentDescription(String description)
This may overwrite a value that was previously set in setTitle
description
- the content descriptionpublic int getOrientation()
IWorkbenchPartOrientation
getOrientation
in interface IWorkbenchPartOrientation
Window#getDefaultOrientation()
,
SWT.RIGHT_TO_LEFT
,
SWT.LEFT_TO_RIGHT
,
Window#getDefaultOrientation()
|
Eclipse eRCP Release 1.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |