Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » [JEM] EMF Workbench
[JEM] EMF Workbench [message #605778] Wed, 09 March 2005 11:19
Daniel Rohe is currently offline Daniel RoheFriend
Messages: 63
Registered: July 2009
Member
In the EMF Workbench (plugin org.eclipse.jem.util) a synchronizer
(org.eclipse.jem.util.emf.workbench.ResourceSetWorkbenchSync hronizer) is
used to react on project changes. Extensions could be added to the
synchronizer programmatically. This extensions then are informed about
changes to the project which is synchronized with the ResourceSet of the
project. Currently the synchronizer only supports notification for project
closing. Notification for changes in a project (moving, creating, deleting,
changing of files) is also provided but never gets called by the
synchronizer.
Isn't it better to also inform extenders about changes in the project, so
they can react on that and for example reload the changed resource in the
ResourceSet?

Code snippet from ResourceSetWorkbenchSynchronizer containing the required
changes.
/*
* @see IResourceChangeListener#resourceChanged(IResourceChangeEvent )
*/
public void resourceChanged(IResourceChangeEvent event) {
currentEventType = event.getType();
currentProjectDelta = null;
if ((currentEventType == IResourceChangeEvent.PRE_CLOSE ||
currentEventType == IResourceChangeEvent.PRE_DELETE)
&& event.getResource().equals(getProject())) {
release();
notifyExtendersOfClose();
} else if (currentEventType == IResourceChangeEvent.POST_CHANGE) {
IResource resource = currentProjectDelta.getResource();

if (resource.getType() == IResource.ROOT) {
IResourceDelta[] projectDelta =
currentProjectDelta.getAffectedChildren();
for (int i = 0; i < projectDelta.length; i++) {
IResource res = projectDelta[i].getResource();
if (resource.getType() == IResource.PROJECT &&
resource.equals(getProject())) {
currentProjectDelta = projectDelta[i];
notifyExtendersIfNecessary();
} else {
currentProjectDelta = null;
}
}

} else if (resource.getType() == IResource.PROJECT) {
if (resource.equals(getProject())) {
notifyExtendersIfNecessary();
}
}
}
currentProjectDelta = null;
}

Greetings
Daniel
Previous Topic:[JEM] EMF Workbench
Next Topic:Download of org.eclipse.ve.examples only via CVS ?
Goto Forum:
  


Current Time: Tue Apr 23 10:58:48 GMT 2024

Powered by FUDForum. Page generated in 0.03275 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top