|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ui.internal.InternalSaveable
org.eclipse.ui.Saveable
org.eclipse.ui.texteditor.AbstractTextEditor.TextEditorSavable
protected static class AbstractTextEditor.TextEditorSavable
This text editor's savable.
| Constructor Summary | |
|---|---|
AbstractTextEditor.TextEditorSavable(ITextEditor textEditor)
Creates a new savable for this text editor. |
|
| Method Summary | |
|---|---|
void |
disconnectEditor()
Disconnects the editor from this savable. |
void |
doSave(IProgressMonitor monitor)
Saves the contents of this saveable. |
boolean |
equals(java.lang.Object obj)
Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode(). |
java.lang.Object |
getAdapter(java.lang.Class adapter)
Explicit comment needed to suppress wrong warning caused by http://bugs.sun.com/bugdatabase/view_bug.do? |
ImageDescriptor |
getImageDescriptor()
Returns the image descriptor for this saveable. |
java.lang.String |
getName()
Returns the name of this saveable for display purposes. |
java.lang.String |
getToolTipText()
Returns the tool tip text for this saveable. |
int |
hashCode()
Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode(). |
boolean |
isDirty()
Returns whether the contents of this saveable have changed since the last save operation. |
boolean |
supportsBackgroundSave()
|
| Methods inherited from class org.eclipse.ui.Saveable |
|---|
disableUI, doSave, enableUI, show |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTextEditor.TextEditorSavable(ITextEditor textEditor)
textEditor - the text editor| Method Detail |
|---|
public void disconnectEditor()
public java.lang.String getName()
Saveable
getName in class Saveablenull.public java.lang.String getToolTipText()
Saveable
getToolTipText in class Saveablenullpublic ImageDescriptor getImageDescriptor()
Saveable
getImageDescriptor in class Saveablenull
if there is no image
public void doSave(IProgressMonitor monitor)
throws CoreException
Saveable
If the save is cancelled through user action, or for any other reason,
the part should invoke setCancelled on the
IProgressMonitor to inform the caller.
This method is long-running; progress and cancellation are provided by the given progress monitor.
doSave in class Saveablemonitor - the progress monitor
CoreException - if the save fails; it is the caller's responsibility to
report the failure to the userpublic boolean isDirty()
SaveableNote: this method is called frequently, for example by actions to determine their enabled status.
isDirty in class Saveabletrue if the contents have been modified and need
saving, and false if they have not changed since
the last savepublic boolean supportsBackgroundSave()
public int hashCode()
SaveableObject.equals(Object) and Object.hashCode(). Two
saveables should be equal if their dirty state is shared, and saving one
will save the other. If two saveables are equal, their hash codes MUST be
the same, and their names, tooltips, and images should be the same
because only one of them will be shown when prompting the user to save.
IMPORTANT: Implementers should ensure that the hashCode returned is sufficiently unique so as not to collide with hashCodes returned by other implementations. It is suggested that the defining plug-in's ID be used as part of the returned hashCode, as in the following example:
int PRIME = 31;
int hash = ...; // compute the "normal" hash code, e.g. based on some identifier unique within the defining plug-in
return hash * PRIME + MY_PLUGIN_ID.hashCode();
hashCode in class Saveablepublic boolean equals(java.lang.Object obj)
SaveableObject.equals(Object) and Object.hashCode(). Two
saveables should be equal if their dirty state is shared, and saving one
will save the other. If two saveables are equal, their names, tooltips,
and images should be the same because only one of them will be shown when
prompting the user to save.
equals in class Saveablepublic java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter in interface IAdaptablegetAdapter in class Saveableadapter - the adapter class to look up
null if this object does not
have an adapter for the given classSaveable.getAdapter(java.lang.Class)
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.