Class SaveablePartAdapter
- All Implemented Interfaces:
IAdaptable
,ISaveableWorkbenchPart
,ISaveablePart
,IWorkbenchPart
- Direct Known Subclasses:
PageSaveablePart
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.
- Since:
- 3.0
- See Also:
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyListener
(IPropertyListener listener) Deprecated.Adds a listener for changes to properties of this workbench part.void
dispose()
Deprecated.Disposes of this workbench part.void
doSaveAs()
Deprecated.Saves the contents of this part to another object.<T> T
getAdapter
(Class<T> adapter) Deprecated.Returns an object which is an instance of the given class associated with this object.getSite()
Deprecated.Returns the site for this workbench part.Deprecated.Returns the title tool tip text of this workbench part.boolean
Deprecated.Returns whether the "Save As" operation is supported by this part.boolean
Deprecated.Returns whether the contents of this part should be saved when the part is closed.void
removePropertyListener
(IPropertyListener listener) Deprecated.Removes the given property listener from this workbench part.void
setFocus()
Deprecated.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 Details
-
SaveablePartAdapter
public SaveablePartAdapter()Deprecated.
-
-
Method Details
-
doSaveAs
public void doSaveAs()Deprecated.Description copied from interface:ISaveablePart
Saves the contents of this part to another object.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).- Specified by:
doSaveAs
in interfaceISaveablePart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()Deprecated.Description copied from interface:ISaveablePart
Returns whether the "Save As" operation is supported by this part.- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Returns:
true
if "Save As" is supported, andfalse
if not supported
-
isSaveOnCloseNeeded
public boolean isSaveOnCloseNeeded()Deprecated.Description copied from interface:ISaveablePart
Returns whether the contents of this part should be saved when the part is closed.- Specified by:
isSaveOnCloseNeeded
in interfaceISaveablePart
- Returns:
true
if the contents of the part should be saved on close, andfalse
if the contents are expendable
-
addPropertyListener
Deprecated.Description copied from interface:IWorkbenchPart
Adds a listener for changes to properties of this workbench part. Has no effect if an identical listener is already registered.The property ids are defined in
IWorkbenchPartConstants
.- Specified by:
addPropertyListener
in interfaceIWorkbenchPart
- Parameters:
listener
- a property listener
-
dispose
public void dispose()Deprecated.Description copied from interface:IWorkbenchPart
Disposes of this workbench part.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).
- Specified by:
dispose
in interfaceIWorkbenchPart
-
getSite
Deprecated.Description copied from interface:IWorkbenchPart
Returns the site for this workbench part. The site can benull
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.- Specified by:
getSite
in interfaceIWorkbenchPart
- Returns:
- The part site; this value may be
null
if the part has not yet been initialized
-
getTitleToolTip
Deprecated.Description copied from interface:IWorkbenchPart
Returns the title tool tip text of this workbench part. An empty string result indicates no tool tip. If this value changes the part must fire a property listener event withPROP_TITLE
.The tool tip text is used to populate the title bar of this part's visual container.
- Specified by:
getTitleToolTip
in interfaceIWorkbenchPart
- Returns:
- the workbench part title tool tip (not
null
)
-
removePropertyListener
Deprecated.Description copied from interface:IWorkbenchPart
Removes the given property listener from this workbench part. Has no effect if an identical listener is not registered.- Specified by:
removePropertyListener
in interfaceIWorkbenchPart
- Parameters:
listener
- a property listener
-
setFocus
public void setFocus()Deprecated.Description copied from interface:IWorkbenchPart
Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.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
.- Specified by:
setFocus
in interfaceIWorkbenchPart
-
getAdapter
Deprecated.Description copied from interface:IAdaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
if no such object can be found.Clients may implement this method but should generally call
Adapters.adapt(Object, Class, boolean)
rather than invoking it directly.- Specified by:
getAdapter
in interfaceIAdaptable
- Type Parameters:
T
- the class type- Parameters:
adapter
- the adapter class to look up- Returns:
- a object of the given class, or
null
if this object does not have an adapter for the given class
-
CompareEditorInput
andCompareUI.openCompareDialog(org.eclipse.compare.CompareEditorInput)