org.eclipse.gmf.runtime.diagram.ui.resources.editor.document
Class AbstractDocumentProvider
java.lang.Object
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider
-
All Implemented Interfaces:
-
IDocumentProvider
-
Direct Known Subclasses:
-
DiagramInputDocumentProvider,
StorageDocumentProvider
-
public abstract class AbstractDocumentProvider
- extends java.lang.Object
- implements
IDocumentProvider
An abstract implementation of a sharable document provider.
Subclasses must implement
createDocument
,
createEmptyDocument
,
getOperationRunner
, and doSaveDocument
.
Method Summary
|
void
|
aboutToChange
(java.lang.Object element)
The AbstractDocumentProvider implementation of this
IDocumentProvider method does nothing. |
void
|
addElementStateListener
(
IElementStateListener listener)
Adds the given element state listener to this document provider. |
protected void
|
addUnchangedElementListeners
(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
Called on initial creation and when the dirty state of the element
changes to false . |
boolean
|
canSaveDocument
(java.lang.Object element)
Returns whether the document provided for the given element differs from
its original state which would required that it be saved. |
void
|
changed
(java.lang.Object element)
The AbstractDocumentProvider implementation of this
IDocumentProvider method does nothing. |
void
|
connect
(java.lang.Object element)
Connects the given element to this document provider. |
protected void
|
connected
()
This hook method is called when this provider starts managing documents for
elements. |
protected abstract
IDocument
|
createDocument
(java.lang.Object element)
Creates the document for the given element. |
protected
AbstractDocumentProvider.ElementInfo
|
createElementInfo
(java.lang.Object element)
Creates a new element info object for the given element. |
protected abstract
IDocument
|
createEmptyDocument
()
Creates the document for the given element. |
void
|
disconnect
(java.lang.Object element)
Disconnects the given element from this document provider. |
protected void
|
disconnected
()
This hook method is called when this provider stops managing documents for
element. |
protected void
|
disposeElementInfo
(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
Disposes of the given element info object. |
protected void
|
doResetDocument
(java.lang.Object element,
IProgressMonitor monitor)
Executes the actual work of reseting the given elements document. |
protected abstract void
|
doSaveDocument
(
IProgressMonitor monitor,
java.lang.Object element,
IDocument document,
boolean overwrite)
Performs the actual work of saving the given document provided for the
given element. |
protected void
|
doSynchronize
(java.lang.Object element,
IProgressMonitor monitor)
Performs the actual work of synchronizing the given element. |
protected void
|
doUpdateStateCache
(java.lang.Object element)
Hook method for updating the state of the given element. |
protected void
|
doValidateState
(java.lang.Object element,
java.lang.Object computationContext)
Hook method for validating the state of the given element. |
protected void
|
executeOperation
(
AbstractDocumentProvider.DocumentProviderOperation operation,
IProgressMonitor monitor)
Executes the given operation in the providers runnable context. |
protected void
|
fireElementContentAboutToBeReplaced
(java.lang.Object element)
Informs all registered element state listeners about an impending
replace of the given element's content. |
protected void
|
fireElementContentReplaced
(java.lang.Object element)
Informs all registered element state listeners about the just-completed
replace of the given element's content. |
protected void
|
fireElementDeleted
(java.lang.Object element)
Informs all registered element state listeners about the deletion
of the given element. |
protected void
|
fireElementDirtyStateChanged
(java.lang.Object element,
boolean isDirty)
Informs all registered element state listeners about a change in the
dirty state of the given element. |
protected void
|
fireElementMoved
(java.lang.Object originalElement,
java.lang.Object movedElement)
Informs all registered element state listeners about a move. |
protected void
|
fireElementStateChangeFailed
(java.lang.Object element)
Informs all registered element state listeners about the failed
state change of the element |
protected void
|
fireElementStateChanging
(java.lang.Object element)
Informs all registered element state listeners about the current state
change of the element |
protected void
|
fireElementStateValidationChanged
(java.lang.Object element,
boolean isStateValidated)
Informs all registered element state listeners about a change in the
state validation of the given element. |
protected java.util.Iterator
|
getConnectedElements
()
Enumerates the elements connected via this document provider. |
IDocument
|
getDocument
(java.lang.Object element)
Returns the document for the given element. |
protected
AbstractDocumentProvider.ElementInfo
|
getElementInfo
(java.lang.Object element)
Returns the element info object for the given element. |
long
|
getModificationStamp
(java.lang.Object element)
Returns the modification stamp of the given element. |
protected abstract
IRunnableContext
|
getOperationRunner
(
IProgressMonitor monitor)
Returns the runnable context for this document provider. |
IProgressMonitor
|
getProgressMonitor
()
Returns this providers progress monitor. |
AbstractDocumentProvider.DocumentProviderOperation
|
getResetOperation
(java.lang.Object element)
|
protected
ISchedulingRule
|
getResetRule
(java.lang.Object element)
Returns the scheduling rule required for executing
reset on the given element. |
AbstractDocumentProvider.DocumentProviderOperation
|
getSaveOperation
(java.lang.Object element,
IDocument document,
boolean overwrite)
|
protected
ISchedulingRule
|
getSaveRule
(java.lang.Object element)
Returns the scheduling rule required for executing
save on the given element. |
IStatus
|
getStatus
(java.lang.Object element)
Returns the status of the given element. |
long
|
getSynchronizationStamp
(java.lang.Object element)
Returns the time stamp of the last synchronization of
the given element and it's provided document. |
protected
ISchedulingRule
|
getSynchronizeRule
(java.lang.Object element)
Returns the scheduling rule required for executing
synchronize on the given element. |
protected
ISchedulingRule
|
getValidateStateRule
(java.lang.Object element)
Returns the scheduling rule required for executing
validateState on the given element. |
protected boolean
|
invalidatesState
(java.lang.Object element,
boolean wasReadOnly)
Returns whether the state of the element must be invalidated given its
previous read-only state. |
boolean
|
isDeleted
(java.lang.Object element)
Returns whether the given element has been deleted. |
boolean
|
isModifiable
(java.lang.Object element)
Returns whether the document provider thinks that the given element can persistently be modified. |
boolean
|
isReadOnly
(java.lang.Object element)
Returns whether the document provider thinks that the given element is read-only. |
boolean
|
isStateValidated
(java.lang.Object element)
Returns whether validateState has been called for the given element
since the element's state has potentially been invalidated. |
boolean
|
isSynchronized
(java.lang.Object element)
Returns whether the information provided for the given element is in sync with the element. |
boolean
|
mustSaveDocument
(java.lang.Object element)
Returns whether the document provided for the given element must be saved. |
void
|
removeElementStateListener
(
IElementStateListener listener)
Removes the given element state listener from this document provider. |
protected void
|
removeUnchangedElementListeners
(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
Called when the given element gets dirty. |
void
|
resetDocument
(java.lang.Object element)
Resets the given element's document to its last saved state. |
void
|
saveDocument
(
IProgressMonitor monitor,
java.lang.Object element,
IDocument document,
boolean overwrite)
Saves the given document provided for the given element. |
void
|
setCanSaveDocument
(java.lang.Object element)
Marks the document managed for the given element as saveable. |
void
|
setProgressMonitor
(
IProgressMonitor progressMonitor)
Sets this providers progress monitor. |
void
|
synchronize
(java.lang.Object element)
Synchronizes the document provided for the given element with the
given element. |
void
|
updateStateCache
(java.lang.Object element)
Updates the state cache for the given element. |
void
|
validateState
(java.lang.Object element,
java.lang.Object computationContext)
Validates the state of the given element. |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
PR10806_UC5_ENABLED
protected static final boolean PR10806_UC5_ENABLED
- Enables a certain behavior.
Indicates whether this provider should behave as described in
use case 5 of https://bugs.eclipse.org/bugs/show_bug.cgi?id=10806.
Current value:
true
since 3.0
-
See Also:
-
Constant Field Values
PR14469_ENABLED
protected static final boolean PR14469_ENABLED
- Enables a certain behavior.
Indicates whether this provider should behave as described in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=14469
Notes: This contradicts
PR10806_UC5_ENABLED
.
Current value: false
since 3.0
-
See Also:
-
Constant Field Values
STATUS_OK
public static final
IStatus STATUS_OK
- Constant for representing the OK status. This is considered a value object.
STATUS_ERROR
public static final
IStatus STATUS_ERROR
- Constant for representing the error status. This is considered a value object.
AbstractDocumentProvider
protected AbstractDocumentProvider()
- Creates a new document provider.
createDocument
protected abstract
IDocument createDocument(java.lang.Object element)
throws
CoreException
- Creates the document for the given element.
Subclasses must implement this method.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the document
-
Throws:
-
CoreException
- if the document could not be created
createEmptyDocument
protected abstract
IDocument createEmptyDocument()
- Creates the document for the given element.
Subclasses must implement this method.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the document
-
Throws:
-
CoreException
- if the document could not be created
doSaveDocument
protected abstract void doSaveDocument(
IProgressMonitor monitor,
java.lang.Object element,
IDocument document,
boolean overwrite)
throws
CoreException
- Performs the actual work of saving the given document provided for the
given element.
Subclasses must implement this method.
-
-
-
Parameters:
-
monitor
- a progress monitor to report progress and request cancellation -
element
- the element -
document
- the document -
overwrite
- indicates whether an overwrite should happen if necessary
-
Throws:
-
CoreException
- if document could not be stored to the given element
getOperationRunner
protected abstract
IRunnableContext getOperationRunner(
IProgressMonitor monitor)
- Returns the runnable context for this document provider.
-
-
-
Parameters:
-
monitor
- a progress monitor to track the operation
-
Returns:
- the runnable context for this document provider
getSynchronizeRule
protected
ISchedulingRule getSynchronizeRule(java.lang.Object element)
- Returns the scheduling rule required for executing
synchronize
on the given element. This default
implementation returns null
.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the scheduling rule for
synchronize
getValidateStateRule
protected
ISchedulingRule getValidateStateRule(java.lang.Object element)
- Returns the scheduling rule required for executing
validateState
on the given element. This default
implementation returns null
.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the scheduling rule for
validateState
getSaveRule
protected
ISchedulingRule getSaveRule(java.lang.Object element)
- Returns the scheduling rule required for executing
save
on the given element. This default
implementation returns null
.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the scheduling rule for
save
getResetRule
protected
ISchedulingRule getResetRule(java.lang.Object element)
- Returns the scheduling rule required for executing
reset
on the given element. This default
implementation returns null
.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the scheduling rule for
reset
getElementInfo
protected
AbstractDocumentProvider.ElementInfo getElementInfo(java.lang.Object element)
- Returns the element info object for the given element.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- the element info object, or
null
if none
createElementInfo
protected
AbstractDocumentProvider.ElementInfo createElementInfo(java.lang.Object element)
throws
CoreException
- Creates a new element info object for the given element.
This method is called from connect
when an element info needs
to be created. The AbstractDocumentProvider
implementation
of this method returns a new element info object whose document and
annotation model are the values of createDocument(element)
and createAnnotationModel(element)
, respectively. Subclasses
may override.
-
-
-
Parameters:
-
element
- the element
-
Returns:
- a new element info object
-
Throws:
-
CoreException
- if the document or annotation model could not be created
disposeElementInfo
protected void disposeElementInfo(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
- Disposes of the given element info object.
This method is called when an element info is disposed. The
AbstractDocumentProvider
implementation of this
method does nothing. Subclasses may reimplement.
-
-
-
Parameters:
-
element
- the element -
info
- the element info object
addUnchangedElementListeners
protected void addUnchangedElementListeners(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
- Called on initial creation and when the dirty state of the element
changes to
false
. Adds all listeners which must be
active as long as the element is not dirty. This method is called
before fireElementDirtyStateChanged
or
fireElementContentReplaced
is called.
Subclasses may extend.
-
-
-
Parameters:
-
element
- the element -
info
- the element info object
removeUnchangedElementListeners
protected void removeUnchangedElementListeners(java.lang.Object element,
AbstractDocumentProvider.ElementInfo info)
- Called when the given element gets dirty. Removes all listeners
which must be active only when the element is not dirty. This
method is called before
fireElementDirtyStateChanged
or fireElementContentReplaced
is called.
Subclasses may extend.
-
-
-
Parameters:
-
element
- the element -
info
- the element info object
getConnectedElements
protected java.util.Iterator getConnectedElements()
- Enumerates the elements connected via this document provider.
-
-
-
Returns:
- the list of elements (element type:
Object
)
connect
public final void connect(java.lang.Object element)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Connects the given element to this document provider. This tells the provider
that caller of this method is interested to work with the document provided for
the given domain model element. By counting the invocations of this method and
disconnect(Object)
this provider can assume to know the
correct number of clients working with the document provided for that
domain model element.
The given element must not be null
.
-
-
Specified by:
-
connect
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Throws:
-
CoreException
- if the document representation could not be created
connected
protected void connected()
- This hook method is called when this provider starts managing documents for
elements. I.e. it is called when the first element gets connected to this provider.
Subclasses may extend.
-
-
disconnect
public final void disconnect(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Disconnects the given element from this document provider. This tells the provider
that the caller of this method is no longer interested in working with the document
provided for the given domain model element. By counting the invocations of
connect(Object)
and of this method this provider can assume to
know the correct number of clients working with the document provided for that
domain model element.
The given element must not be null
.
-
-
Specified by:
-
disconnect
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
disconnected
protected void disconnected()
- This hook method is called when this provider stops managing documents for
element. I.e. it is called when the last element gets disconnected from this provider.
Subclasses may extend.
-
-
getDocument
public
IDocument getDocument(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns the document for the given element. Usually the document contains
a content presentation of the content of the element, or is the element itself.
-
-
Specified by:
-
getDocument
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element, or null
-
Returns:
- the document, or
null
if none
mustSaveDocument
public boolean mustSaveDocument(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the document provided for the given element must be saved.
-
-
Specified by:
-
mustSaveDocument
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element, or null
-
Returns:
-
true
if the document must be saved, and
false
otherwise (including the element is null
)
canSaveDocument
public boolean canSaveDocument(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the document provided for the given element differs from
its original state which would required that it be saved.
-
-
Specified by:
-
canSaveDocument
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element, or null
-
Returns:
-
true
if the document can be saved, and
false
otherwise (including the element is null
)
doResetDocument
protected void doResetDocument(java.lang.Object element,
IProgressMonitor monitor)
throws
CoreException
- Executes the actual work of reseting the given elements document.
-
-
-
Parameters:
-
element
- the element -
monitor
- the progress monitor
-
Throws:
-
CoreException
executeOperation
protected void executeOperation(
AbstractDocumentProvider.DocumentProviderOperation operation,
IProgressMonitor monitor)
throws
CoreException
- Executes the given operation in the providers runnable context.
-
-
-
Parameters:
-
operation
- the operation to be executes -
monitor
- the progress monitor
-
Throws:
-
CoreException
- the operation's core exception
resetDocument
public final void resetDocument(java.lang.Object element)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Resets the given element's document to its last saved state.
Element state listeners are notified both before (
elementContentAboutToBeReplaced
)
and after (elementContentReplaced
) the content is changed.
-
-
Specified by:
-
resetDocument
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element, or null
-
Throws:
-
CoreException
- if document could not be reset for the given element
getResetOperation
public
AbstractDocumentProvider.DocumentProviderOperation getResetOperation(java.lang.Object element)
-
-
saveDocument
public final void saveDocument(
IProgressMonitor monitor,
java.lang.Object element,
IDocument document,
boolean overwrite)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Saves the given document provided for the given element.
-
-
Specified by:
-
saveDocument
in interface
IDocumentProvider
-
-
Parameters:
-
monitor
- a progress monitor to report progress and request cancellation -
element
- the element, or null
-
document
- the document -
overwrite
- indicates whether overwrite should be performed
while saving the given element if necessary
-
Throws:
-
CoreException
- if document could not be stored to the given element
getSaveOperation
public
AbstractDocumentProvider.DocumentProviderOperation getSaveOperation(java.lang.Object element,
IDocument document,
boolean overwrite)
-
-
aboutToChange
public void aboutToChange(java.lang.Object element)
- The
AbstractDocumentProvider
implementation of this
IDocumentProvider
method does nothing. Subclasses may
reimplement.
-
-
Specified by:
-
aboutToChange
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
changed
public void changed(java.lang.Object element)
- The
AbstractDocumentProvider
implementation of this
IDocumentProvider
method does nothing. Subclasses may
reimplement.
-
-
Specified by:
-
changed
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
addElementStateListener
public void addElementStateListener(
IElementStateListener listener)
-
Description copied from interface:
IDocumentProvider
- Adds the given element state listener to this document provider.
Has no effect if an identical listener is already registered.
-
-
Specified by:
-
addElementStateListener
in interface
IDocumentProvider
-
-
Parameters:
-
listener
- the listener
removeElementStateListener
public void removeElementStateListener(
IElementStateListener listener)
-
Description copied from interface:
IDocumentProvider
- Removes the given element state listener from this document provider.
Has no affect if an identical listener is not registered.
-
-
Specified by:
-
removeElementStateListener
in interface
IDocumentProvider
-
-
Parameters:
-
listener
- the listener
fireElementDirtyStateChanged
protected void fireElementDirtyStateChanged(java.lang.Object element,
boolean isDirty)
- Informs all registered element state listeners about a change in the
dirty state of the given element.
-
-
-
Parameters:
-
element
- the element -
isDirty
- the new dirty state -
See Also:
-
IElementStateListener.elementDirtyStateChanged(Object, boolean)
fireElementContentAboutToBeReplaced
protected void fireElementContentAboutToBeReplaced(java.lang.Object element)
- Informs all registered element state listeners about an impending
replace of the given element's content.
-
-
-
Parameters:
-
element
- the element -
See Also:
-
IElementStateListener.elementContentAboutToBeReplaced(Object)
fireElementContentReplaced
protected void fireElementContentReplaced(java.lang.Object element)
- Informs all registered element state listeners about the just-completed
replace of the given element's content.
-
-
-
Parameters:
-
element
- the element -
See Also:
-
IElementStateListener.elementContentReplaced(Object)
fireElementDeleted
protected void fireElementDeleted(java.lang.Object element)
- Informs all registered element state listeners about the deletion
of the given element.
-
-
-
Parameters:
-
element
- the element -
See Also:
-
IElementStateListener.elementDeleted(Object)
fireElementMoved
protected void fireElementMoved(java.lang.Object originalElement,
java.lang.Object movedElement)
- Informs all registered element state listeners about a move.
-
-
-
Parameters:
-
originalElement
- the element before the move -
movedElement
- the element after the move -
See Also:
-
IElementStateListener.elementMoved(Object, Object)
getModificationStamp
public long getModificationStamp(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns the modification stamp of the given element.
-
-
Specified by:
-
getModificationStamp
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
- the modification stamp of the given element
getSynchronizationStamp
public long getSynchronizationStamp(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns the time stamp of the last synchronization of
the given element and it's provided document.
-
-
Specified by:
-
getSynchronizationStamp
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
- the synchronization stamp of the given element
isDeleted
public boolean isDeleted(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the given element has been deleted.
-
-
Specified by:
-
isDeleted
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
-
true
if the element has been deleted
isReadOnly
public boolean isReadOnly(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the document provider thinks that the given element is read-only.
If this method returns
true
, saveDocument
could fail.
This method does not say anything about the document constructed from the given
element. If the given element is not connected to this document provider, the return
value is undefined. Document providers are allowed to use a cache to answer this
question, i.e. there can be a difference between the "real" state of the element and
the return value.
-
-
Specified by:
-
isReadOnly
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
-
true
if the given element is read-only, false
otherwise
isModifiable
public boolean isModifiable(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the document provider thinks that the given element can persistently be modified.
This is orthogonal to
isReadOnly
as read-only elements may be modifiable and
writable elements may not be modifiable. If the given element is not connected to this document
provider, the result is undefined. Document providers are allowed to use a cache to answer this
question, i.e. there can be a difference between the "real" state of the element and the return
value.
-
-
Specified by:
-
isModifiable
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
-
true
if the given element is modifiable, false
otherwise
isStateValidated
public boolean isStateValidated(java.lang.Object element)
- Returns whether
validateState
has been called for the given element
since the element's state has potentially been invalidated.
-
-
Specified by:
-
isStateValidated
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
- whether
validateState
has been called for the given element
doValidateState
protected void doValidateState(java.lang.Object element,
java.lang.Object computationContext)
throws
CoreException
- Hook method for validating the state of the given element. Must not take care of cache updating etc.
Default implementation is empty.
-
-
-
Parameters:
-
element
- the element -
computationContext
- the context in which validation happens
-
Throws:
-
CoreException
- in case validation fails
validateState
public void validateState(java.lang.Object element,
java.lang.Object computationContext)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Validates the state of the given element. This method may change the "real" state of the
element. If using, it also updates the internal caches, so that this method may also change
the results returned by
isReadOnly
and isModifiable
. If the
given element is not connected to this document provider, the effect is undefined.
-
-
Specified by:
-
validateState
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element -
computationContext
- the context in which the computation is performed, e.g., a SWT shell
-
Throws:
-
CoreException
- if validating fails
doUpdateStateCache
protected void doUpdateStateCache(java.lang.Object element)
throws
CoreException
- Hook method for updating the state of the given element.
Default implementation is empty.
-
-
-
Parameters:
-
element
- the element
-
Throws:
-
CoreException
- in case state cache updating fails
invalidatesState
protected boolean invalidatesState(java.lang.Object element,
boolean wasReadOnly)
- Returns whether the state of the element must be invalidated given its
previous read-only state.
-
-
-
Parameters:
-
element
- the element -
wasReadOnly
- the previous read-only state
-
Returns:
-
true
if the state of the given element must be invalidated
updateStateCache
public final void updateStateCache(java.lang.Object element)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Updates the state cache for the given element. This method may change the result returned
by
isReadOnly
and isModifiable
. If the given element is not
connected to this document provider, the effect is undefined.
-
-
Specified by:
-
updateStateCache
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Throws:
-
CoreException
- if validating fails
setCanSaveDocument
public void setCanSaveDocument(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Marks the document managed for the given element as saveable. I.e.
canBeSaved(element)
will return true
afterwards.
-
-
Specified by:
-
setCanSaveDocument
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
fireElementStateValidationChanged
protected void fireElementStateValidationChanged(java.lang.Object element,
boolean isStateValidated)
- Informs all registered element state listeners about a change in the
state validation of the given element.
-
-
-
Parameters:
-
element
- the element -
isStateValidated
- -
See Also:
-
IElementStateListenerExtension#elementStateValidationChanged(Object, boolean)
fireElementStateChanging
protected void fireElementStateChanging(java.lang.Object element)
- Informs all registered element state listeners about the current state
change of the element
-
-
-
Parameters:
-
element
- the element -
See Also:
-
IElementStateListenerExtension#elementStateChanging(Object)
fireElementStateChangeFailed
protected void fireElementStateChangeFailed(java.lang.Object element)
- Informs all registered element state listeners about the failed
state change of the element
-
-
-
Parameters:
-
element
- the element -
See Also:
-
IElementStateListenerExtension#elementStateChangeFailed(Object)
getStatus
public
IStatus getStatus(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns the status of the given element.
-
-
Specified by:
-
getStatus
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
- the status of the given element
doSynchronize
protected void doSynchronize(java.lang.Object element,
IProgressMonitor monitor)
throws
CoreException
- Performs the actual work of synchronizing the given element.
-
-
-
Parameters:
-
element
- the element -
monitor
- the progress monitor
-
Throws:
-
CoreException
- in the case that synchronization fails
synchronize
public final void synchronize(java.lang.Object element)
throws
CoreException
-
Description copied from interface:
IDocumentProvider
- Synchronizes the document provided for the given element with the
given element. After that call
getSynchronizationTimeStamp
and getModificationTimeStamp
return the same value.
-
-
Specified by:
-
synchronize
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Throws:
-
CoreException
- if the synchronization could not be performed
getProgressMonitor
public
IProgressMonitor getProgressMonitor()
-
Description copied from interface:
IDocumentProvider
- Returns this providers progress monitor.
-
-
Specified by:
-
getProgressMonitor
in interface
IDocumentProvider
-
-
Returns:
- IProgressMonitor
setProgressMonitor
public void setProgressMonitor(
IProgressMonitor progressMonitor)
-
Description copied from interface:
IDocumentProvider
- Sets this providers progress monitor.
-
-
Specified by:
-
setProgressMonitor
in interface
IDocumentProvider
-
isSynchronized
public boolean isSynchronized(java.lang.Object element)
-
Description copied from interface:
IDocumentProvider
- Returns whether the information provided for the given element is in sync with the element.
-
-
Specified by:
-
isSynchronized
in interface
IDocumentProvider
-
-
Parameters:
-
element
- the element
-
Returns:
-
true
if the information is in sync with the element, false
otherwise
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.