CompareEditorInput
and CompareUI.openCompareDialog(org.eclipse.compare.CompareEditorInput)
public abstract class SaveablePartAdapter extends Object implements ISaveableWorkbenchPart
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.
SaveablePartDialog
PROP_DIRTY
PROP_TITLE
Constructor and Description |
---|
SaveablePartAdapter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
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.
|
Object |
getAdapter(Class adapter)
Deprecated.
Returns an object which is an instance of the given class
associated with this object.
|
IWorkbenchPartSite |
getSite()
Deprecated.
Returns the site for this workbench part.
|
String |
getTitleToolTip()
Deprecated.
Returns the title tool tip text of this workbench part.
|
boolean |
isSaveAsAllowed()
Deprecated.
Returns whether the "Save As" operation is supported by this part.
|
boolean |
isSaveOnCloseNeeded()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doSave, isDirty
createPartControl, getTitle, getTitleImage
public void doSaveAs()
ISaveablePart
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).
doSaveAs
in interface ISaveablePart
public boolean isSaveAsAllowed()
ISaveablePart
isSaveAsAllowed
in interface ISaveablePart
true
if "Save As" is supported, and false
if not supportedpublic boolean isSaveOnCloseNeeded()
ISaveablePart
isSaveOnCloseNeeded
in interface ISaveablePart
true
if the contents of the part should be saved on
close, and false
if the contents are expendablepublic void addPropertyListener(IPropertyListener listener)
IWorkbenchPart
The property ids are defined in IWorkbenchPartConstants
.
addPropertyListener
in interface IWorkbenchPart
listener
- a property listenerpublic void dispose()
IWorkbenchPart
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).
dispose
in interface IWorkbenchPart
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 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 listener)
IWorkbenchPart
removePropertyListener
in interface IWorkbenchPart
listener
- a property listenerpublic 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 Object getAdapter(Class adapter)
IAdaptable
null
if
no such object can be found.getAdapter
in interface IAdaptable
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given class
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.