|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.team.ui.SaveablePartAdapter
This adapter provides default implementations for methods on ISaveableWorkbenchPart and IWorkbenchPart.
Classes that want to implement a saveable part can simply implement the methods that they need while accepting the provided defaults for most of the methods.
Field Summary |
Fields inherited from interface org.eclipse.team.ui.ISaveableWorkbenchPart |
PROP_DIRTY |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
SaveablePartAdapter()
|
Method Summary | |
void | addPropertyListener(IPropertyListener listener)
Adds a listener for changes to properties of this workbench part. |
void | dispose()
Disposes of this workbench part. |
void | doSaveAs()
Saves the contents of this part to another object. |
Object | getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. |
IWorkbenchPartSite | getSite()
Returns the site for this workbench part. |
String | getTitleToolTip()
Returns the title tool tip text of this workbench part. |
boolean | isSaveAsAllowed()
Returns whether the "Save As" operation is supported by this part. |
boolean | isSaveOnCloseNeeded()
Returns whether the contents of this part should be saved when the part is closed. |
void | removePropertyListener(IPropertyListener listener)
Removes the given property listener from this workbench part. |
void | setFocus()
Asks this part to take focus within the workbench. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
doSave, isDirty |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
createPartControl, getTitle, getTitleImage |
Constructor Detail |
public SaveablePartAdapter()
Method Detail |
public void doSaveAs()
Implementors are expected to open a "Save As" dialog where the user will be able to select a new name for the contents. After the selection is made, the contents should be saved to that new name. During this operation a IProgressMonitor should be used to indicate progress.
If the save is successful, the part fires a property changed event reflecting the new dirty state (PROP_DIRTY property).
public boolean isSaveAsAllowed()
public boolean isSaveOnCloseNeeded()
public void addPropertyListener(IPropertyListener listener)
The property ids are defined in IWorkbenchPartConstants.
public void dispose()
This is the last method called on the IWorkbenchPart. At this point the part controls (if they were ever created) have been disposed as part of an SWT composite. There is no guarantee that createPartControl() has been called, so the part controls may never have been created.
Within this method a part may release any resources, fonts, images, etc. held by this part. It is also very important to deregister all listeners from the workbench.
Clients should not call this method (the workbench calls this method at appropriate times).
public IWorkbenchPartSite getSite()
public String getTitleToolTip()
The tool tip text is used to populate the title bar of this part's visual container.
public void removePropertyListener(IPropertyListener listener)
public void setFocus()
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.
public Object getAdapter(Class adapter)
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.