Class ModuleModelProvider
- All Implemented Interfaces:
IAdaptable
Every Close Project and Close Unrelated Projects of Eclipse is one class, CloseResourceAction: the Package Explorer's and the other Java views' (JDT makes its own), the Java editor's breadcrumb, a middle click on a project in the Project Explorer. iiziGo cannot stand in for those actions as it does in the IIZI Explorer (com.iizigo.navigator.CloseProjectActionProvider). But each of them asks Eclipse's change validation before it closes anything - CloseResourceAction.validateClose, in the SWT thread -, and the validation asks the model providers of the projects. So the question is asked here: the workbench's "Save Resources" prompt with every changed file of the Module projects that are about to be closed, with or without an editor (UnsavedFiles.askBeforeClose(IResource[])). Saved, or not saved by the user's choice, the close goes on. Canceled, the answer is a status that names the files: Eclipse then asks whether to continue, and No keeps the projects open.
A proposed close is told as a removal of the project that carries the flag OPEN; a Delete and a rename are not answered here (they have their participants, ModuleProjectDeleteParticipant and ModuleProjectRenameParticipant). A project that iiziGo's own Close Project has asked for in the same run is not asked for again.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe identity of the model provider, as plugin.xml declares it.Fields inherited from class ModelProvider
RESOURCE_MODEL_PROVIDER_IDConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvalidateChange(IResourceDelta delta, IProgressMonitor monitor) Validates a proposed change: for a close of Module projects that hold changed files, asks which files are saved.Methods inherited from class ModelProvider
equals, getDescriptor, getId, getMappings, getMappings, getMappings, getModelProviderDescriptor, getModelProviderDescriptors, getTraversals, hashCode, init, initializeMethods inherited from class PlatformObject
getAdapter
Field Details
ID
The identity of the model provider, as plugin.xml declares it.- See Also:
Constructor Details
ModuleModelProvider
public ModuleModelProvider()
Method Details
validateChange
Validates a proposed change: for a close of Module projects that hold changed files, asks which files are saved.- Overrides:
validateChangein classModelProvider- Parameters:
delta- The proposed change.monitor- The progress monitor.- Returns:
- OK when nothing of a Module project would be lost or the user chose; otherwise a warning that names the changed files.