Java Code Examples for org.eclipse.core.resources.IResourceDelta#SYNC

The following examples show how to use org.eclipse.core.resources.IResourceDelta#SYNC . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResourceManager.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean visit(final IResourceDelta delta) {
	final IResource res = delta.getResource();
	boolean update = false;
	switch (delta.getKind()) {
		case IResourceDelta.OPEN:
			if (res.isAccessible()) {
				update = projectOpened((IProject) res);
			} else {
				update = projectClosed((IProject) res);
			}
			break;
		case IResourceDelta.ADDED:
			update = processAddition(res);
			break;
		case IResourceDelta.REMOVED:
			update = processRemoval(res);
			break;
		case IResourceDelta.CHANGED:
			final int flags = delta.getFlags();
			if ((flags & IResourceDelta.MARKERS) != 0) {
				update = processMarkersChanged(res);
			}
			if ((flags & IResourceDelta.TYPE) != 0) {
				if (DEBUG.IS_ON()) {
					DEBUG.OUT("Resource type changed: " + res);
				}
			}
			if ((flags & IResourceDelta.CONTENT) != 0) {
				if (DEBUG.IS_ON()) {
					DEBUG.OUT("Resource contents changed: " + res);
				}
			}
			if ((flags & IResourceDelta.SYNC) != 0) {
				if (DEBUG.IS_ON()) {
					DEBUG.OUT("Resource sync info changed: " + res);
				}
			}
			if ((flags & IResourceDelta.LOCAL_CHANGED) != 0) {
				if (DEBUG.IS_ON()) {
					DEBUG.OUT("Linked resource target info changed: " + res);
				}
				update = processLinkedTargerChanged(res);
			}
			break;
	}
	if (update) {
		updateResource(res);
	}
	return true; // visit the children
}