Package org.eclipse.pde.core
Interface IModel
- 
- All Superinterfaces:
- IAdaptable,- IBaseModel
 - All Known Subinterfaces:
- IBuildModel,- IExtensionsModel,- IFragmentModel,- IPluginModel,- IPluginModelBase,- ISharedExtensionsModel,- ISharedPluginModel
 
 public interface IModel extends IBaseModel A generic model. Classes that implement this interface are expected to be able to:- Load from an input stream
- Reload (reset, load, fire 'world change')
- Dispose (clear all the data and reset)
- Be associated with a resource (optional)
 - Since:
- 2.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetResourceString(String key)Returns a string found in the resource bundle associated with this model for the provided key.longgetTimeStamp()Returns the last modification time stamp.IResourcegetUnderlyingResource()Returns a workspace resource that this model is created from.booleanisInSync()Tests if this model is in sync with the storage object it was loaded from.booleanisLoaded()Tests if this model is loaded and can be used.booleanisReconcilingModel()Returns whether this model needs to react to changes in source and reconcile them.voidload()Loads the model directly from an underlying resource.voidload(InputStream source, boolean outOfSync)Loads the model from the provided input stream.voidreload(InputStream source, boolean outOfSync)Reload is a version of 'load' operation that has the following steps: Reset the model Load the model Fire "world changed" event Reload operation is used when a model that is already in use is invalidated by a change in the underlying buffer or resource.- 
Methods inherited from interface org.eclipse.core.runtime.IAdaptablegetAdapter
 - 
Methods inherited from interface org.eclipse.pde.core.IBaseModeldispose, isDisposed, isEditable, isValid
 
- 
 
- 
- 
- 
Method Detail- 
getResourceStringString getResourceString(String key) Returns a string found in the resource bundle associated with this model for the provided key.- Parameters:
- key- the name to use for bundle lookup
- Returns:
- the string for the key in the resource bundle, or the key itself if not found
 
 - 
getUnderlyingResourceIResource getUnderlyingResource() Returns a workspace resource that this model is created from. Load/reload operations are not directly connected with the resource (although they can be). In some cases, models will load from a buffer (an editor document) rather than a resource. However, the buffer will eventually be synced up with this resource.With the caveat of stepped loading, all other properties of the underlying resource could be used directly (path, project etc.). - Returns:
- a workspace resource (file) that this model is associated with, or null if the model is not created from a resource.
 
 - 
isLoadedboolean isLoaded() Tests if this model is loaded and can be used.- Returns:
- trueif the model has been loaded
 
 - 
isInSyncboolean isInSync() Tests if this model is in sync with the storage object it was loaded from. Models loaded from resources are in sync if underlying resources are in sync. Models loaded from files on the file systems are in sync if the time stamp matches the model time stamp.- Returns:
- trueif the model is in sync with the file system.
 
 - 
getTimeStamplong getTimeStamp() Returns the last modification time stamp. The model itself does not have the time stamp. It is 'borrowed' from the underlying physical object.- Returns:
- the time stamp of the underlying physical object.
 
 - 
loadvoid load() throws CoreException Loads the model directly from an underlying resource. This method does nothing if this model has no underlying resource or if there is a buffer stage between the model and the resource.- Throws:
- CoreException- if errors are encountered during the loading.
 
 - 
loadvoid load(InputStream source, boolean outOfSync) throws CoreException Loads the model from the provided input stream. This method throws a CoreException if errors are encountered during the loading. Upon succesful load, 'isLoaded()' should return true .- Parameters:
- source- an input stream that should be parsed to load the model
- outOfSync- if true, time stamp will not be updated to maintain out-of-sync state of the model.
- Throws:
- CoreException- if errors are encountered during the loading.
 
 - 
reloadvoid reload(InputStream source, boolean outOfSync) throws CoreException Reload is a version of 'load' operation that has the following steps:- Reset the model
- Load the model
- Fire "world changed" event
 - Parameters:
- source- an input stream that should be parsed to load the model.
- outOfSync- if true, the timestamp will not be updated to maintain out-of-sync state of the model.
- Throws:
- CoreException- if errors are encountered during the reloading.
 
 - 
isReconcilingModelboolean isReconcilingModel() Returns whether this model needs to react to changes in source and reconcile them. Only model instances used in editors need to perform this task.- Returns:
- trueif this is a reconciling model,- falseotherwise.
 
 
- 
 
-